Conversation
- Update _infer_literal_dtype to handle TensorHandle with multiple data elements - Verify dtype consistency across all elements in multi-element cases - Modify from_value to preserve entire array for multi-element TensorHandle - Maintain backward compatibility for single-element cases This fixes crashes when using `tl.interleave` and similar operations that produce TensorHandle objects with multiple internal values.
| raise ValueError( | ||
| f"Unsupported var.data: {var.data} with length more than one!" | ||
| ) | ||
| # Handle TensorHandle with potentially multiple data elements |
There was a problem hiding this comment.
Which kernel and line will trigger this branch? It's quite weird to me. And var.data should have a single type
There was a problem hiding this comment.
x = tl.interleave(x_low_bits, x_high_bits)
There was a problem hiding this comment.
And var.data should have a single type
Line 1007 to 1019 are assertions that make sure all elements in var.data should have one same type.
There was a problem hiding this comment.
Which kernel and line will trigger this branch? It's quite weird to me. And var.data should have a single type
It's in #144. Specifically, tl.interleave.
There was a problem hiding this comment.
I still don't understand.
tl.interleaveis an api but not a core op. You should wrapjoinbut not interleave.- we shouldn't iterate over all items in a tensor in any ways.
There was a problem hiding this comment.
Please try to wrap the join op and other ops that tl.interleave involves without referring to your current code. If not successful, we can discuss tomorrow.
There was a problem hiding this comment.
Because here you check the type of
TensorHandle
I think I got what you mean. Maybe I should raise an error when sanitizer encounters TensorHandle since we literally replaced every TensorHandle with SymbolicExpr.
There was a problem hiding this comment.
And create_join is not wrapped correctly. Let me wrap that first.
|
Closed due to not wrapping |
This fixes crashes when using
tl.interleaveand similar operations that produce TensorHandle objects with multiple internal values.Fixes #144.