Skip to content

Add past_key_values as inputs to TorchExportableModuleWithStaticCache forward #38917

@justinchuby

Description

@justinchuby

Feature request

With #38879, exporting with static cache as input should be supported in

def forward(self, input_ids: torch.Tensor, cache_position: torch.Tensor):
. This helps the exported program preserve proper input order for downstream conversion (e.g. torch.onnx.export).

Related

cc @xadupre @yuanyao-nv @guangy10

Motivation

Better preservation of exported program signatures

Your contribution

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions