Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TopK with dynamic K #1091

Closed
alexander-camuto opened this issue May 23, 2023 · 4 comments · Fixed by #1205
Closed

TopK with dynamic K #1091

alexander-camuto opened this issue May 23, 2023 · 4 comments · Fixed by #1205

Comments

@alexander-camuto
Copy link
Contributor

alexander-camuto commented May 23, 2023

Models with TopK nodes fail to type.

A sample error:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failed analyse for node #717 "TopK_717" Topk

Caused by:
    0: Infering facts
    1: Applying rule inputs[1].datum_type == I64
    2: Impossible to unify TDim with I64.', src/main.rs:12:36

A repo to reproduce the issue (I swear it is public this time): https://github.com/alexander-camuto/topk-issue-repro

To reproduce the issue this time you need to download the model at https://github.com/onnx/models/raw/main/vision/object_detection_segmentation/ssd/model/ssd-10.onnx to ./src/network.onnx

then run

RUST_LOG=trace cargo run 
@kali
Copy link
Collaborator

kali commented May 23, 2023

repo is public indeed :)

Given the time you spend struggling with tract, you may want to invest a bit of time in trying the command line. This issue can be repro with:

tract ssd-10.onnx --onnx-ignore-output-shapes

I'm having a look.

@alexander-camuto
Copy link
Contributor Author

as always ty for the tip :)

@kali kali changed the title TopK nodes fail to type TopK with dynamic K May 23, 2023
@kali
Copy link
Collaborator

kali commented May 23, 2023

When I implemented TopK a couple of weeks ago, it was pretty clear that K would always be constant. This "always" was a pretty short-lived one... I'm going to try to do this soon-ish.

@JernKunpittaya
Copy link

Hi, we are trying to implement stats function using ezkl, like percentile and median stuffs, so would be nice to have this sort feature :) Thanks!

@kali kali linked a pull request Sep 18, 2023 that will close this issue
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 a pull request may close this issue.

3 participants