-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug][VTA][OpenCL] If allowed to allocate in stack, VTA multiple target test will fail #8978
Comments
Thanks for flagging this! and following up from #8274 IIUC, This is problematic for micro because now the constant sized allocates are forced to be placed on stack (bypassing TVMPlatformAllocate abstraction) because that is how the codegen_c lowers the allocate. tvm/src/target/source/codegen_c.cc Lines 860 to 877 in 1b99adc
I dont think is desired. Can someone explain why the guarded TVMBackendAllocWorkspace calls to allocate memory is problematic ? -- which are the ones I see generated in TIR prior to the last revert : #8274 ? cc: @jroesch @mbrookhart |
Also for some reason, if we really need the tir.allocate to be translated down to as a stack placement, we should probably make the tir.allocate with storage_scope = "local" to PrimFunc that is placed on CPU. keep the global ones served via TVMBAWs, because TVMBAW could serve as the 'global' allocator for memory. |
FYI - this PR renables the test that this change breaks #9019 |
@mbs-octoml opened this issue to track an approach to better distinguish multiple targets #9022 |
In
src/tir/transforms/lower_tvm_builtin.cc
:If the above optimization code is here, it will raise LLVM function signature errors when there are multiple targets. This piece of code was removed in #6126 to fix this issue. But it was reverted back in #8274, as removal of this code will cause some VM test failed.
To quick fix, the multiple target unittests are disabled in the current main branch. But we need further investigation on how to resolve this nicely.
cc @echuraev @elvin-n
The text was updated successfully, but these errors were encountered: