[FX] HopSchema pickle round-trip drops Python metadata
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start with HopSchema and its inherited FunctionSchema pickle protocol, then inspect test/fx/test_graph_pickler.py and the two named TestHopSchemaPickle tests. Run those tests on CPU to confirm the missing Python attributes. Done means a pickle round-trip restores is_vararg, is_varret, and tree_spec for schemas both with and without arguments.
Written by the indexing model from the issue text.
Description
After a standard-library pickle serialization/deserialization round-trip, HopSchema retains its C++ schema but loses the Python attributes is_vararg, is_varret, and tree_spec.
The restored object is still a HopSchema and compares equal to the original schema, but vars(restored) is {}. The inherited FunctionSchema pickle protocol saves only the schema string and does not restore the Python instance fields.
Reproduction baseline: PyTorch main at 26b9b973b2a2dcde7c56036e7d8143eb0f0d8e9d, using a CPU build. No GPU execution is required.
Unit Tests
Both existing tests reproduce the defect:
python -m pytest -v -s \
test/fx/test_graph_pickler.py::TestHopSchemaPickle::test_hop_schema_pickle_roundtrip
python -m pytest -v -s \
test/fx/test_graph_pickler.py::TestHopSchemaPickle::test_hop_schema_pickle_with_arguments
test_hop_schema_pickle_roundtripverifies the type, name, and Python metadata of a schema with no arguments or returns.test_hop_schema_pickle_with_argumentsverifies a schema with arguments, returns, and variadic flags.
Before the fix, both tests fail.
Error Message
The first test fails at:
self.assertEqual(unpickled.is_vararg, False)
The second test fails at the corresponding assertion:
self.assertEqual(unpickled.is_vararg, True)
Both failures report:
AttributeError: 'HopSchema' object has no attribute 'is_vararg'
This is a missing Python attribute, not a loss of the C++ variadic flags. The Python attributes is_varret and tree_spec are also absent, but each test stops at its first failing metadata assertion.
cc @chauhang @penguinwu @ydwu4 @bdhirsh @bobrenjc93 @aorenste
- Dominant language
- Python
- Stars
- 106k
- Forks
- 30.7k
- Avg merge
- 30m
- Merged PRs (30d)
- 6
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pytorch/pytorch
-
bot-triaged module: binaries module: ci module: regression module: xpu triaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Windows ARM64: NumPy reference crashes the `torch.linalg.tensorinv` CPU test processPossibly taken A pull request linked to this issue is open or already merged. Openbot-triaged module: arm module: crash module: dependency bug module: linear algebra module: tests module: windows triage review
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
[ROCm] JIT C++ extension rebuilds when two GPU archs are visiblePossibly taken @menglcai-amd claimed this today. Openactionable bot-triaged module: cpp-extensions module: performance module: rocm triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pytorch/pytorch#207065 · 2 comments ·
Maintainers usually reply within 1 day
-
bot-triaged module: dependency bug module: onnx triaged
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bot-triaged enhancement module: build module: ci module: windows triaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pytorch/pytorch#206856 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Possibly taken @cestercian claimed this today. Opencomp/cli P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#162259 · 1 comment ·
Maintainers usually reply within 1 day
-
bug enhancement
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AOSSIE-Org/PictoPy#1802 · 2 comments ·
Maintainers usually reply within 3 days
-
community-request
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-NeMo/Run#727 ·
Maintainers usually reply within 1 day
-
backend: claude chore dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
briandconnelly/amicus#606 ·
Maintainers usually reply within 1 day