PyTorch DTensor Operation Registration Streamlined: 158 Ops Migrated to Single-Dimension Strategies, 12 New Ops Added
English summary
The PyTorch DTensor component updated its operation registration system. Before the change, there were 158 direct op_strategy registrations and 1013 single_dim_strategy registrations, totaling 1164 registered operations. After migration, op_strategy dropped to 114 while single_dim_strategy rose to 1068, for a total of 1176. This reallocates 44 op_strategy entries into the unified single_dim_strategy framework and nets 12 new operations. The refactor simplifies DTensor's op registration maintenance. Testing coverage was exercised via pytest in test/distributed/tensor/test_tensor_ops.py.
Chinese summary
PyTorch 的 DTensor 组件更新了操作注册系统。变更前,有 158 个直接 op_strategy 注册和 1013 个 single_dim_strategy 注册,总计 1164 个已注册操作。迁移后,op_strategy 降至 114 个,single_dim_strategy 增至 1068 个,总计 1176 个。这相当于将 44 个 op_strategy 条目重新分配至统一的单维度策略框架,并净增 12 个新操作。该重构简化了 DTensor 操作注册的维护。测试通过 pytest 在 test/distributed/tensor/test_tensor_ops.py 中进行。
Key points
Direct op_strategy registrations decreased from 158 to 114.
直接 op_strategy 注册数从 158 降至 114。
Single_dim_strategy registrations increased from 1013 to 1068.
single_dim_strategy 注册数从 1013 升至 1068。
Total registered operations changed from 1164 to 1176, a net increase of 12 operations.
总注册操作数从 1164 变为 1176,净增 12 个操作。
The migration consolidates 44 op_strategy entries into the simplified single-dimension strategy model.
该迁移将 44 个 op_strategy 条目整合至简化的单维度策略模型中。
Test coverage is provided in test/distributed/tensor/test_tensor_ops.py.
测试覆盖位于 test/distributed/tensor/test_tensor_ops.py。