[ONNX] Remove unused patching methods#82511
[ONNX] Remove unused patching methods#82511justinchuby wants to merge 16 commits intopytorch:masterfrom
Conversation
🔗 Helpful links
❌ 1 New FailuresAs of commit 7bead7e (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
|
|
I think the changes are good, but this is failing a lot of tests. Please make sure it isn't about the PR. |
|
Thanks - fixing errors |
|
Updated. |
### Description <!-- What did you change and why was it needed? --> The `graph` function takes a dependency on `torch.onnx.select_model_mode_for_export`, which was used because it implicitly patches `torch._C.Node` to allow for key access. This change removed the need for the patch and decoupled the tensorboard util from `torch.onnx`. This is needed to unblock #82511 because we are removing the monkey patch ### Issue <!-- Link to Issue ticket or RFP --> ### Testing <!-- How did you test your change? --> cc @ezyang @orionr @BowenBao Pull Request resolved: #82628 Approved by: https://github.com/ezyang
Summary: ### Description <!-- What did you change and why was it needed? --> The `graph` function takes a dependency on `torch.onnx.select_model_mode_for_export`, which was used because it implicitly patches `torch._C.Node` to allow for key access. This change removed the need for the patch and decoupled the tensorboard util from `torch.onnx`. This is needed to unblock #82511 because we are removing the monkey patch ### Issue <!-- Link to Issue ticket or RFP --> ### Testing <!-- How did you test your change? --> cc ezyang orionr BowenBao Pull Request resolved: #82628 Approved by: https://github.com/ezyang Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/c7dde7da6d27d81555e44d9f9e416b81697b02d5 Reviewed By: kit1980 Differential Revision: D38359651 fbshipit-source-id: d2c3e4f0db75b54d224e11c76830ca642edaa2e9
ghstack would come in handy. It would be nicer if you could split the annotation part from the patching change. |
Thanks, I will use ghstack in the next batch of PRs. |
|
Seems there are complaints from quantization UTs. |
Could you also update why you had and how you fix those failed checks after you manage to fix them? I am curious. |
|
Closed in favor of #83006 |
Attribute access with subscripting would previously work due to patching in pytorch/pytorch#82511 but this has been removed. This commit uses the fix proposed in pytorch/pytorch#82628 to define a helper method to call the appropriate access method.
Attribute access with subscripting would previously work due to patching in pytorch/pytorch#82511 but this has been removed. This commit uses the fix proposed in pytorch/pytorch#82628 to define a helper method to call the appropriate access method.
Attribute access with subscripting would previously work due to patching in pytorch/pytorch#82511 but this has been removed. This commit uses the fix proposed in pytorch/pytorch#82628 to define a helper method to call the appropriate access method.
Attribute access with subscripting would previously work due to patching in pytorch/pytorch#82511 but this has been removed. This commit uses the fix proposed in pytorch/pytorch#82628 to define a helper method to call the appropriate access method.
Attribute access with subscripting would previously work due to patching in pytorch/pytorch#82511 but this has been removed. This commit uses the fix proposed in pytorch/pytorch#82628 to define a helper method to call the appropriate access method.
Attribute access with subscripting would previously work due to patching in pytorch/pytorch#82511 but this has been removed. This commit uses the fix proposed in pytorch/pytorch#82628 to define a helper method to call the appropriate access method.
Attribute access with subscripting would previously work due to patching in pytorch/pytorch#82511 but this has been removed. This commit uses the fix proposed in pytorch/pytorch#82628 to define a helper method to call the appropriate access method.
Attribute access with subscripting would previously work due to patching in pytorch/pytorch#82511 but this has been removed. This commit uses the fix proposed in pytorch/pytorch#82628 to define a helper method to call the appropriate access method.
Description
Remove unused patching methods:
torch._C.Graph.constanttorch._C.Node.__getitem__and move the helper function tosymbolic_helperAdd typing annotations
Issue
Fixes #76254
Dependent on #81953, #82628
Testing
Unit tested