Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Module-Acceleration in Dynamo [5 / x] #1979

Merged
merged 2 commits into from
Jun 29, 2023

Conversation

gs-olive
Copy link
Collaborator

@gs-olive gs-olive commented Jun 5, 2023

Description

  • Add support for excluding entire Torch modules from tracing in Dynamo using Torch custom operators
  • Develop new dataclass to store required replacement functions and operators in a streamlined way
  • Add new registry to store mapping between replacement operators and their corresponding dataclass
  • Add detailed tutorial descriptions to sample module substitution with step-by-step detailed instructions for creating a new module substitution

Fixes #1894

Type of change

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

Checklist:

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

@gs-olive gs-olive requested a review from narendasan June 5, 2023 16:32
@gs-olive gs-olive self-assigned this Jun 5, 2023
@github-actions github-actions bot added the component: api [Python] Issues re: Python API label Jun 5, 2023
@gs-olive gs-olive added component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths Story: Dynamo Compile Improvements Issues relating to improvement of the Dynamo compile path and removed component: api [Python] Issues re: Python API cla signed labels Jun 5, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

@gs-olive gs-olive force-pushed the dynamo_module_level_acceleration branch from 668156b to 80b898a Compare June 5, 2023 16:36
@github-actions github-actions bot added the component: api [Python] Issues re: Python API label Jun 5, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

@gs-olive gs-olive force-pushed the dynamo_module_level_acceleration branch from 80b898a to d235c0f Compare June 5, 2023 17:19
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

@gs-olive gs-olive force-pushed the torch_version_upgrade_jun23_nightly branch from 4ba253f to 1bf1ff7 Compare June 8, 2023 20:08
@gs-olive gs-olive force-pushed the dynamo_module_level_acceleration branch from d235c0f to a0ff354 Compare June 8, 2023 20:12
@gs-olive gs-olive changed the title feat: Prototype Module-Acceleration in Dynamo [4 / x] feat: Module-Acceleration in Dynamo [7 / x] Jun 8, 2023
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

@gs-olive gs-olive force-pushed the torch_version_upgrade_jun23_nightly branch from 1bf1ff7 to 741364a Compare June 8, 2023 23:30
@gs-olive gs-olive force-pushed the dynamo_module_level_acceleration branch from a0ff354 to b16d17b Compare June 8, 2023 23:30
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

@gs-olive gs-olive force-pushed the torch_version_upgrade_jun23_nightly branch 3 times, most recently from d0c39f3 to 3751e32 Compare June 20, 2023 19:53
@gs-olive gs-olive force-pushed the dynamo_module_level_acceleration branch from c0715f2 to 57215f1 Compare June 21, 2023 00:56
@gs-olive gs-olive changed the base branch from torch_version_upgrade_jun23_nightly to dynamo_compile_trt_module_next June 21, 2023 00:56
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

@gs-olive gs-olive force-pushed the dynamo_module_level_acceleration branch from 57215f1 to fbe12e3 Compare June 23, 2023 03:19
@gs-olive gs-olive changed the base branch from dynamo_compile_trt_module_next to main June 23, 2023 03:19
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

py/torch_tensorrt/dynamo/backend/backends.py Outdated Show resolved Hide resolved
"ceil_mode": False if len(args) < 6 else args[5],
}

return acc_ops_converters.acc_ops_max_pool1d(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this would depend on the dynamo converters change but it would be good to use the impl directly, we can also add a TODO and comeback after

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Instanced #1985 to add this in a subsequent PR

@gs-olive gs-olive force-pushed the dynamo_module_level_acceleration branch from fbe12e3 to 7e2388f Compare June 28, 2023 19:48
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

@gs-olive gs-olive requested a review from narendasan June 28, 2023 21:11
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

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

LGTM, lets add a tutorial on this in the contributor docs

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

- Add support for excluding entire Torch modules from tracing in Dynamo
using Torch custom operators
- Develop new dataclass to store required replacement functions and
operators in a streamlined way
- Add new registry to store mapping between replacement operators and
their corresponding dataclass
- Add documentation for easy additions of new module-level exclusion
operators
- Add robust testing and address recent review comments
@gs-olive gs-olive force-pushed the dynamo_module_level_acceleration branch from f26ca80 to c9f06fc Compare June 29, 2023 00:53
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to C++ style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Code conforms to Python style guidelines

@gs-olive gs-olive merged commit 2844630 into main Jun 29, 2023
4 checks passed
@gs-olive gs-olive deleted the dynamo_module_level_acceleration branch June 29, 2023 16:08
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: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths Story: Dynamo Compile Improvements Issues relating to improvement of the Dynamo compile path
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨[Feature] Upgrade Prototype System for Module-Level Acceleration in Dynamo Path
3 participants