You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OUT_OF_RANGE while invoking hal.fence.join for non-tiny model training #10903
iree-run-module throws an OUT_OF_RANGE error when executing the training step for models which train more than ~32 variables. For example, when attempting to execute training for a model with 36 variables the following error is thrown:
iree/runtime/src/iree/modules/hal/module.c:1038:
OUT_OF_RANGE; count 37 of iree_hal_fence > 32; while invoking native function hal.fence.join; while calling import;
Merely updating more than ~32 variables is insufficient so I've included the whole training step in the reproducer. The count above also doesn't solely depend on the number of variables.
Steps to reproduce your issue
The error above can be reproduced using the following reproducer: out_of_range.mlir
(interesting stuff in this model - lots of opportunities for dispatch formation improvements - seeing a lot of tensor->tensor dispatches that could be merged)
Interesting - I wonder why you don't hit the same assert I am in #10915 - may be worth trying one time in Debug just to make sure the IREE_ENABLE_ASSERTIONS flag is working as it should (I only run in Debug).
Hmmm, I did a Debug build from scratch with IREE_ENABLE_ASSERTIONS unset and I'm not hitting any asserts when I compile out_of_range.mlir.
In both configurations trying to execute the VMVX-compiled module causes iree-run-module to hang after printing EXEC @train_step. I actually noticed this behavior for some other modules as well, but wasn't sure if it was a bug or VMVX just being incredibly slow for some reason.
Gotcha! Training with llvm-cpu is currently blocked by #10839 so I switched to VMVX to see if I could find any other issues that might pop up down the line.
Activity
benvanik commentedon Oct 25, 2022
Interesting that these don't get coalesced - I suspect maybe the missing IPO step across an internal function call boundary. Will take a look.
benvanik commentedon Oct 25, 2022
(interesting stuff in this model - lots of opportunities for dispatch formation improvements - seeing a lot of tensor->tensor dispatches that could be merged)
benvanik commentedon Oct 25, 2022
(nevermind, dispatches are all just 1x1x1)
And yeah, this fusion stuff is real bad:

Whenever someone looks at performance for this model this should definitely be the starting point!
4 remaining items
Basic IPO pass for function cleanup.
Basic IPO pass for function cleanup.
Basic IPO pass for function cleanup. (#10911)
phoenix-meadowlark commentedon Oct 27, 2022
I've been using
RelWithDebInfo– wouldDebugbe a better option when just trying to test what is and isn't supported?ScottTodd commentedon Oct 27, 2022
https://iree-org.github.io/iree/building-from-source/getting-started/#clone-and-build
phoenix-meadowlark commentedon Oct 27, 2022
Okay yeah that's what I've been using!
benvanik commentedon Oct 27, 2022
Interesting - I wonder why you don't hit the same assert I am in #10915 - may be worth trying one time in Debug just to make sure the IREE_ENABLE_ASSERTIONS flag is working as it should (I only run in Debug).
phoenix-meadowlark commentedon Oct 27, 2022
Hmmm, I did a
Debugbuild from scratch withIREE_ENABLE_ASSERTIONSunset and I'm not hitting any asserts when I compileout_of_range.mlir.In both configurations trying to execute the VMVX-compiled module causes
iree-run-moduleto hang after printingEXEC @train_step. I actually noticed this behavior for some other modules as well, but wasn't sure if it was a bug or VMVX just being incredibly slow for some reason.benvanik commentedon Oct 27, 2022
VMVX is incredibly slow - try llvm-cpu :)
phoenix-meadowlark commentedon Oct 27, 2022
Gotcha! Training with llvm-cpu is currently blocked by #10839 so I switched to VMVX to see if I could find any other issues that might pop up down the line.
benvanik commentedon Oct 27, 2022
Oh nice - that's a duplicate of the issue I was hitting - we should make sure @MaheshRavishankar / @hanhanW / someone codegen sees it!
Basic IPO pass for function cleanup. (iree-org#10911)
Basic IPO pass for function cleanup. (iree-org#10911)