trunk/34b6e17d1a24014822e71d2f0726adafc230ed0b: [Native DSLs] DSL Registry, base tests rework (#178381)
New registry centralizes domain-specific languages, enabling cleaner, more automated testing for AI frameworks.
A recent commit to Meta's PyTorch framework introduces a significant backend improvement for AI developers. The update, authored by Simon Layton, establishes a new, separate registry specifically for Domain-Specific Languages (DSLs). This registry operates alongside the existing system for operator overrides, providing a centralized location to manage and query the availability of different DSLs used for defining custom operations in PyTorch. The primary technical goal is to decouple DSL management from testing logic, creating a cleaner and more modular codebase.
The practical impact is a streamlined development workflow. Previously, testing a new or multiple DSLs required manual, repetitive additions to test suites. The new registry, referenced in pull request #178381, enables automated discovery. Developers can now write tests that automatically check against all registered DSLs, significantly reducing boilerplate code and potential for human error. The accompanying test plan uses `pytest -sv test/python_native/` to validate the changes, which also include new skip decorators for the current DSL list to manage test execution more precisely.
- Introduces a separate Domain-Specific Language (DSL) Registry in PyTorch's core, distinct from the overrides registry.
- Enables automated testing for multiple DSLs without manual configuration, using centralized querying.
- Authored by Meta's Simon Layton and approved as pull request #178381, with dependencies on #178637.
Why It Matters
This reduces boilerplate code and errors for AI engineers building custom PyTorch operations, accelerating model development.