-
Notifications
You must be signed in to change notification settings - Fork 140
Crash when lowering multiple dimention array #957
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
Comments
keryell
pushed a commit
to keryell/clangir
that referenced
this issue
Oct 19, 2024
…ly (llvm#961) Close llvm#957 the previous algorithm to convert a multiple dimension array to a tensor is: fill the value one by one and fill the zero values in conditions. And it has some problems handling the multiple dimension array as above issue shows so that the generated values are not in the same shape with the original array. the new algorithm here is, full fill the values ahead of time with the correct element size and full fill the values to different slots and we only need to maintain the index to write. I feel the new version has better performance (avoid allocation) and better readability slightly.
lanza
pushed a commit
that referenced
this issue
Nov 5, 2024
…ly (#961) Close #957 the previous algorithm to convert a multiple dimension array to a tensor is: fill the value one by one and fill the zero values in conditions. And it has some problems handling the multiple dimension array as above issue shows so that the generated values are not in the same shape with the original array. the new algorithm here is, full fill the values ahead of time with the correct element size and full fill the values to different slots and we only need to maintain the index to write. I feel the new version has better performance (avoid allocation) and better readability slightly.
lanza
pushed a commit
that referenced
this issue
Mar 18, 2025
…ly (#961) Close #957 the previous algorithm to convert a multiple dimension array to a tensor is: fill the value one by one and fill the zero values in conditions. And it has some problems handling the multiple dimension array as above issue shows so that the generated values are not in the same shape with the original array. the new algorithm here is, full fill the values ahead of time with the correct element size and full fill the values to different slots and we only need to maintain the index to write. I feel the new version has better performance (avoid allocation) and better readability slightly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproducer:
the interesting part is, if we change the first dimension
10
to any number lower, it won't crash.The crash information comes from:
clangir/clang/lib/CIR/Lowering/LoweringHelpers.cpp
Lines 124 to 125 in 2ca12fe
where the MLIR will assert the size of
values
will be the same with tensor. The shape of the tensor is correct. However, we will insert values tovalues
inclangir/clang/lib/CIR/Lowering/LoweringHelpers.cpp
Lines 79 to 115 in 2ca12fe
values
with enough elements.I think we should resize
values
in the first place and assign values to the corresponding slot.The text was updated successfully, but these errors were encountered: