Skip to content

Implement ONNX GridSample operator with spatial interpolation modes#2002

Open
HudsonGraeme wants to merge 1 commit intosonos:mainfrom
inference-labs-inc:implement/grid-sample-operator
Open

Implement ONNX GridSample operator with spatial interpolation modes#2002
HudsonGraeme wants to merge 1 commit intosonos:mainfrom
inference-labs-inc:implement/grid-sample-operator

Conversation

@HudsonGraeme
Copy link

Introduce GridSample supporting bilinear, nearest, and bicubic interpolation with zeros, border, and reflection padding modes.

Introduce GridSample supporting bilinear, nearest, and bicubic
interpolation with zeros, border, and reflection padding modes.
@kali
Copy link
Collaborator

kali commented Mar 4, 2026

Thanks for the contribution. I had a look, it does look good, I'll have a few remarks/questions later. Let's see what the CI thinks first. We'll also run a "Full" CI on your branch to get coverage across ONNX versions.

@kali
Copy link
Collaborator

kali commented Mar 4, 2026

Ok so that's one of the nice-to-have things that I wanted to talk about actually. We try to make it so ONNX models are serializable and deserializable to tract variant of NNEF, and this is what this CI tests. It is useful for fast startup time with small or mid-size models on small devices, but it may be less relevant for this operators, but...

So this would require:

  • move nearly everything to a new module in onnx-opl. InferenceOp impl and onnx attribute extractors stays where they are.
  • add a nnef serialization and deserialization to the new module (i think it's pretty straightforward, we have 3 attributes / fields with simple values)

This is a nice-to-have. If you don't want to go there, I'm prepared to accept a PR without it : you can filter out the nnef-cycle test over this new operator.

@kali
Copy link
Collaborator

kali commented Mar 4, 2026

If I did not fudge the GHA setup the full CI is running there: https://github.com/sonos/tract/actions/runs/22661502716

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants