-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[JIT] Add support for backend-lowered submodules #40841
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
Conversation
**Summary** This commit adds support for using `Modules` that have been lowered as submodules in `ScriptModules`. **Test Plan** This commit adds execution and save/load tests to test_backends.py for backend-lowered submodules. **Fixes** This commit fixes #40069. [ghstack-poisoned]
💊 CI failures summary and remediationsAs of commit 4f1c381 (more details on the Dr. CI page): 💚 💚 Looks good so far! There are no failures yet. 💚 💚 This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group. This comment has been revised 10 times. |
**Summary** This commit adds support for using `Modules` that have been lowered as submodules in `ScriptModules`. **Test Plan** This commit adds execution and save/load tests to test_backends.py for backend-lowered submodules. **Fixes** This commit fixes #40069. [ghstack-poisoned]
**Summary** This commit adds support for using `Modules` that have been lowered as submodules in `ScriptModules`. **Test Plan** This commit adds execution and save/load tests to test_backends.py for backend-lowered submodules. **Fixes** This commit fixes #40069. [ghstack-poisoned]
**Summary** This commit adds support for using `Modules` that have been lowered as submodules in `ScriptModules`. **Test Plan** This commit adds execution and save/load tests to test_backends.py for backend-lowered submodules. **Fixes** This commit fixes #40069. [ghstack-poisoned]
| self.test_execution() | ||
|
|
||
|
|
||
| class NestedModuleTest(JitBackendTestCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kind of hard to read this test because NestedModule and MyModule are defined at the top of this file. Generally we define any necessary test-specific fixtures inside the body of a test so that things stay local.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to nest MyModule because this test and the other test both use it. I can nest NestedModule though.
| // This is a helper function for creating a new instance of the | ||
| // backend class. | ||
| static const auto create_backend_ct = CodeTemplate(R"( | ||
| auto codegen_lambda = [=](const std::string& backend_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind commenting on what the meaningful change here is? I think the indentation shift made GH freak out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrapped all the codegen in a lambda so I could do:
return wrap_cpp_module(codegen_lambda(args)));
instead of
return wrap_cpp_module([](...){
// lots
// of
// code
});
**Summary** This commit adds support for using `Modules` that have been lowered as submodules in `ScriptModules`. **Test Plan** This commit adds execution and save/load tests to test_backends.py for backend-lowered submodules. **Fixes** This commit fixes #40069. [ghstack-poisoned]
suo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
|
@SplitInfinity merged this pull request in 6777ea1. |
Summary: Pull Request resolved: #40841 **Summary** This commit adds support for using `Modules` that have been lowered as submodules in `ScriptModules`. **Test Plan** This commit adds execution and save/load tests to test_backends.py for backend-lowered submodules. **Fixes** This commit fixes #40069. ghstack-source-id: b6aabcf
Stack from ghstack:
Summary
This commit adds support for using
Modulesthat have been lowered assubmodules in
ScriptModules.Test Plan
This commit adds execution and save/load tests to test_backends.py for
backend-lowered submodules.
Fixes
This commit fixes #40069.
Differential Revision: D22418716