Repository navigation
Make copy.copy of operator objects return the operator itself - #200954
anijain2305 wants to merge 1 commit into
Conversation
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/200954
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit e7fba7e with merge base 207451c ( 🟢 GREEN LIGHT - PR approved to be merged without human review:
reason: NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
`OpOverload`, `OpOverloadPacket` and `HigherOrderOperator` define `__deepcopy__` to return `self` because each must be unique, but they did not define `__copy__`. A shallow copy therefore built a new instance: - FX copies node metadata such as `original_aten` with `copy.copy` when tracing with preserved node meta, so every node traced by AOTAutograd carried its own copy of its op. The copies hash like the op but compare unequal, which defeats any cache or identity check keyed on the op. - `copy.copy(torch.ops.aten.add)` never finished: the half-built packet's `__getattr__` and `__str__` recursed through each other. Return `self` from `__copy__`, matching `__deepcopy__`. ghstack-source-id: 307f8cd Pull-Request: #200954
|
@claude review this PR |
|
Claude finished @anijain2305's task in 35s —— View job I found no issues in this PR and recommend approving it. PR Review: #200954SummaryThe PR adds What I checked:
RecommendationApprove The change is small and matches the existing |
|
@pytorchbot merge |
Merge failedReason: This PR needs a If not, please add the To add a label, you can comment to pytorchbot, for example For more information, see Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / macos-py3-arm64 / test (default, 3, 3, macos-m1-stable) Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge -f "unrelated CI failure" |
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 |
Stack from ghstack (oldest at bottom):
OpOverload,OpOverloadPacketandHigherOrderOperatordefine__deepcopy__to returnselfbecause each must be unique, but they did notdefine
__copy__. A shallow copy therefore built a new instance:original_atenwithcopy.copywhentracing with preserved node meta, so every node traced by AOTAutograd
carried its own copy of its op. The copies hash like the op but compare
unequal, which defeats any cache or identity check keyed on the op.
copy.copy(torch.ops.aten.add)never finished: the half-built packet's__getattr__and__str__recursed through each other.Return
selffrom__copy__, matching__deepcopy__.