tracel-ai / burn

Burn is a new comprehensive dynamic Deep Learning Framework built using Rust with extreme flexibility, compute efficiency and portability as its primary goals.
https://burn.dev
Apache License 2.0
7.79k stars 372 forks source link

Support ConstantOfShape ONNX Operator - Silero VAD ONNX model #1941

Open smallbraingames opened 6 days ago

smallbraingames commented 6 days ago

Feature description

I'd love support for the ConstantOfShape (9) ONNX Operator, which isn't currently implemented according to the docs

Feature motivation

To use Silero VAD on embedded hardware / really cheaply in wasm

The operators needed for that are

ai.onnx;1;Not
ai.onnx;9;ConstantOfShape
ai.onnx;11;Conv
ai.onnx;13;Cast,Concat,Equal,Gather,Pad,ReduceMean,Size,Split,Sqrt,Squeeze,Unsqueeze
ai.onnx;14;Add,LSTM,Relu
ai.onnx;15;Pow,Shape
ai.onnx;16;Identity,If
com.microsoft;1;FusedConv

<3

antimora commented 6 days ago

there is an outstanding pr for constant https://github.com/tracel-ai/burn/issues/1815

antimora commented 4 days ago

The direct link file: https://github.com/snakers4/silero-vad/blob/master/files/silero_vad.onnx

Attached: silero_vad.onnx.zip

In addition to missing ConstantOfShape, Burn ONNX needs to support subgraphs, see #724.

CCing @skewballfox. This is something to consider for our future design.

smallbraingames commented 4 days ago

Ah got it, that makes sense. Looks like that will take some larger design changes?

antimora commented 4 days ago

Yes, that's correct. But it is good that you file now we know to prioritize this feature. I have been wanting to use it as well.

smallbraingames commented 4 days ago

Love it. Can't wait to use it and have a 10x smaller wasm