Repository navigation
[AUTOGENERATED] [release/2.13] fix PicklingError handling for Python 3.14 - #3586
Merged
rocm-repo-management-api-6[bot] merged 1 commit intoAug 19, 2026
Conversation
Fix test_gather_object assertion for Python 3.14 PicklingError (pytorch#192811) ## Summary: The test all_gather_objects a local class (unpicklable) and asserts an error. The exception type changed: <=3.13 raised AttributeError, but 3.14 (CPython pytorchgh-139806) raises PicklingError from pickle.whichmodule() for '<locals>' names. PicklingError is a PickleError, not an AttributeError, so the stale assertRaises(AttributeError) no longer matches. Fix the assertion to (AttributeError, pickle.PickleError), correct across all supported versions (python_min_version = 3.10) while staying tight. The fix belongs in the test, not production: normalizing pickle's exception type in _object_to_tensor would mask a legitimate CPython change. ## Test plan: Test Plan: on Python 3.14.4, assertRaises(AttributeError) around pickle.Pickler().dump() of a local class ERRORS with PicklingError, while assertRaises((AttributeError, pickle.PickleError)) PASSES; on 3.10-3.13 the real AttributeError is also matched (issubclass). Full test needs a 4-GPU nccl world: `pytest torch/testing/_internal/distributed/distributed_test.py -k test_gather_object` Authored with the assistance of an AI coding assistant. Cherry-pick upstream pytorch#192811
rocm-repo-management-api-6
Bot
deleted the
autogenerated/release/2.13_cherry-pick_pr-3584
branch
August 19, 2026 17:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #3584