TROWEXPANDMIN

Tile Operation Diagram

TROWEXPANDMIN tile operation

Introduction

Row-wise broadcast min: take min(src0, src1) where src1 provides one scalar per row.

Math Interpretation

Let R = dst.GetValidRow() and C = dst.GetValidCol(). Let s_i be the per-row scalar taken from src1 (one value per row).

For 0 <= i < R and 0 <= j < C:

\[ \mathrm{dst}_{i,j} = \min(\mathrm{src0}_{i,j}, s_i) \]

Assembly Syntax

PTO-AS form: see PTO-AS Specification.

Synchronous form:

%dst = trowexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>

IR Level 1 (SSA)

%dst = pto.trowexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>

IR Level 2 (DPS)

pto.trowexpandmin ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)

C++ Intrinsic

Declared in include/pto/common/pto_instr.hpp:

template <typename TileDataDst, typename TileDataSrc0, typename TileDataSrc1, typename... WaitEvents>
PTO_INST RecordEvent TROWEXPANDMIN(TileDataDst &dst, TileDataSrc0 &src0, TileDataSrc1 &src1, WaitEvents&... events);

Constraints

  • TileDataDst::DType == TileDataSrc0::DType == TileDataSrc1::DType
  • TileDataDst::DType, TileDataSrc0::DType, TileDataSrc1::DType must be one of: half, float.
  • Tile shape/layout constraint (compile-time): TileDataDst::isRowMajor.
  • Mode 1: src1 is expected to provide one scalar per row (i.e., its valid shape must cover R values).
  • Mode 2: src1 is expected to provide 32 bytes data per row.
  • Exact layout/fractal constraints are target-specific; see backend headers under include/pto/npu/*/TRowExpand*.hpp.

Examples

See related examples in docs/isa/ and docs/coding/tutorials/.

ASM Form Examples

Auto Mode

# Auto mode: compiler/runtime-managed placement and scheduling.
%dst = pto.trowexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>

Manual Mode

# Manual mode: bind resources explicitly before issuing the instruction.
# Optional for tile operands:
# pto.tassign %arg0, @tile(0x1000)
# pto.tassign %arg1, @tile(0x2000)
%dst = pto.trowexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>

PTO Assembly Form

%dst = trowexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
# IR Level 2 (DPS)
pto.trowexpandmin ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)