Skip to content

feat(dynamo): Add strict Dynamo compiler option validation with migration guidance, typo suggestions, and removal of deprecated settings - #5068

Merged
zewenli98 merged 2 commits into
mainfrom
evanli/user-friendly-prompts
Nov 24, 2026
Merged

zewenli98 merged 2 commits into
mainfrom
evanli/user-friendly-prompts

Conversation

@zewenli98

@zewenli98 zewenli98 commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Description

  • Add strict validation for removed, misspelled, and unsupported Dynamo compilation settings, including actionable migration guidance and typo suggestions.
  • Validate compiler options before tracing and consistently route tracing-only options such as strict.
  • Add regression coverage for top-level compile, cross-compilation, engine conversion, and torch.compile paths.
  • Remove deprecated settings from affected tests, examples, and documentation, migrating to truncate_double, immutable_weights, Debugger, strong typing, and automatic runtime selection.

Basically, it achieves:

  1. Typo detection with suggestions:
torch_tensorrt.compile(model, inputs=inputs, min_blok_size=1)
compile() got an unexpected keyword argument 'min_blok_size'.
Did you mean 'min_block_size'?
  1. Removed options include migration guidance:
torch_tensorrt.dynamo.compile(ep, refit=True)
`refit` has been removed.
Use `immutable_weights=False` to build a refittable engine.
  1. Multiple removed options are reported together:
torch_tensorrt.dynamo.compile(ep, debug=True, refit=True)
The following compiler options have been removed:
- `debug` has been removed. Use `torch_tensorrt.dynamo.Debugger(...)`.
- `refit` has been removed. Use `immutable_weights=False`.
  1. torch.compile options are also validated:
compiled = torch.compile(
    model,
    backend="torch_tensorrt",
    options={"min_blok_size": 1},
)
torch.compile() got an unexpected keyword argument 'min_blok_size'.
Did you mean 'min_block_size'?

Fixes #5030 #5040

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

@zewenli98 zewenli98 self-assigned this Nov 18, 2026
@meta-cla meta-cla Bot added the cla signed label Nov 18, 2026
@github-actions github-actions Bot added documentation Improvements or additions to documentation component: tests Issues re: Tests component: core Issues re: The core compiler component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Nov 18, 2026
@zewenli98 zewenli98 changed the title fix(dynamo): Add strict Dynamo compiler option validation with migration guidance, typo suggestions, and removal of deprecated settings feat(dynamo): Add strict Dynamo compiler option validation with migration guidance, typo suggestions, and removal of deprecated settings Nov 18, 2026

@narendasan narendasan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lanluo-nvidia lanluo-nvidia added this to the v2.16.0 milestone Nov 24, 2026
@zewenli98
zewenli98 merged commit 09d24a3 into main Nov 24, 2026
168 of 247 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests documentation Improvements or additions to documentation

Projects

None yet

3 participants