Conversation
The VectorScalar/ScalarVector/VectorVector operators took int size, so counts past 2^31 wrapped and the op wrote nothing. Co-authored-by: Jasim Kareem <mj9034812@gmail.com>
Co-authored-by: Jasim Kareem <mj9034812@gmail.com>
|
Thanks for picking this up — the three functors are the case I measured, and One sibling in the same header still narrows, and it is the path the report predicted for collapsed rank ≥ 4 (untested there):
Same wrap past 2^31, but on the strided/general-shape branch instead of the contiguous one. The one-line fix is On the test: |
Contiguous CPU binary functors took int size while callers passed size_t. Past 2^31 elements the count wrapped negative and the op wrote nothing, which broke mx.dequantize on CPU for non-power-of-two bit widths. Match unary/ternary and use size_t.
Fixes #4479.