Skip to content

Skip TRTInterpreter.validate_conversion when partition already proved full support. - #4693

Open
micwill755 wants to merge 1 commit into
skip-conversion-recompilefrom
network-construct
Open

micwill755 wants to merge 1 commit into
skip-conversion-recompilefrom
network-construct

Conversation

@micwill755

@micwill755 micwill755 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Skip TRTInterpreter.validate_conversion() when compile_module already proved full converter coverage (require_full_compilation and num_supported_ops == total_ops).
  • That __init__ walk is a second CONVERTERS.get() over every call_function / call_method / call_module node. Partition already did the same lookup via get_graph_converter_support. Under full compilation a missing-op warning cannot fire, so the extra pass is redundant.
  • Direct interpret_module_to_result / engine-converter / test-harness construction still validates (default skip_conversion_validation=False). Construct still CONVERTERS.gets per node when it converts.
  • Klein cold compile: interpreter.validate_conversion 0.102s → 0s.

PR 9 of the compile-startup stack; based on #4599.

Type of change

  • Performance (non-breaking; skips a redundant converter-support walk)

Test plan

  • Klein NVFP4 cold compile (GPU transformer, torchtrt-213rc10): skip-off validate_conversion 0.102s; skip-on the hook does not run. Engine still builds; steady ~0.43s.
  • Dedicated unit test that __init__ skips validate_conversion when the flag is set, and still warns when it is not
  • Existing dynamo conversion / partition tests (CI)

Checklist

  • Code follows project style (pre-commit: isort, ruff, black, mypy)
  • Self-review
  • Comment on why the skip is valid
  • Docs update (not needed)
  • New tests
  • Labels

Stack created with GitHub Stacks CLIGive Feedback 💬

@meta-cla meta-cla Bot added the cla signed label Sep 8, 2026
@github-actions github-actions Bot added component: conversion Issues re: Conversion stage 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 Sep 8, 2026
@github-actions
github-actions Bot requested a review from zewenli98 September 8, 2026 22:37
@micwill755
micwill755 requested review from cehongwang and narendasan and removed request for zewenli98 September 8, 2026 22:38
… full support.

compile_module already walks CONVERTERS via get_graph_converter_support. Under require_full_compilation with a complete count, the extra get() pass in interpreter __init__ cannot find missing ops, so skip it.

This branch has not been deployed

No deployments
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: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant