-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Experimental prototype for converting torch.jit.trace modules to export #124449
Experimental prototype for converting torch.jit.trace modules to export #124449
Conversation
…gnature [ghstack-poisoned]
@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
3 similar comments
@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…gnature ghstack-source-id: 3aaf2a3f3ba4638aef5ce2101e8b22a8a57f0bc8 Pull Request resolved: #124449
…gnature ghstack-source-id: 3aaf2a3f3ba4638aef5ce2101e8b22a8a57f0bc8 Pull Request resolved: #124449
…ave code/signature" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) [ghstack-poisoned]
…ave code/signature" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) [ghstack-poisoned]
This pull request was exported from Phabricator. Differential Revision: D56440613 |
…ave code/signature" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) [ghstack-poisoned]
…ave code/signature" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) [ghstack-poisoned]
…gnature Pull Request resolved: #124449 @imported-using-ghimport Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613/) ghstack-source-id: d823a86cff475c1785f140140b49f548a8b921f9 Some update Pull Request resolved: #124450 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440611](https://our.internmc.facebook.com/intern/diff/D56440611/) ghstack-source-id: d823a86cff475c1785f140140b49f548a8b921f9 Make CI less noisy Pull Request resolved: #124664 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440612](https://our.internmc.facebook.com/intern/diff/D56440612/) ghstack-source-id: d823a86cff475c1785f140140b49f548a8b921f9
…les to export" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) cc ezyang msaroufim bdhirsh anijain2305 chauhang voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng [ghstack-poisoned]
…gnature Pull Request resolved: #124449 @imported-using-ghimport Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613/) ghstack-source-id: 39182d5d313da5d4d0b6b30fa8e94d974499276b Some update Pull Request resolved: #124450 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440611](https://our.internmc.facebook.com/intern/diff/D56440611/) ghstack-source-id: 39182d5d313da5d4d0b6b30fa8e94d974499276b Make CI less noisy Pull Request resolved: #124664 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440612](https://our.internmc.facebook.com/intern/diff/D56440612/) ghstack-source-id: 39182d5d313da5d4d0b6b30fa8e94d974499276b
…les to export" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) cc ezyang msaroufim bdhirsh anijain2305 chauhang voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng [ghstack-poisoned]
…gnature Pull Request resolved: #124449 @imported-using-ghimport Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613/) ghstack-source-id: 44bafb981fef6340a542a5abf8c27fe186a91c8b Some update Pull Request resolved: #124450 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440611](https://our.internmc.facebook.com/intern/diff/D56440611/) ghstack-source-id: 44bafb981fef6340a542a5abf8c27fe186a91c8b Make CI less noisy Pull Request resolved: #124664 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440612](https://our.internmc.facebook.com/intern/diff/D56440612/) ghstack-source-id: 44bafb981fef6340a542a5abf8c27fe186a91c8b
…les to export" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) We want to do this for following reasons: 1. There is current limitation in export tracing for torch.jit.trace d modules that cannot be easily upstreamed 2. We need to run internal CI regularly to understand feature gaps and continuously track them 3. Multiple people will be working on this prototype so it is better to have a checked in version so we don't always run into merge conflicts. cc ezyang msaroufim bdhirsh anijain2305 chauhang voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng [ghstack-poisoned]
…gnature Pull Request resolved: #124449 @imported-using-ghimport Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613/) ghstack-source-id: 550e93f774b6f6aa665eee31ff42c15c80907cfb Some update Pull Request resolved: #124450 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440611](https://our.internmc.facebook.com/intern/diff/D56440611/) ghstack-source-id: 550e93f774b6f6aa665eee31ff42c15c80907cfb Make CI less noisy Pull Request resolved: #124664 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440612](https://our.internmc.facebook.com/intern/diff/D56440612/) ghstack-source-id: 550e93f774b6f6aa665eee31ff42c15c80907cfb
@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
…les to export" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) We want to do this for following reasons: 1. There is current limitation in export tracing for torch.jit.trace d modules that cannot be easily upstreamed 2. We need to run internal CI regularly to understand feature gaps and continuously track them 3. Multiple people will be working on this prototype so it is better to have a checked in version so we don't always run into merge conflicts. cc ezyang msaroufim bdhirsh anijain2305 chauhang voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng [ghstack-poisoned]
…gnature Pull Request resolved: #124449 @imported-using-ghimport Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613/) ghstack-source-id: c5a0b72a295f371bdb1e0e55601e867c5ec41962 Some update Pull Request resolved: #124450 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440611](https://our.internmc.facebook.com/intern/diff/D56440611/) ghstack-source-id: c5a0b72a295f371bdb1e0e55601e867c5ec41962 Make CI less noisy Pull Request resolved: #124664 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440612](https://our.internmc.facebook.com/intern/diff/D56440612/) ghstack-source-id: c5a0b72a295f371bdb1e0e55601e867c5ec41962
@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@@ -153,11 +148,22 @@ def make_fake_inputs(nn_module, args, kwargs, dynamic_shapes): | |||
len(constraints) == 0 | |||
), "Found constraints when tracing with a toplevel tracing context." | |||
fake_mode = context.fake_mode | |||
else: | |||
elif not _is_torch_jit_trace: |
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.
can we leave a comment like "HACK" for all the workarounds made in this PR
…les to export" Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) We want to do this for following reasons: 1. There is current limitation in export tracing for torch.jit.trace d modules that cannot be easily upstreamed 2. We need to run internal CI regularly to understand feature gaps and continuously track them 3. Multiple people will be working on this prototype so it is better to have a checked in version so we don't always run into merge conflicts. cc ezyang msaroufim bdhirsh anijain2305 chauhang voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx chenyang78 kadeng [ghstack-poisoned]
…gnature Pull Request resolved: #124449 @imported-using-ghimport Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613/) ghstack-source-id: c056aa3cce08a23bf3271fd5a27f8c94baf109fa Some update Pull Request resolved: #124450 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440611](https://our.internmc.facebook.com/intern/diff/D56440611/) ghstack-source-id: c056aa3cce08a23bf3271fd5a27f8c94baf109fa Make CI less noisy Pull Request resolved: #124664 cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @chauhang @imported-using-ghimport Differential Revision: [D56440612](https://our.internmc.facebook.com/intern/diff/D56440612/) ghstack-source-id: c056aa3cce08a23bf3271fd5a27f8c94baf109fa
@tugsbayasgalan has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
) | ||
else: | ||
# FIXME(ycao): This is a hack to get around missing signature from ScriptMethod | ||
msg = "dummy constraint violation message" |
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.
Wonder if it's better to just have msg = ""
here, analogous to other zero-d out things in this mode. It might even be better to have a top-level dict of all the things we're zero-ing out, something like _torch_jit_trace_hacks = {"msg": "", "original_signature": None, ...}
etc. so that we have a good account of all the FIXMEs.
@pytorchbot merge -f 'Landed internally' (Initiating merge automatically since Phabricator Diff has merged, using force because this PR might not pass merge_rules.json but landed internally) |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…rt (pytorch#124449) Differential Revision: [D56440613](https://our.internmc.facebook.com/intern/diff/D56440613) We want to do this for following reasons: 1. There is current limitation in export tracing for torch.jit.trace d modules that cannot be easily upstreamed 2. We need to run internal CI regularly to understand feature gaps and continuously track them 3. Multiple people will be working on this prototype so it is better to have a checked in version so we don't always run into merge conflicts. Pull Request resolved: pytorch#124449 Approved by: https://github.com/angelayi, https://github.com/avikchaudhuri
Stack from ghstack (oldest at bottom):
Differential Revision: D56440613
We want to do this for following reasons:
cc @ezyang @msaroufim @bdhirsh @anijain2305 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng