Skip to main content

PTO-TILE-MODEL-EXECUTION-REDUCTION

PTO-TILE-MODEL-EXECUTION-REDUCTION

ASL pseudocode

The complete ASL owner is shown directly below.

// PTO-UNIT: {"id":"PTO-TILE-MODEL-EXECUTION-REDUCTION","surface":"tile","classification":["model","execution","reduction"],"depends_on":["PTO-TILE-MODEL-EXECUTION-ELEMENTWISE"]}// PTO-REQ-TEPL-REDUCE-001: exact row, column, and index reductions.
pure func TileReductionOneEncoding(    data_type: TileDataType) => Wordbegin    case data_type of        when TileDataType_FP64 =>            return Zeros{PTO_XLEN} + 0x3ff0000000000000;        when TileDataType_FP32, TileDataType_TF32,             TileDataType_HF32 =>            return Zeros{PTO_XLEN} + 0x3f800000;        when TileDataType_FP16 =>            return Zeros{PTO_XLEN} + 0x3c00;        when TileDataType_BF16 =>            return Zeros{PTO_XLEN} + 0x3f80;        when TileDataType_E4M3 =>            return Zeros{PTO_XLEN} + 0x38;        when TileDataType_E5M2 =>            return Zeros{PTO_XLEN} + 0x3c;        when TileDataType_S64, TileDataType_S32,             TileDataType_S16, TileDataType_S8,             TileDataType_U64, TileDataType_U32,             TileDataType_U16, TileDataType_U8 =>            return Zeros{PTO_XLEN} + 1;        otherwise =>            unreachable;    end;end;
pure func TileReductionInitialValue(    operation: TileReductionOperation,    data_type: TileDataType,    first: Word) => Wordbegin    case operation of        when TileReduction_SUM =>            return Zeros{PTO_XLEN};        when TileReduction_PRODUCT =>            return TileReductionOneEncoding(data_type);        when TileReduction_MIN, TileReduction_MAX,             TileReduction_ARGMIN, TileReduction_ARGMAX =>            return first;    end;end;
impdef func TileProfileReductionInitial(    operation: TileReductionOperation,    data_type: TileDataType,    first: Word) => Wordbegin    return TileReductionInitialValue(        operation,        data_type,        first);end;
func TileReductionStepWithFlags(    operation: TileReductionOperation,    data_type: TileDataType,    accumulator: Word,    value: Word) => (Word, boolean, bits(5))begin    var binary_operation: TileBinaryOperation;    case operation of        when TileReduction_SUM =>            binary_operation = TileBinary_ADD;        when TileReduction_PRODUCT =>            binary_operation = TileBinary_MUL;        when TileReduction_MIN, TileReduction_ARGMIN =>            binary_operation = TileBinary_MIN;        when TileReduction_MAX, TileReduction_ARGMAX =>            binary_operation = TileBinary_MAX;    end;
    let (result, flags) = TileProfileBinaryWithFlags(        binary_operation,        data_type,        accumulator,        value);    let selected =        result == value && result != accumulator;    return (result, selected, flags);end;
impdef func TileProfileReductionStep(    operation: TileReductionOperation,    data_type: TileDataType,    accumulator: Word,    value: Word) => (Word, boolean)begin    let (result, selected, -) = TileReductionStepWithFlags(        operation,        data_type,        accumulator,        value);    return (result, selected);end;
func ExecuteTileReduction(    operation: TileReductionOperation,    axis: TileAxis,    destination: TileIndex,    source: TileIndex)begin    assert TileOperandsLegal_ExecuteTileReduction(        operation,        axis,        destination,        source);
    let source_tile = _Tiles[[source]];    var result_tile = _Tiles[[destination]];    var accumulated_flags = Zeros{5};    let outer_count =        if axis == TileAxis_Row then            source_tile.valid_rows        else            source_tile.valid_columns;    let inner_count =        if axis == TileAxis_Row then            source_tile.valid_columns        else            source_tile.valid_rows;
    for outer = 0 to outer_count - 1 looplimit 65536 do        let first_row =            if axis == TileAxis_Row then outer else 0;        let first_column =            if axis == TileAxis_Row then 0 else outer;        let first_element = TileLogicalLinearIndex(            source_tile,            first_row as integer {0..65535},            first_column as integer {0..65535});        var accumulator = TileProfileReductionInitial(            operation,            source_tile.data_type,            TileReadLogicalElement(source_tile, first_element));        var selected_index: integer {0..65535} = 0;        let identity_reduction =            operation == TileReduction_SUM ||            operation == TileReduction_PRODUCT;        let first_inner =            if identity_reduction then 0 else 1;
        if first_inner < inner_count then            for inner = first_inner to inner_count - 1                looplimit 65536 do                let row =                    if axis == TileAxis_Row then outer else inner;                let column =                    if axis == TileAxis_Row then inner else outer;                let element = TileLogicalLinearIndex(                    source_tile,                    row as integer {0..65535},                    column as integer {0..65535});                let (next, selected, element_flags) =                    TileReductionStepWithFlags(                        operation,                        source_tile.data_type,                        accumulator,                        TileReadLogicalElement(source_tile, element));                accumulator = next;                accumulated_flags =                    accumulated_flags OR element_flags;                if selected &&                   (operation == TileReduction_ARGMIN ||                    operation == TileReduction_ARGMAX) then                    selected_index =                        inner as integer {0..65535};                end;            end;        end;
        let destination_row =            if axis == TileAxis_Row then outer else 0;        let destination_column =            if axis == TileAxis_Row then 0 else outer;        let destination_element = TileLogicalLinearIndex(            result_tile,            destination_row as integer {0..65535},            destination_column as integer {0..65535});        if operation == TileReduction_ARGMIN ||           operation == TileReduction_ARGMAX then            result_tile = TileInfoWithLogicalElement(result_tile,                destination_element, NaturalToWord(                    selected_index as integer {0..262144}));        else            result_tile = TileInfoWithLogicalElement(result_tile,                destination_element, accumulator);        end;    end;
    result_tile = TileWithValidRegionDefined(result_tile);    result_tile = TileWithPadding(        result_tile,        CurrentBundlePadValue());    RecordNumericStatusFlags(accumulated_flags);    _Tiles[[destination]] = result_tile;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

8 matching entries

Executable evidence2
  • PTO-TILE-MODEL-EXECUTION-REDUCTION compiles as an independent normative unit
    1. surfaceTILE
    2. ownerPTO-TILE-MODEL-EXECUTION-REDUCTION
    3. categorySTATIC-INVARIANT
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-TILE-MODEL-EXECUTION-REDUCTION-STATIC-001
    Path
    tests/asl/tile/model/execution/reduction/tile-static-reduction-contract-001.asl
    Kind / role
    static-invariant
    Pass condition
    the complete model and this unit's static invariant compile
    SHA-256
    d6109f1e42ea97f94349340a1e5bd2742ad4c5bff5442e41710f6eda2f504f87
    Open exact source ↗ for PTO-AVS-TILE-MODEL-EXECUTION-REDUCTION-STATIC-001
  • Covers Tile Reduction.
    1. surfaceTILE
    2. ownerPTO-TILE-MODEL-EXECUTION-REDUCTION
    3. categoryEXECUTION
    4. case001
    Show exact test source
    Sources and references
    Complete stable ID
    PTO-AVS-TILE-TESTTILEREDUCTION-EXECUTION-001
    Path
    tests/asl/tile/model/execution/reduction/tile-exec-reduction-operations-001.asl
    Kind / role
    execution
    Pass condition
    TestTileReduction completes without assertion failure
    SHA-256
    316a6fe309b1a1aada294efcb62735dd0f3f0dd05b2e87ce9b4a582c651e81bb
    Open exact source ↗ for PTO-AVS-TILE-TESTTILEREDUCTION-EXECUTION-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
Decision history1
  • Re-encode B.IOT and B.IOS size and PE mode fields · accepted
    1. decision recordADR
    2. case0096

    Decision record

    Loading ADR-0096…

    Sources and references
    Complete stable ID
    ADR-0096
    Path
    docs/status/decisions/0096-b-iot-b-ios-sizecode-pemode.md
    Affected units
    PTO-ARCH-DATA-TYPES-INTEGER, PTO-ARCH-FEATURES-TILE-ALLOCATION, PTO-ARCH-MEMORY-MODEL-GLOBAL-MEMORY-ACCESS, PTO-ARCH-PROFILE-RESET, PTO-ARCH-PROGRAMMING-MODEL-CORE-PE-TOPOLOGY, PTO-BLOCK-B-IOS, PTO-BLOCK-B-IOT, PTO-BLOCK-MODEL-DISPATCH-COMMANDS, PTO-BLOCK-MODEL-DISPATCH-CUBE-TMATMUL, PTO-BLOCK-MODEL-DISPATCH-DESTINATION-SHAPE, PTO-BLOCK-MODEL-DISPATCH-SHARED-CUBE-MATRIX, PTO-BLOCK-MODEL-DISPATCH-SHARED-TLSU, PTO-BLOCK-MODEL-OPERANDS-SHARED-BINDINGS, PTO-BLOCK-MODEL-OPERANDS-TILE-BINDINGS, PTO-BLOCK-MODEL-SCHEMA-PROFILE-ENCODING, PTO-BLOCK-MODEL-STATE-TYPES, PTO-TILE-MODEL-DEFINEDNESS-ELEMENTS, PTO-TILE-MODEL-DEFINEDNESS-PACKED-BOUNDARY, PTO-TILE-MODEL-EXECUTION-COMPARISON, PTO-TILE-MODEL-EXECUTION-COMPLEX, PTO-TILE-MODEL-EXECUTION-CUBE, PTO-TILE-MODEL-EXECUTION-ELEMENTWISE, PTO-TILE-MODEL-EXECUTION-EXPANSION, PTO-TILE-MODEL-EXECUTION-FUSED-MULTIPLY-ADD, PTO-TILE-MODEL-EXECUTION-GENERATION, PTO-TILE-MODEL-EXECUTION-IMAGE-TO-COLUMN, PTO-TILE-MODEL-EXECUTION-INDEXED-REARRANGEMENT, PTO-TILE-MODEL-EXECUTION-REARRANGEMENT, PTO-TILE-MODEL-EXECUTION-REDUCTION, PTO-TILE-MODEL-EXECUTION-SORTING, PTO-TILE-MODEL-EXECUTION-UNARY, PTO-TILE-MODEL-LEGALITY-ALLOCATION-CAPACITY, PTO-TILE-MODEL-LEGALITY-DESCRIPTOR-SHAPE, PTO-TILE-MODEL-LEGALITY-IMAGE-TO-COLUMN, PTO-TILE-MODEL-LEGALITY-INDEXED-REARRANGEMENT, PTO-TILE-MODEL-LEGALITY-MATRIX-INFO-DESCRIPTOR, PTO-TILE-MODEL-LEGALITY-MATRIX-POSTPROCESS, PTO-TILE-MODEL-LEGALITY-PE-MASK, PTO-TILE-MODEL-MEMORY-LOAD-STORE, PTO-TILE-MODEL-MEMORY-SHARED-MOVEMENT, PTO-TILE-MODEL-NUMERIC-FORMATS, PTO-TILE-MODEL-ORDERING-SORTING, PTO-TILE-MODEL-SHAPE-VALID-REGION, PTO-TILE-MODEL-STATE-ALLOCATION, PTO-TILE-MODEL-STATE-DESCRIPTORS, PTO-TILE-MODEL-STATE-FEATURE-MAP-DESCRIPTORS, PTO-TILE-MODEL-STATE-SHARED-REGISTERS, PTO-TILE-MODEL-STATE-TYPES, PTO-TILE-TLOAD
    Affected NDF
    PTO-ARCH-GM-ACCESS-001, PTO-B-IOS-SHARED-STATE-001, PTO-B-IOT-STREAM-001, PTO-CUBE-ACCUMULATOR-OUTPUT-001, PTO-TLOAD-CUBE-001, PTO-TLOAD-MEMORY-001
    SHA-256
    c4b4fb7bc17878f710015207dc19ddaf22a0cf6989d185b16844714c71e23f62
    Open exact decision source ↗ for ADR-0096

Unit metadata

Open 4 generated metadata fields
id
PTO-TILE-MODEL-EXECUTION-REDUCTION
surface
tile
classification
[
  "model",
  "execution",
  "reduction"
]
depends_on
[
  "PTO-TILE-MODEL-EXECUTION-ELEMENTWISE"
]
Open generated traceability record
{
  "classification": [
    "model",
    "execution",
    "reduction"
  ],
  "documentation": "docs/tile/model/execution/reduction.md",
  "id": "PTO-TILE-MODEL-EXECUTION-REDUCTION",
  "mnemonic": null,
  "readiness_subjects": [
    "ADR-0096"
  ],
  "semantic_tests": [
    "PTO-AVS-TILE-TESTTILEREDUCTION-EXECUTION-001"
  ],
  "source": "asl/tile/model/execution/reduction.asl",
  "surface": "tile",
  "tests": [
    "PTO-AVS-TILE-MODEL-EXECUTION-REDUCTION-STATIC-001",
    "PTO-AVS-TILE-TESTTILEREDUCTION-EXECUTION-001"
  ]
}

Sources and release identity

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

Exact owners