Contributing to PyTorch taught me that even small Python compatibility issues can require understanding compiler internals, reproducing subtle failures, and writing tests that protect existing behavior.
In this talk, I'll share my journey contributing to PyTorch's TorchDynamo, the infrastructure behind torch.compile, through three contributions that landed upstream and one ongoing pull request.
What I'll cover:
Getting started through CPython tests (PR #196587): My first landed contribution involved porting CPython's test_enumerate tests into TorchDynamo's compatibility suite. I'll discuss adapting the tests, handling expected failures, and incorporating maintainer feedback.
Compiler correctness and tensor guards (PR #197224): How Tensor.storage_offset() required a property-specific guard to prevent compiled code from reusing an invalid constant when tensor storage offsets changed.
Debugging Python object reconstruction (PR #198857): How Dynamo's object.__reduce_ex__ polyfill could reconstruct list and dictionary subclasses without preserving their contents. I'll walk through the bug, the small implementation change, and the regression tests that helped validate it.
Real-world upstream review (PR #197415, ongoing): What I learned while working on exception-note handling, discussing side-effect ownership and Python semantics with maintainers, and coordinating changes with related upstream work.
I'll also share practical lessons about reproducing bugs, comparing eager and compiled behavior, using CPython tests, interpreting CI failures, and responding to code reviews.
The goal is to show how meaningful contributions to a large open-source framework grow from careful investigation, incremental fixes, and collaboration—not necessarily from building major new features.
Attendees will leave with a practical approach to starting and improving their own open-source contributions.