-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[AOTInductor] Add update_constant_buffer pybind support #140755
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/140755
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (3 Unrelated Failures)As of commit 04b9a02 with merge base 6afcec0 ( FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D65968613 |
db84d1d to
6f6f949
Compare
|
This pull request was exported from Phabricator. Differential Revision: D65968613 |
6f6f949 to
3c6417e
Compare
|
This pull request was exported from Phabricator. Differential Revision: D65968613 |
3c6417e to
e336352
Compare
|
This pull request was exported from Phabricator. Differential Revision: D65968613 |
Summary: We add update_constant_buffer python support for testing purpose. Test Plan: test/inductor:test_aot_inductor -- -r test_update_constant_buffer_cuda Reviewed By: 22quinn Differential Revision: D65968613
e336352 to
dc47e07
Compare
|
This pull request was exported from Phabricator. Differential Revision: D65968613 |
|
ArrayRef mode needs more work. |
Summary: Pull Request resolved: pytorch#140755 We add update_constant_buffer python support for testing purpose. Test Plan: test/inductor:test_aot_inductor -- -r test_update_constant_buffer_cuda Reviewed By: 22quinn Differential Revision: D65968613
dc47e07 to
04b9a02
Compare
|
This pull request was exported from Phabricator. Differential Revision: D65968613 |
|
@pytorchbot merge (Initiating merge automatically since Phabricator Diff has merged) |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Summary: We add update_constant_buffer python support for testing purpose. Test Plan: Included in commit Differential Revision: D65968613 Pull Request resolved: pytorch#140755 Approved by: https://github.com/22quinn
Summary: With the changes in #140755 and #141997, I added a load_constants function to the packaging API. Currently this doesn't work for cpu. The workflow is something like: ``` ep = torch.export.export(model, example_inputs) package = torch._inductor.aoti_compile_and_package(ep, inductor_configs=inductor_configs) compiled = torch._inductor.aoti_load_package(package) print(compiled.get_constant_fqns()) # see what are the fqns needed/available compiled.load_constants(new_state_dict, check_full_update=True) # update the constants in AOTI ``` You can also use the `aot_inductor.package_constants_in_so` config to stop including the constants in the so: ``` package = torch._inductor.aoti_compile_and_package(ep, inductor_configs={`aot_inductor.package_constants_in_so`: False) compiled = torch._inductor.aoti_load_package(package) compiled(*inputs) # segfaults because there are no constants --> we should probably have a better error msg compiled.load_constants(new_state_dict, check_full_update=True) compiled(*inputs) ``` Test Plan: `buck2 run @//mode/dev-nosan //caffe2/test/inductor:aot_inductor_package -- -r "test_so_without_weight" ` Differential Revision: D66796206
Summary: Pull Request resolved: pytorch#142246 With the changes in pytorch#140755 and pytorch#141997, I added a load_constants function to the packaging API. Currently this doesn't work for cpu. The workflow is something like: ``` ep = torch.export.export(model, example_inputs) package = torch._inductor.aoti_compile_and_package(ep, inductor_configs=inductor_configs) compiled = torch._inductor.aoti_load_package(package) print(compiled.get_constant_fqns()) # see what are the fqns needed/available compiled.load_constants(new_state_dict, check_full_update=True) # update the constants in AOTI ``` You can also use the `aot_inductor.package_constants_in_so` config to stop including the constants in the so: ``` package = torch._inductor.aoti_compile_and_package(ep, inductor_configs={`aot_inductor.package_constants_in_so`: False) compiled = torch._inductor.aoti_load_package(package) compiled(*inputs) # segfaults because there are no constants --> we should probably have a better error msg compiled.load_constants(new_state_dict, check_full_update=True) compiled(*inputs) ``` Test Plan: `buck2 run @//mode/dev-nosan //caffe2/test/inductor:aot_inductor_package -- -r "test_so_without_weight" ` Reviewed By: henrylhtsang Differential Revision: D66796206
Summary: With the changes in #140755 and #141997, I added a load_constants function to the packaging API. Currently this doesn't work for cpu. The workflow is something like: ``` ep = torch.export.export(model, example_inputs) package = torch._inductor.aoti_compile_and_package(ep, inductor_configs=inductor_configs) compiled = torch._inductor.aoti_load_package(package) print(compiled.get_constant_fqns()) # see what are the fqns needed/available compiled.load_constants(new_state_dict, check_full_update=True) # update the constants in AOTI ``` You can also use the `aot_inductor.package_constants_in_so` config to stop including the constants in the so: ``` package = torch._inductor.aoti_compile_and_package(ep, inductor_configs={`aot_inductor.package_constants_in_so`: False) compiled = torch._inductor.aoti_load_package(package) compiled(*inputs) # segfaults because there are no constants --> we should probably have a better error msg compiled.load_constants(new_state_dict, check_full_update=True) compiled(*inputs) ``` Test Plan: `buck2 run @//mode/dev-nosan //caffe2/test/inductor:aot_inductor_package -- -r "test_so_without_weight" ` Differential Revision: D66796206 Pull Request resolved: #142246 Approved by: https://github.com/henrylhtsang, https://github.com/desertfire
Summary: We add update_constant_buffer python support for testing purpose. Test Plan: Included in commit Differential Revision: D65968613 Pull Request resolved: pytorch#140755 Approved by: https://github.com/22quinn
Summary: With the changes in pytorch#140755 and pytorch#141997, I added a load_constants function to the packaging API. Currently this doesn't work for cpu. The workflow is something like: ``` ep = torch.export.export(model, example_inputs) package = torch._inductor.aoti_compile_and_package(ep, inductor_configs=inductor_configs) compiled = torch._inductor.aoti_load_package(package) print(compiled.get_constant_fqns()) # see what are the fqns needed/available compiled.load_constants(new_state_dict, check_full_update=True) # update the constants in AOTI ``` You can also use the `aot_inductor.package_constants_in_so` config to stop including the constants in the so: ``` package = torch._inductor.aoti_compile_and_package(ep, inductor_configs={`aot_inductor.package_constants_in_so`: False) compiled = torch._inductor.aoti_load_package(package) compiled(*inputs) # segfaults because there are no constants --> we should probably have a better error msg compiled.load_constants(new_state_dict, check_full_update=True) compiled(*inputs) ``` Test Plan: `buck2 run @//mode/dev-nosan //caffe2/test/inductor:aot_inductor_package -- -r "test_so_without_weight" ` Differential Revision: D66796206 Pull Request resolved: pytorch#142246 Approved by: https://github.com/henrylhtsang, https://github.com/desertfire
Summary: We add update_constant_buffer python support for testing purpose.
Test Plan: Included in commit
Differential Revision: D65968613
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @ColinPeppler @amjames @desertfire @chauhang @aakhundov