Summary
Propose moving LowerCompositeOps (slot 14) to run before ConvertTensorToTileOps (slot 12), so composite collectives can emit clean tensor-level primitives like pld.tensor.get/pld.tensor.put and let the existing conversion registry handle flattening + VEC staging tile allocation uniformly.
Problem
LowerCompositeOps currently runs after ConvertTensorToTileOps. Because tensor-to-tile conversion has already run, composite lowerings cannot emit tensor-level ops — they must duplicate the conversion logic: compute [rows, cols] from N-D shapes, allocate a tile.create, and emit pld.tile.get/pld.tile.put directly.
This duplication bit us in feat/relax-get-dst: relaxing pld.tile.get's dst to accept plain Tensor required fixing the verifier, codegen, and DSL wrappers — but the reviewer pointed out the same fix was missing in op_conversion_registry.cpp. The duplicated flattening logic in LowerCompositeOps's LowerTensorBroadcastRule must now also be kept in sync with any future type-constraint changes.
Current pass ordering
| Slot |
Pass |
| 12 |
ConvertTensorToTileOps |
| 13 |
OptimizeOrchTensors |
| 14 |
LowerCompositeOps |
LowerCompositeOps has empty PassProperties — requires nothing, produces nothing — suggesting no hard dependency on the output of passes 12-13.
Proposed
| Slot |
Pass |
| ~12 |
LowerCompositeOps ← moved earlier |
| 12 |
ConvertTensorToTileOps ← runs after, picks up tensor-level get/put |
With this, composites could emit pld.tensor.get(dst, peer, src) and let ConvertTensorToTileOps handle the tile.create + pld.tile.get uniformly.
Open questions
-
Does LowerCompositeOps depend on any IRProperty or IR shape from ConvertTensorToTileOps? The allreduce lowering emits tile.load/tile.store — those would need rewriting to tensor-level ops.
-
What does OptimizeOrchTensors do to orchestration-level variables? Does LowerCompositeOps need its output?
-
Composite ops currently use tile.remote_load directly. Full benefit requires rewriting all composite lowerings to emit tensor-level primitives.
References
Summary
Propose moving
LowerCompositeOps(slot 14) to run beforeConvertTensorToTileOps(slot 12), so composite collectives can emit clean tensor-level primitives likepld.tensor.get/pld.tensor.putand let the existing conversion registry handle flattening + VEC staging tile allocation uniformly.Problem
LowerCompositeOpscurrently runs afterConvertTensorToTileOps. Because tensor-to-tile conversion has already run, composite lowerings cannot emit tensor-level ops — they must duplicate the conversion logic: compute[rows, cols]from N-D shapes, allocate atile.create, and emitpld.tile.get/pld.tile.putdirectly.This duplication bit us in feat/relax-get-dst: relaxing
pld.tile.get's dst to accept plainTensorrequired fixing the verifier, codegen, and DSL wrappers — but the reviewer pointed out the same fix was missing inop_conversion_registry.cpp. The duplicated flattening logic inLowerCompositeOps'sLowerTensorBroadcastRulemust now also be kept in sync with any future type-constraint changes.Current pass ordering
ConvertTensorToTileOpsOptimizeOrchTensorsLowerCompositeOpsLowerCompositeOpshas empty PassProperties — requires nothing, produces nothing — suggesting no hard dependency on the output of passes 12-13.Proposed
LowerCompositeOps← moved earlierConvertTensorToTileOps← runs after, picks up tensor-level get/putWith this, composites could emit
pld.tensor.get(dst, peer, src)and letConvertTensorToTileOpshandle thetile.create+pld.tile.getuniformly.Open questions
Does
LowerCompositeOpsdepend on anyIRPropertyor IR shape fromConvertTensorToTileOps? The allreduce lowering emitstile.load/tile.store— those would need rewriting to tensor-level ops.What does
OptimizeOrchTensorsdo to orchestration-level variables? DoesLowerCompositeOpsneed its output?Composite ops currently use
tile.remote_loaddirectly. Full benefit requires rewriting all composite lowerings to emit tensor-level primitives.References
src/ir/transforms/lower_composite_ops_pass.cpp— all lowering rulessrc/ir/transforms/op_conversion_registry.cpp—pld.tensor.get/put→tile.create+pld.tile.get/putdocs/en/dev/passes/12-convert_tensor_to_tile_ops.mddocs/en/dev/passes/14-lower_composite_ops.mdpypto-3.0-notes/pr_plans/36-move-lower-composite-ops-before-convert-tensor-to-tile.md