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

Allow some known extra inputs in the model #1167

Merged
merged 7 commits into from
Jan 9, 2025

Conversation

baijumeswani
Copy link
Collaborator

This pull-request adds some extra inputs to a registry, so users need not be aware of such extra inputs.

In particular, this pull-request adds the num_logits_to_keep input to the registry.

Models from huggingface/transformers that are exported using torch.onnx.export, can have an extra input called num_logits_to_keep that should be default be set to 0. Users should not need to know the input is required because it is an optimization in the torch model that does not impact the onnx model.

Sometimes, the exporter will rename the input to onnx::Neg_xyz. This pull-request also handles such scenarios.

src/models/extra_inputs.cpp Outdated Show resolved Hide resolved
src/models/extra_inputs.cpp Outdated Show resolved Hide resolved
src/models/extra_inputs.cpp Show resolved Hide resolved
src/models/extra_inputs.cpp Show resolved Hide resolved
@baijumeswani baijumeswani merged commit 43fa6ab into main Jan 9, 2025
14 checks passed
@baijumeswani baijumeswani deleted the baijumeswani/num-logits-to-keep branch January 9, 2025 21:36
@baijumeswani
Copy link
Collaborator Author

Thank you for the review :)

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

Successfully merging this pull request may close these issues.

2 participants