PyTorch: Testing Cleanup and Pattern Matching Progress
Today's PyTorch activity shows 27 commits focused on test infrastructure improvements and Python 3.13 pattern matching support. Kurt Mohler led a major MPS testing cleanup removing over 400 lines of test exceptions, while Guilherme Leobas made significant progress on pattern matching opcodes, though one feature was auto-reverted for stability.
Duration: PT4M8S
Transcript
Hey everyone, and welcome back to the PyTorch podcast! I'm your host, and it's February 1st, 2026. Grab your coffee because we've got some really interesting development stories to dive into today.
You know what I love about today's activity? It's one of those days that perfectly captures the reality of software development - the unglamorous but absolutely essential work of keeping things clean, stable, and moving forward. We're looking at 27 commits with no merged pull requests, which might sound quiet, but trust me, there's some great stuff happening under the hood.
Let's start with the biggest story of the day - Kurt Mohler has been absolutely crushing it with MPS testing improvements. And when I say crushing it, I mean he literally crushed over 400 lines of test failures and exceptions. In two related commits, Kurt cleaned up the MPS test suite by removing tons of expected failures and skipping problematic tests. We're talking about removing 231 lines from common method invocations, 144 lines from FFT definitions, and dozens more from other test files. This isn't just deletion for the sake of it - this is the kind of thoughtful maintenance that makes a codebase healthier and more reliable.
What's really cool about Kurt's work is that it shows MPS support is maturing. When you can remove that many test exceptions, it usually means the underlying functionality has gotten much more stable. That's fantastic news for anyone using PyTorch on Apple Silicon.
Now, here's where today gets really interesting from a development process perspective. Guilherme Leobas has been working on Python 3.13 pattern matching support, and we got to see the full cycle of feature development in action. Guilherme landed several commits fixing different pattern matching opcodes - MATCH_KEYS, MATCH_SEQUENCE, and MATCH_CLASS. Each of these removes test failures and adds proper support for Python's structural pattern matching.
But here's the plot twist - the MATCH_CLASS opcode commit got auto-reverted! The PyTorch auto-revert system kicked in, which is actually pretty cool to see in action. It shows the team has robust automation to catch issues quickly. Don't worry though, this isn't a failure story - it's exactly how modern development should work. You push boundaries, test things, and if something needs adjustment, you revert quickly and try again.
Daniel Delgado Vargas solved a classic testing puzzle that every developer has encountered - the dreaded test that passes in isolation but fails in a suite. He tracked down a test isolation issue where one test was leaving global state modified, causing later tests to fail. The fix was adding a proper tearDown method to reset the choices handler. It's detective work like this that keeps test suites reliable.
We also got some nice infrastructure improvements. Pian Pawakapan enhanced DTensor debug logging to clearly mark whether redistribute calls are implicit or explicit - super helpful for debugging distributed tensor operations. And Angel Li did some housekeeping on the Flash Attention wheel workflow files, adding underscores to indicate they're private workflows.
One commit I want to highlight is from dolpm in the functorch area. They fixed an issue in the partitioner where backward operations need forward tensor outputs, preventing invalid partition dependencies. This kind of fix might seem small, but it's crucial for the automatic differentiation system to work correctly.
Today's focus should be on appreciating the less glamorous but absolutely critical work that keeps PyTorch running smoothly. Whether it's Kurt's massive test cleanup, Guilherme's patient work on pattern matching support, or Daniel's test isolation detective work - this is the foundation that makes all the exciting ML features possible.
If you're working on your own projects, take inspiration from today's commits. Don't just build new features - invest time in cleanup, fix those flaky tests, and make your codebase more maintainable. Your future self will thank you.
That's a wrap for today! Tomorrow we'll see what new developments emerge from the PyTorch community. Keep coding, keep learning, and I'll catch you next time!