Skip to content

[ONNX] _rename_dynamic_shapes_with_model_inputs is not robust #143124

@titaiwangms

Description

@titaiwangms

🐛 Describe the bug

if len(input_names) != len(sig.parameters):

The function was meant to align dynamic_shapes keys to model signature, since torch.export.export does not support customized input_names. However, model.signature could be the same length as input_names accidentally. For example, input_names includes all kv_cache names, and LLM models usually come with a lot of Optional inputs, while kv_cache names only counts one because it's a list.

Versions

Nightly

Metadata

Metadata

Assignees

Labels

module: onnxRelated to torch.onnxonnx-triagedtriaged by ONNX teamtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions