Copied from https://github.com/triton-lang/triton/blob/main/third_party/proton/tutorials/matmul.py
(
grid: tuple,
metadata: NamedTuple,
args: dict,
)
| 399 | matmul_bytes = bsz_v * bsz_d * 2 + bsz_h * bsz_d * 2 |
| 400 | if matmul_bytes > max_bytes: |
| 401 | return False |
| 402 | |
| 403 | return True |
| 404 | |
| 405 | |
| 406 | @triton.jit |
| 407 | def _compute_tile_pid(tile_id, num_pid_in_group, num_pid_v, GROUP_SIZE_V): # noqa: N803 |
| 408 | """Compute pid_v, pid_h from tile_id using grouped ordering for L2 cache efficiency.""" |
| 409 | group_id = tile_id // num_pid_in_group |
| 410 | first_pid_v = group_id * GROUP_SIZE_V |
| 411 | group_size_v = tl.minimum(num_pid_v - first_pid_v, GROUP_SIZE_V) |
| 412 | pid_v = first_pid_v + (tile_id % group_size_v) |
| 413 | pid_h = (tile_id % num_pid_in_group) // group_size_v |
| 414 | return pid_v, pid_h |
| 415 | |
| 416 | |
| 417 | def metadata_fn( |
nothing calls this directly
no test coverage detected