Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ jobs:
# Run hopper/test_flashattention.py separately to avoid out of gpu memory
python3 -m pytest -vs hopper/test_flashattention.py

- name: Run python examples on CUDA
# Execute on H100 due to its ~30s speed advantage over A100;
# example duration matches this gain and is device-agnostic.
if: ${{(matrix.runner[0] == 'self-hosted') && (matrix.runner[1] == 'H100')}}
run: |
cd python/examples
# Test example
find . -type f -name '*.py' -exec echo {} \; -exec python3 {} \;

- name: Clear cache
run: |
rm -rf ~/.triton
Expand Down
24 changes: 7 additions & 17 deletions include/triton/Dialect/Triton/IR/TritonOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -528,34 +528,24 @@ def TT_TransOp : TT_Op<"trans", [Pure,
//
// SPMD Ops
//
def TT_GetProgramIdOp : TT_Op<"get_program_id", [Pure]> {
let arguments = (ins TT_ProgramDim:$axis);

let results = (outs I32:$result);

let assemblyFormat = "$axis attr-dict `:` type($result)";

let extraClassDeclaration = [{
int32_t getAxisAsInt() {
return static_cast<int32_t>(getAxis());
}
}];
}

def TT_GetNumProgramsOp : TT_Op<"get_num_programs", [Pure]> {
class program_id_inst <string name> : TT_Op<name, [Pure]> {
let arguments = (ins TT_ProgramDim:$axis);

let results = (outs I32:$result);

let assemblyFormat = "$axis attr-dict `:` type($result)";

let extraClassDeclaration = [{
int32_t getAxisAsInt() {
return static_cast<int32_t>(getAxis());
}
int32_t getAxisAsInt() {
return static_cast<int32_t>(getAxis());
}
}];
}

def TT_GetProgramIdOp : program_id_inst<"get_program_id">;
def TT_GetNumProgramsOp : program_id_inst<"get_num_programs">;

//
// Dot Op
//
Expand Down