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
[fx] introduce __fx_create_arg__
dunder method for controlling custom classes are handled as node args
#61780
Conversation
💊 CI failures summary and remediationsAs of commit 2048f40 (more details on the Dr. CI page and at hud.pytorch.org/pr/61780):
🕵️ 3 new failures recognized by patternsThe following CI failures do not appear to be due to upstream breakages: Windows CI (pytorch-win-vs2019-cuda10-cudnn7-py3) / test (default, 1, 2, windows.8xlarge.nvidia.gpu) (1/3)Step: "Store PyTorch Test Reports" (full log | diagnosis details | 🔁 rerun)
|
This pull request was exported from Phabricator. Differential Revision: D27976120 |
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.
Nice! This approach feels more Pythonic to me (using special methods to customize behavior through a protocol vs. overriding the behavior the tracer) and increases the composability of custom tracers.
This pull request was exported from Phabricator. Differential Revision: D27976120 |
ac5691f
to
9619f16
Compare
This pull request was exported from Phabricator. Differential Revision: D27976120 |
9619f16
to
c2a2630
Compare
This pull request was exported from Phabricator. Differential Revision: D27976120 |
c2a2630
to
83d56eb
Compare
…om classes are handled as node args (pytorch#61780) Summary: Pull Request resolved: pytorch#61780 These changes would allow objects to control how they are handled when they are an argument to a torch.fx call_module node from within their source. Previously, we have been using a custom Tracer with an overridden create_arg() method and branching based on class name to handle args that are unusual (data classes, etc). Reviewed By: suo, houseroad Differential Revision: D27976120 fbshipit-source-id: e10a27f48af9c18626f8b65508cd12660aa56e94
This pull request was exported from Phabricator. Differential Revision: D27976120 |
83d56eb
to
2048f40
Compare
This pull request has been merged in 8880f3d. |
Summary: These changes would allow objects to control how they are handled when they are an argument to a torch.fx call_module node from within their source. Previously, we have been using a custom Tracer with an overridden create_arg() method and branching based on class name to handle args that are unusual (data classes, etc).
Differential Revision: D27976120