mlx icon indicating copy to clipboard operation
mlx copied to clipboard

Kernel failed while performing array matmul operation

Open kjdeveloper8 opened this issue 1 year ago • 1 comments

There's an issue i am facing while performing matmul operation on array, it causes kernel to restart everytime

code

a = mx.array([12])
b = mx.array([4])
mx.matmul(a, b)

error message

error

here's system info

System: Darwin
Node Name: MacBook-Air.local
Release: 22.4.0
Version: Darwin Kernel Version 22.4.0: Mon Mar  6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103
Machine: arm64
Processor: arm

python: 3.11.4

kjdeveloper8 avatar Jan 05 '24 11:01 kjdeveloper8

What version of MLX are you using? Building from source, if so what commit? I have to admit I've never seen anything even close to that message you are showing. So you'll need to give us quite a bit more detail on what you are doing before we can be helpful.

awni avatar Jan 05 '24 14:01 awni

The error is that the two arrays are integers and we are only allowing floating point matmuls. However, this should be caught in the op-level instead of going to the backend such that the exception would surface to the user.

@kjdeveloper8 you should use mx.array([12.0]) or mx.array([12]).astype(mx.float32) to have floating point arrays until this is fixed.

@awni the kernel here refers to the IPython or Jupyter kernel.

angeloskath avatar Jan 06 '24 01:01 angeloskath

the kernel here refers to the IPython or Jupyter kernel

Makes a lot more sense, thanks!

awni avatar Jan 06 '24 01:01 awni