Skip to content

Conversation

@victor-eds
Copy link
Contributor

Revamp tritongen.simdblock[read|write] operations:

  • Rename to tritongen.sub_group_block_[read|write]
  • Implement type verification in signature
  • Represent scalar block memory accesses with a scalar type instead of vector<1xty>
  • Revamp ASM format

Closes #2750

@victor-eds victor-eds requested review from a team, chengjunlu and whitneywhtsang November 19, 2024 15:03
@victor-eds victor-eds self-assigned this Nov 19, 2024
Revamp `tritongen.simdblock[read|write]` operations:

- Rename to `tritongen.sub_group_block_[read|write]`
- Implement type verification in signature
- Represent scalar block memory accesses with a scalar type instead of `vector<1xty>`
- Revamp assembly format

Signed-off-by: victor-eds <[email protected]>
@victor-eds victor-eds force-pushed the triton-gen-sub-group-block-memaccess branch from 0abb7b4 to a0ea9f6 Compare November 19, 2024 15:09
Copy link

@mfrancepillois mfrancepillois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 317 to 342
def TritonGEN_SubGroupBlockMemoryAccessElementType
: AnyTypeOf<[I8, I16, I32, I64],
"Valid sub-group block memory access element type">;

def TritonGEN_SubGroupBlockMemoryAccessType
: AnyTypeOf<[TritonGEN_SubGroupBlockMemoryAccessElementType,
FixedVectorOfLengthAndType<
[2, 4, 8],
[TritonGEN_SubGroupBlockMemoryAccessElementType]>,
// Vectors of length 16 only allowed for i8 for now.
FixedVectorOfLengthAndType<[16], [I8]>],
"Valid sub-group block memory access type">;

def TritonGEN_SubGroupBlockMemoryAccessPointerType
: Type<And<[LLVM_AnyPointer.predicate,
Or<[CPred<"::llvm::cast<::mlir::LLVM::LLVMPointerType>($_self)" #
".getAddressSpace() == " #
"static_cast<unsigned>(kCrossWorkgroup)">,
CPred<"::llvm::cast<::mlir::LLVM::LLVMPointerType>($_self)" #
".getAddressSpace() == " #
"static_cast<unsigned>(kWorkgroup)">]>]>,
"LLVM pointer in local or global OpenCL address space",
"::mlir::LLVM::LLVMPointerType">;

def TritonGEN_SubGroupBlockReadOp: TritonGEN_Op<"sub_group_block_read"> {
let summary = "Sub-group block read.";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reminder before merge: use spaces instead of tabs for indentation.

@victor-eds victor-eds enabled auto-merge (squash) November 20, 2024 10:40
@victor-eds victor-eds merged commit 7551a90 into intel:main Nov 20, 2024
5 checks passed
@victor-eds victor-eds deleted the triton-gen-sub-group-block-memaccess branch November 20, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow scalars as triton_gen.simdblockread and triton_gen.simdblockwrite type arguments

5 participants