-
Notifications
You must be signed in to change notification settings - Fork 24.4k
[JIT] parse prim::Constant[value=annotate()] and prim::Constant[value={0}] #76875
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
[JIT] parse prim::Constant[value=annotate()] and prim::Constant[value={0}] #76875
Conversation
…={0}] irparser previously didn't support these, which would cause failures in log_extract.py [ghstack-poisoned]
🔗 Helpful links
❌ 1 New FailuresAs of commit f4d51a9 (more details on the Dr. CI page): Expand to see more
🕵️ 1 new failure recognized by patternsThe following CI failures do not appear to be due to upstream breakages
|
…stant[value={0}]" irparser previously didn't support these, which would cause failures in log_extract.py [ghstack-poisoned]
@davidberard98 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
…stant[value={0}]" irparser previously didn't support these, which would cause failures in log_extract.py Differential Revision: [D36156699](https://our.internmc.facebook.com/intern/diff/D36156699) [ghstack-poisoned]
…stant[value={0}]" irparser previously didn't support these, which would cause failures in log_extract.py Differential Revision: [D36156699](https://our.internmc.facebook.com/intern/diff/D36156699) [ghstack-poisoned]
@davidberard98 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
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.
looking good, but a couple comments
graph = torch._C.parse_ir(ir, True) | ||
func = torch._C._create_function_from_graph("forward", graph) | ||
ret = func() | ||
self.assertTrue(ret.numel() == 1) |
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 you also check that len(ret.size() == 0)
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.
actually it's ret.size() == 1 for this tensor - added a check
%3 : int[] = prim::Constant[value=annotate(List[int], [])]() | ||
return (%3) | ||
""" | ||
graph = torch._C.parse_ir(ir, True) |
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.
nit, check result somehow ? maybe with
%1 : bool = prim::isinstance[types=[int[]]](%3)
return (%1)
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.
hmm that didn't work because... it can't parse List[int] 😄
I'm just checking == []
right now, lmk if you have another suggestion on how to do this
torch/csrc/jit/ir/irparser.cpp
Outdated
<< "Unexpected annotation (only List and Dict can be parsed)"; | ||
} | ||
L.next(); | ||
// use the profiling annotation instead of the `annotate()` type. |
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.
profiling is too specific, since types could come elsewhere. I would say something like ignore the annotations on the IValue constants, and recover type from the Node output
…stant[value={0}]" irparser previously didn't support these, which would cause failures in log_extract.py Differential Revision: [D36156699](https://our.internmc.facebook.com/intern/diff/D36156699) [ghstack-poisoned]
@davidberard98 has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
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
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!
@pytorchbot merge this please |
@pytorchbot revert this pls It broke Torchvision per the linked issue. |
…nt[value={0}]" This reverts commit 31d3ce7. Reverted #76875 on behalf of https://github.com/janeyx99
…t[value={0}]" Retry of #76875. It was reverted due to torchvision failures, but it turned out that the failures were caused by a different PR. irparser previously didn't support these, which would cause failures in log_extract.py [ghstack-poisoned]
…t[value={0}]" Retry of #76875. It was reverted due to torchvision failures, but it turned out that the failures were caused by a different PR. irparser previously didn't support these, which would cause failures in log_extract.py Pull Request resolved: #77377 Approved by: https://github.com/datumbox
…={0}] (#76875) Summary: irparser previously didn't support these, which would cause failures in log_extract.py Pull Request resolved: #76875 Approved by: https://github.com/eellison, https://github.com/tugsbayasgalan Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/31d3ce70005251860d78d3994b73894c14b067c5 Reviewed By: eellison, tugsbayasgalan Differential Revision: D36156699 fbshipit-source-id: 501df8f0f7744c55ce572468e38f61367108131a
…nt[value={0}]" Summary: This reverts commit 31d3ce7. Reverted #76875 on behalf of https://github.com/janeyx99 Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/2083b16f68963e563c6fbf6bf1084e78a7f66139 Reviewed By: atalman Differential Revision: D36322437 Pulled By: atalman fbshipit-source-id: 2d48ffa603e5b1f85f2bc493741b3279af474a96
…t[value={0}]" (#77377) Summary: Retry of #76875. It was reverted due to torchvision failures, but it turned out that the failures were caused by a different PR. irparser previously didn't support these, which would cause failures in log_extract.py Pull Request resolved: #77377 Approved by: https://github.com/datumbox Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/fa44e165ff5f616ae69c0d8dbca757f8d8a9159f Reviewed By: atalman Differential Revision: D36386459 Pulled By: davidberard98 fbshipit-source-id: b2ada187e94b8280020f4454e44981f6e45922e9
Stack from ghstack:
irparser previously didn't support these, which would cause failures in
log_extract.py
Differential Revision: D36156699