Skip to content

Refactor the signature of AD graph transformations #5249

@nzmora-nvidia

Description

@nzmora-nvidia

AD graph transformations, such as canonicalize_graph(gm: GraphModule, ...) -> GraphModule have a signature that implies that they return a transformed graph instance while leaving the gm unchanged. These transformations actually mutate the GraphModule instance in-place, which can be confusing.

Change all transform_graph(gm: GraphModule, ...) -> GraphModule to transform_graph(gm: GraphModule, ...) -> None and fix the code accordingly.

see slack conv: https://nvidia.slack.com/archives/C08T73CRBA6/p1749730434523839

Metadata

Metadata

Assignees

Labels

AutoDeploy<NV> AutoDeploy Backend

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions