mlx icon indicating copy to clipboard operation
mlx copied to clipboard

Add int64 reductions

Open klokare opened this issue 1 year ago • 1 comments

Ran into an issue with the sum function when using int64.

the following runs ok

import mlx.core as mx
y = mx.ones((70), dtype=mx.int32)
mx.sum(y)

the following crashes every time on my MacBook Pro M3 Pro / 18GB

import mlx.core as mx
y = mx.ones((70), dtype=mx.int64)
mx.sum(y)

with error message "libc++abi: terminating due to uncaught exception of type std::runtime_error: [Reduce::eval_gpu] Does not support int64"

can you confirm this is intended behaviour? or if it something that is planned for a future version?

klokare avatar Dec 26 '23 18:12 klokare

Yes, int64 is not yet supported in our reductions, that's expected. It's definitely possible to add, but not the highest priority at the moment. Happy to take a contribution for this though if someone is interested in adding it!

awni avatar Dec 26 '23 22:12 awni

@awni we can close this now.

vj-krish avatar Jan 31 '24 19:01 vj-krish

Thanks @vj-krish !!

awni avatar Jan 31 '24 19:01 awni

Fixed in #569.

angeloskath avatar Jan 31 '24 19:01 angeloskath