[Lite Interpreter] [Lite Interpreter] Operator registration migrate from manual to selective build#35426
Closed
iseeyuan wants to merge 8 commits intogh/iseeyuan/61/basefrom
Closed
[Lite Interpreter] [Lite Interpreter] Operator registration migrate from manual to selective build#35426iseeyuan wants to merge 8 commits intogh/iseeyuan/61/basefrom
iseeyuan wants to merge 8 commits intogh/iseeyuan/61/basefrom
Conversation
…"_" prefix Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! [ghstack-poisoned]
💊 CircleCI build failures summary and remediationsAs of commit 1545f22 (more details on the Dr. CI page): ✅ None of the build failures appear to be your fault 💚
🚧 1 upstream failure:These were probably caused by upstream breakages:
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. This comment has been revised 22 times. |
…es without "_" prefix" Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! [ghstack-poisoned]
iseeyuan
added a commit
that referenced
this pull request
Mar 28, 2020
…tive build Pull Request resolved: #35426 Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Lite interpreter relies on JIT operator dispatch. In future we still need JIT operator dispatch dispatch ops that are not registered in c10. Currently the selective build is for c10/aten dispatch in BUCK. There is JIT selective code-gen in OSS but not ported to BUCK yet. This diff is also porting the selective code-gen in BUCK. * The selected op list is passed to gen_jit_dispatch.py. * The list passed to gen_jit_dispatch is the top-level ops (USED_PT_OPS) only, because the selective c10/aten dispatch already registered other ops that are called from the top-level ops. ghstack-source-id: 101084371 Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)!
…es without "_" prefix" Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! [ghstack-poisoned]
iseeyuan
added a commit
that referenced
this pull request
Apr 6, 2020
…tive build Pull Request resolved: #35426 Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Lite interpreter relies on JIT operator dispatch. In future we still need JIT operator dispatch dispatch ops that are not registered in c10. Currently the selective build is for c10/aten dispatch in BUCK. There is JIT selective code-gen in OSS but not ported to BUCK yet. This diff is also porting the selective code-gen in BUCK. * The selected op list is passed to gen_jit_dispatch.py. * The list passed to gen_jit_dispatch is the top-level ops (USED_PT_OPS) only, because the selective c10/aten dispatch already registered other ops that are called from the top-level ops. ghstack-source-id: 101565513 Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)!
This was referenced Apr 6, 2020
…es without "_" prefix" Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! [ghstack-poisoned]
…es without "_" prefix" Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! [ghstack-poisoned]
…es without "_" prefix" Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! [ghstack-poisoned]
…es without "_" prefix" Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! [ghstack-poisoned]
…es without "_" prefix" Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! [ghstack-poisoned]
iseeyuan
added a commit
that referenced
this pull request
Apr 9, 2020
…tive build Pull Request resolved: #35426 Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Lite interpreter relies on JIT operator dispatch. In future we still need JIT operator dispatch dispatch ops that are not registered in c10. Currently the selective build is for c10/aten dispatch in BUCK. There is JIT selective code-gen in OSS but not ported to BUCK yet. This diff is also porting the selective code-gen in BUCK. * The selected op list is passed to gen_jit_dispatch.py. * The list passed to gen_jit_dispatch is the top-level ops (USED_PT_OPS) only, because the selective c10/aten dispatch already registered other ops that are called from the top-level ops. ghstack-source-id: 101885215 Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)!
Contributor
|
This pull request has been merged in 7fcf8b0. |
Contributor
|
This broke clang-format |
ashishfarmer
pushed a commit
to ashishfarmer/pytorch
that referenced
this pull request
Apr 13, 2020
…tive build (pytorch#35426) Summary: Pull Request resolved: pytorch#35426 Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Lite interpreter relies on JIT operator dispatch. In future we still need JIT operator dispatch dispatch ops that are not registered in c10. Currently the selective build is for c10/aten dispatch in BUCK. There is JIT selective code-gen in OSS but not ported to BUCK yet. This diff is also porting the selective code-gen in BUCK. * The selected op list is passed to gen_jit_dispatch.py. * The list passed to gen_jit_dispatch is the top-level ops (USED_PT_OPS) only, because the selective c10/aten dispatch already registered other ops that are called from the top-level ops. ghstack-source-id: 101885215 (Note: this ignores all push blocking failures!) Test Plan: 1. In Python, run torch.jit.export_opnames(scripted_M_mod) 2. Append the operator names into fbcode/caffe2/pt_ops.bzl and the BUCK target. 3. Run ``` buck run xplat/caffe2/fb/lite_predictor:lite_predictor_bi -- --model=/home/myuan/temp/bi_pytext_0315.bc --input_dims "1,4" --input_type int64 --pytext_len=4 ``` Should provide expected results. In addition, the size of the generated code for JIT registration, for example, ```register_aten_ops_0.cpp```, should be significantly reduced (from ~250 KB to ~80KB). The non-selected op registration schema are still kept, but the registration functor is replaced by ```DUMMY_OPERATION``` Reviewed By: ljk53 Differential Revision: D20408831 fbshipit-source-id: ec75dd762c4613aeda3b2094f5dad11804dc9492
ashishfarmer
pushed a commit
to ashishfarmer/pytorch
that referenced
this pull request
Apr 13, 2020
…ch#36393) Summary: Pull Request resolved: pytorch#36393 Fix the clang-format CI error caused in pytorch#35426 Test Plan: Imported from OSS Differential Revision: D20964854 Pulled By: iseeyuan fbshipit-source-id: 97f2ba1e006cac0f33b223315263b0b84c24cb15
okly366
pushed a commit
to okly366/pytorch
that referenced
this pull request
Apr 26, 2020
…"_" prefix Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit. Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)! ghstack-source-id: 100876252 Pull Request resolved: pytorch/pytorch#35426
karansachdev-1012
pushed a commit
to karansachdev-1012/pytorch
that referenced
this pull request
Feb 17, 2026
…tive build Pull Request resolved: pytorch/pytorch#35426 Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Lite interpreter relies on JIT operator dispatch. In future we still need JIT operator dispatch dispatch ops that are not registered in c10. Currently the selective build is for c10/aten dispatch in BUCK. There is JIT selective code-gen in OSS but not ported to BUCK yet. This diff is also porting the selective code-gen in BUCK. * The selected op list is passed to gen_jit_dispatch.py. * The list passed to gen_jit_dispatch is the top-level ops (USED_PT_OPS) only, because the selective c10/aten dispatch already registered other ops that are called from the top-level ops. ghstack-source-id: 101851352 Differential Revision: [D20408831](https://our.internmc.facebook.com/intern/diff/D20408831/) **NOTE FOR REVIEWERS**: This PR has internal Facebook specific changes or comments, please review them on [Phabricator](https://our.internmc.facebook.com/intern/diff/D20408831/)!
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
…tive build (pytorch#35426) Summary: Pull Request resolved: pytorch#35426 Use selective build with the full set of operators (vs. manually register each used op with "_" prefix). Lite interpreter relies on JIT operator dispatch. In future we still need JIT operator dispatch dispatch ops that are not registered in c10. Currently the selective build is for c10/aten dispatch in BUCK. There is JIT selective code-gen in OSS but not ported to BUCK yet. This diff is also porting the selective code-gen in BUCK. * The selected op list is passed to gen_jit_dispatch.py. * The list passed to gen_jit_dispatch is the top-level ops (USED_PT_OPS) only, because the selective c10/aten dispatch already registered other ops that are called from the top-level ops. ghstack-source-id: 101885215 (Note: this ignores all push blocking failures!) Test Plan: 1. In Python, run torch.jit.export_opnames(scripted_M_mod) 2. Append the operator names into fbcode/caffe2/pt_ops.bzl and the BUCK target. 3. Run ``` buck run xplat/caffe2/fb/lite_predictor:lite_predictor_bi -- --model=/home/myuan/temp/bi_pytext_0315.bc --input_dims "1,4" --input_type int64 --pytext_len=4 ``` Should provide expected results. In addition, the size of the generated code for JIT registration, for example, ```register_aten_ops_0.cpp```, should be significantly reduced (from ~250 KB to ~80KB). The non-selected op registration schema are still kept, but the registration functor is replaced by ```DUMMY_OPERATION``` Reviewed By: ljk53 Differential Revision: D20408831 fbshipit-source-id: ec75dd762c4613aeda3b2094f5dad11804dc9492
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
…ch#36393) Summary: Pull Request resolved: pytorch#36393 Fix the clang-format CI error caused in pytorch#35426 Test Plan: Imported from OSS Differential Revision: D20964854 Pulled By: iseeyuan fbshipit-source-id: 97f2ba1e006cac0f33b223315263b0b84c24cb15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
Use selective build with the full set of operators (vs. manually register each used op with "_" prefix).
Currently "-c pt.disable_gen_tracing=1" must be used to strip the tracing part of code-gen ops, so that the mobile code can build without dependency on full jit.
Differential Revision: D20408831
NOTE FOR REVIEWERS: This PR has internal Facebook specific changes or comments, please review them on Phabricator!