Skip to content

[RFC] Move LowerCompositeOps before ConvertTensorToTileOps #1850

Description

@georgebisbas

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

  1. 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.

  2. What does OptimizeOrchTensors do to orchestration-level variables? Does LowerCompositeOps need its output?

  3. Composite ops currently use tile.remote_load directly. Full benefit requires rewriting all composite lowerings to emit tensor-level primitives.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions