Skip to main content

PTO-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION

PTO-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION

ASL pseudocode

The complete ASL owner is shown directly below.

// PTO-UNIT: {"id":"PTO-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION","surface":"tile","classification":["model","legality","reduction-and-expansion"],"depends_on":["PTO-TILE-MODEL-LEGALITY-OPERAND-SCHEMA"]}
readonly func TileOperandsLegal_ExecuteTileReduction(    operation: TileReductionOperation,    axis: TileAxis,    destination: TileIndex,    source: TileIndex) => booleanbegin    if destination == source ||       !TileDescriptorLegal(destination) ||       !TileSourceContentsDefined(source) then        return FALSE;    end;
    let destination_tile = _Tiles[[destination]];    let source_tile = _Tiles[[source]];    let index_reduction =        operation == TileReduction_ARGMIN ||        operation == TileReduction_ARGMAX;    let source_type_legal =        if index_reduction then            TileArgReductionSourceDataTypeSupported(source_tile.data_type)        else            TileVecArithmeticDataTypeSupported(source_tile.data_type);    if destination_tile.storage_kind != TileStorage_Numeric ||       source_tile.storage_kind != TileStorage_Numeric ||       destination_tile.layout != TileLayout_RowMajor ||       source_tile.layout != TileLayout_RowMajor ||       source_tile.valid_rows == 0 ||       source_tile.valid_columns == 0 ||       !source_type_legal ||       !TileSourceEncodingsValid(source) then        return FALSE;    end;
    if index_reduction then        if destination_tile.data_type != TileDataType_S32 &&           destination_tile.data_type != TileDataType_U32 then            return FALSE;        end;    elsif destination_tile.data_type != source_tile.data_type then        return FALSE;    end;
    if axis == TileAxis_Row then        return destination_tile.rows >= source_tile.valid_rows &&               destination_tile.columns == 1 &&               destination_tile.valid_rows == source_tile.valid_rows &&               destination_tile.valid_columns == 1;    end;    return destination_tile.rows >= 1 &&           destination_tile.columns == source_tile.columns &&           destination_tile.valid_rows == 1 &&           destination_tile.valid_columns ==               source_tile.valid_columns;end;
pure func TileExpandExpdifTypePairLegal(    source_type: TileDataType,    destination_type: TileDataType) => booleanbegin    return (source_type == TileDataType_FP16 &&            (destination_type == TileDataType_FP16 ||             destination_type == TileDataType_FP32)) ||           (source_type == TileDataType_BF16 &&            (destination_type == TileDataType_BF16 ||             destination_type == TileDataType_FP32)) ||           (source_type == TileDataType_FP32 &&            destination_type == TileDataType_FP32);end;
readonly func TileOperandsLegal_ExecuteTileExpand(    operation: TileExpandOperation,    axis: TileAxis,    destination: TileIndex,    source: TileIndex,    broadcast_source: TileIndex) => booleanbegin    if !TileDescriptorLegal(destination) ||       !TileDescriptorLegal(source) ||       !TileDescriptorLegal(broadcast_source) then        return FALSE;    end;
    let destination_tile = _Tiles[[destination]];    let source_tile = _Tiles[[source]];    let broadcast_tile = _Tiles[[broadcast_source]];    let expdif = operation == TileExpand_EXPDIF;    let operation_type_legal =        if operation == TileExpand_COPY then            TileVecArithmeticDataTypeSupported(destination_tile.data_type)        else if expdif then            TileExpandExpdifTypePairLegal(                source_tile.data_type,                destination_tile.data_type)        else            TileVecArithmeticDataTypeSupported(destination_tile.data_type);    if destination_tile.storage_kind != TileStorage_Numeric ||       destination_tile.layout != TileLayout_RowMajor ||       destination_tile.valid_rows == 0 ||       destination_tile.valid_columns == 0 ||       !operation_type_legal ||       broadcast_tile.storage_kind != TileStorage_Numeric ||       broadcast_tile.data_type !=           (if expdif then source_tile.data_type            else destination_tile.data_type) ||       broadcast_tile.layout != TileLayout_RowMajor ||       !TileSourceContentsDefined(broadcast_source) ||       (operation != TileExpand_COPY &&        !TileSourceEncodingsValid(broadcast_source)) then        return FALSE;    end;
    if operation == TileExpand_COPY then        if source != broadcast_source then            return FALSE;        end;    elsif (if expdif then !TileLogicalShapeMatch(destination, source)           else !TileShapeAndTypeMatch(destination, source)) ||          source_tile.storage_kind != TileStorage_Numeric ||          source_tile.layout != TileLayout_RowMajor ||          !TileSourceContentsDefined(source) ||          (operation != TileExpand_COPY &&           !TileSourceEncodingsValid(source)) then        return FALSE;    end;
    let broadcast_shape_legal =        if axis == TileAxis_Row then            broadcast_tile.valid_rows == destination_tile.valid_rows &&            broadcast_tile.valid_columns == 1 &&            broadcast_tile.columns == 1        else            broadcast_tile.valid_rows == 1 &&            broadcast_tile.valid_columns ==                destination_tile.valid_columns &&            broadcast_tile.columns == destination_tile.columns;    if !broadcast_shape_legal then        return FALSE;    end;
    if operation == TileExpand_DIV &&       TileDataTypeIsInteger(destination_tile.data_type) then        return TileBroadcastPayloadNonzero(            axis,            source,            broadcast_source);    end;    return TRUE;end;

Architecture behavior

This internal model unit is documented through its normative ASL/NDF owners and validation evidence; it has no reader-guide migration target.

NDF clauses

Bodies come from owning ASL. Dragging or buttons change only this page-session view order.

No NDF clause is attached to this unit.

Evidence index

6 matching entries

Executable evidence1
  • PTO-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION compiles as an independent normative unit
    1. surfaceTILE
    2. ownerPTO-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION-STATIC-001
    Path
    tests/asl/tile/model/legality/reduction-and-expansion/tile-static-reduction-and-expansion-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    052e6e31624c9efc4bf2b3cfb89dbfc729709fce323e155ab5d854f2195f85ba
    Open exact source ↗ for PTO-AVS-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION-STATIC-001
Commit-scoped evidence5
  • spec/evidence/release-traceability-readiness.json · closedPTO-EVIDENCE-RELEASE-TRACEABILITY
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-TRACEABILITY
    Path
    spec/evidence/release-traceability-readiness.json
    Kind / role
    ASL/NDF/documentation/AVS traceability
    SHA-256
    c7327021d39dc67ac5564bc55073b3870a397d79ac8d9648284d56e33bc14a3e
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-TRACEABILITY
  • spec/evidence/instruction-contract-closure.json · closedPTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
    Path
    spec/evidence/instruction-contract-closure.json
    Kind / role
    mnemonic and encoding contract closure
    SHA-256
    3ef2bb62421c79dff8fa77a1c7983923b523244b8090812883ef81286ca8106a
    Open exact source ↗ for PTO-EVIDENCE-INSTRUCTION-CONTRACT-CLOSURE
  • spec/evidence/architecture-readiness.json · openPTO-EVIDENCE-ARCHITECTURE-READINESS
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-ARCHITECTURE-READINESS
    Path
    spec/evidence/architecture-readiness.json
    Kind / role
    architecture maturity and blockers
    SHA-256
    4b0b85199101251bea744e0f3591cc31906909dc80d5ab651c417a936036a004
    Open exact source ↗ for PTO-EVIDENCE-ARCHITECTURE-READINESS
  • spec/evidence/release-gate-readiness.json · ready-for-exact-head-verificationPTO-EVIDENCE-RELEASE-GATE-READINESS
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-GATE-READINESS
    Path
    spec/evidence/release-gate-readiness.json
    Kind / role
    exact-head gate readiness
    SHA-256
    a0f4d2b6920c08981ea55fd8ef820708a40d4feb5402c5150e8e9ab532d84ce0
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-GATE-READINESS
  • spec/release-manifest.json · draftPTO-EVIDENCE-RELEASE-MANIFEST
    Sources and references
    Complete stable ID
    PTO-EVIDENCE-RELEASE-MANIFEST
    Path
    spec/release-manifest.json
    Kind / role
    release content and encoding fingerprints
    SHA-256
    1a64c109ed7a90351c41e2a418b3c0ebaf8ad975838986d2101385186b85c0d8
    Open exact source ↗ for PTO-EVIDENCE-RELEASE-MANIFEST

Unit metadata

Open 4 generated metadata fields
id
PTO-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION
surface
tile
classification
[
  "model",
  "legality",
  "reduction-and-expansion"
]
depends_on
[
  "PTO-TILE-MODEL-LEGALITY-OPERAND-SCHEMA"
]
Open generated traceability record
{
  "classification": [
    "model",
    "legality",
    "reduction-and-expansion"
  ],
  "documentation": "docs/tile/model/legality/reduction-and-expansion.md",
  "id": "PTO-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION",
  "mnemonic": null,
  "readiness_subjects": [],
  "semantic_tests": [],
  "source": "asl/tile/model/legality/reduction-and-expansion.asl",
  "surface": "tile",
  "tests": [
    "PTO-AVS-TILE-MODEL-LEGALITY-REDUCTION-AND-EXPANSION-STATIC-001"
  ]
}

Sources and release identity

Show commit, paths, hashes, version, and canonical owners
Release
0.58.5 · Release candidate
Commit
7dc8b7e5b121d2b2499a2273bebff29e2cd86812
ASL SHA-256
eb1c898ae4219734b9ef14c7588e2ee1f49e30417b862da930ae7e45a8f738cf
Generated documentation
docs/tile/model/legality/reduction-and-expansion.md · embedded in this page
Documentation SHA-256
d4cb73260df4fc71e213475e26e1f8d3b964a27dd0de94298f756a0b0fb2f221

Exact owners