Skip to content

clarify: partial-PE Shared TLOAD followed by cooperative TMATMUL #159

Description

@jiale-wangOwO

Clarify partial-PE Shared TLOAD followed by cooperative TMATMUL

Summary

Please clarify the intended 0.58.4 semantics for a common compiler-generated pattern:

# producer
BSTART.TLSU TLOAD, FP32
B.DIM LB0=64
B.DIM LB1=128
B.DIM LB2=64
B.IOS mask=0001, ->S0<32KB>
B.IOR [a1,a3],[]
BSTOP

BSTART.TLSU TLOAD, FP32
B.DIM LB0=32
B.DIM LB1=64
B.DIM LB2=32
B.IOS mask=0001, ->S1<8KB>
B.IOR [a2,a3],[]
BSTOP

# consumer
BSTART.CUBE TMATMUL, FP32
B.DATR FP32, byte0, Null
B.FPATR 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
B.DIM LB0=128
B.DIM LB1=32
B.DIM LB2=64
B.IOS S0, mask=1111
B.IOS S1, mask=1111
B.IOT mask=1111, last, ->T<4KB>
BSTOP

The actual example is from:

kernel_multi_thread_matmul_matmul_shared_cube_layout_B1_M256_N256_K256_tM128_tN32_tK64_DTypefloat.elf.diss

Relevant addresses in the disassembly:

  • producer S0: 0x113a00x113b6
  • producer S1: 0x113bc0x113d0
  • consumer TMATMUL: 0x113d20x113f6

The producer uses B.IOS mask=0001 for both Shared destinations. The later TMATMUL uses the same S0/S1 as Shared sources with mask=1111.

What is unambiguous in the current ASL

  1. BSTART.TLOAD defines the Shared destination form as one B.IOS with SharedTileID, TSize, and PE_MASK, and says that each selected quarter uses that PE's private GPR base and stride:

The same machine-readable ASL contract says that a successful Shared form updates selected valid elements and that unselected PE regions remain unchanged for partial-mask updates.

  1. Shared state records initialized quarters explicitly:

SharedTileCooperativeMatrixReady() requires:

SharedTileDescriptorLegal(shared_tile_id)
shared.allocation_mask == '1111'
shared.initialized_mask == '1111'
shared.published
shared.tile.contents_defined
  1. Shared CUBE source schema calls the readiness predicate before accepting the source:

Specifically, BundleMatrixSharedSourceSchemaLegal() returns FALSE when SharedTileCooperativeMatrixReady(shared_tile_id) is false.

  1. Cooperative TMATMUL mask and Group-M behavior are defined separately:
  1. The release ADRs add the following requirements:
  • ADR-0097:67-73: Shared B.IOS destination allocates one Core-wide object; PE mode controls participation and quarter updates;
  • ADR-0098:84-100: range modifiers attach only to the immediately preceding B.IOT/B.IOS group, and a multi-PE Shared destination requires B.ASSEMBLE;
  • ADR-0100:50-76: cooperative TMATMUL uses group-M and requires four-PE participation/readiness.

The unresolved combination

From the above, the following interpretation appears required:

TLOAD B.IOS mask=0001
  => only the PE0-selected quarter is updated
  => PE1/PE2/PE3 quarters remain unchanged

TMATMUL B.IOS mask=1111
  => cooperative Shared source
  => S0/S1 must already satisfy SharedTileCooperativeMatrixReady()
  => all four quarters must be initialized and published

However, the ASL does not appear to state the complete producer sequence for the intended single-PE-issuer case.

Please clarify the following points in the spec:

  1. Is TLOAD B.IOS mask=0001 intended to load only one fixed Shared quarter, or is one PE allowed to issue a complete logical Shared tile while the other PE quarters are implicitly populated?
  2. If it loads only one quarter, what exact architectural instruction sequence must initialize the remaining three quarters before a TMATMUL B.IOS mask=1111 consumer?
  3. Is a single-PE issuer followed by a four-PE TMATMUL an explicitly supported execution pattern? If yes, please define the issuer/consumer synchronization and the state transition from initialized_mask=0001 to initialized_mask=1111.
  4. For Shared TLOAD with PE_MASK=1111, is B.ASSEMBLE INIT_LAST mandatory under ADR-0098, and what are the exact B.ASSEMBLE fields and association for the TLOAD form?
  5. For a Local TLOAD followed by TMOV.L2S.PUBLISH, does TMOV.L2S.PUBLISH with PE_MASK=0001 produce only one quarter or can it complete a Shared generation? Please provide the normative source-order and INIT/MIDDLE/LAST carrier.
  6. If the intended behavior is that an uninitialized quarter is readable by TMATMUL using ReadSharedTileWord() undefined values, this conflicts with the current SharedTileCooperativeMatrixReady() precondition. Please state which behavior is intended.
  7. For the example above, should the compiler generate four producer executions (one per PE), a Shared B.ASSEMBLE generation, or a different Shared/Local operand form?

Requested normative clarification

Please add an ASL executable point and/or an explicit normative NDF covering:

  • the legal producer carrier for a partial-mask Shared update that is later consumed cooperatively;
  • whether single-PE issuer/four-PE consumer is supported;
  • the required allocation_mask, initialized_mask, published, and contents_defined transitions;
  • the required B.ASSEMBLE association, if any;
  • the exact example carrier for the group_M=128, N=32, K=64 case.

Until this is clarified, a model must choose between two plausible interpretations: reject the example because the Shared primary is not fully ready, or accept a single-PE issuer as an implicit complete Shared producer. The current ASL predicates clearly define the readiness check, but do not provide an unambiguous end-to-end carrier for the latter behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions