huggingface / candle

Minimalist ML framework for Rust
Apache License 2.0
13.79k stars 751 forks source link

Add missing onnx operations #2096

Closed gabotechs closed 3 weeks ago

gabotechs commented 3 weeks ago

Follow up for https://github.com/huggingface/candle/pull/2049

Adds the following onnx operations along with tests based on the official onnx examples for the following operations:

Additionally, fixes support for the following operations, also adding tests:


With this, I was able to run MusicGen's text encoder onnx model, but there's still something wrong, even though the model now runs successfully, the output is:

[[[NaN, NaN, NaN, ..., NaN, NaN, NaN],
  [NaN, NaN, NaN, ..., NaN, NaN, NaN]]]
Tensor[[1, 2, 768], f32]

I've verified that my the onnx file is correct (I can run it successfully with https://github.com/pykeio/ort), so there must be something else in candle-onnx that is not working correctly.

LaurentMazare commented 3 weeks ago

Thanks!