Skip to content

feature: Dynamo implementation of torch_executed_modules - #4639

Open
dongwoonhyun wants to merge 2 commits into
pytorch:mainfrom
dongwoonhyun:dhyun/dynamo_torch_executed_modules
Open

feature: Dynamo implementation of torch_executed_modules#4639
dongwoonhyun wants to merge 2 commits into
pytorch:mainfrom
dongwoonhyun:dhyun/dynamo_torch_executed_modules

Conversation

@dongwoonhyun

Copy link
Copy Markdown

Description

Implementation of torch_executed_modules for the dynamo path. The usage is consistent with the TorchScript version (matching by fully-qualified class name). The actual implementation walks through node.meta.get("nn_module_stack") and excludes the node if its or any of its parents' modules are in torch_executed_modules.

Also added tests to the fast and global partitioners that exercise the feature.

Type of change

  • New feature (non-breaking change which adds functionality)

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

Usage is consistent with the TorchScript version (matching by fully-qualified class name). The implementation checks each node's `nn_module_stack` metadata to see if it or any parent module matches.
The fast and global partitioners are tested to make sure they produce 2, 1, or 0 TRT engines depending on torch_executed_modules. An extra test is added for the None behavior fix.
@meta-cla meta-cla Bot added the cla signed label Aug 28, 2026
@github-actions github-actions Bot added 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 Aug 28, 2026
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant