MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / metadata_fn

Function metadata_fn

src/fused_mm_sampling/core.py:401–414  ·  view source on GitHub ↗

Copied from https://github.com/triton-lang/triton/blob/main/third_party/proton/tutorials/matmul.py

(
    grid: tuple,
    metadata: NamedTuple,
    args: dict,
)

Source from the content-addressed store, hash-verified

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
407def _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
417def metadata_fn(

Callers

nothing calls this directly

Calls 1

unpack_gridFunction · 0.85

Tested by

no test coverage detected