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

Function grid

src/fused_mm_sampling/core.py:277–283  ·  view source on GitHub ↗
(meta)

Source from the content-addressed store, hash-verified

275 # HBM (155 MB per decode step at Qwen3-1.7B / H=256) for a buffer the
276 # kernel never touches. Pass a 1-element dummy in that case so the kernel
277 # still has a valid pointer to receive.
278 logits_shape = (V, H) if return_logits else (1,)
279 logits_out = torch.empty(logits_shape, dtype=torch.float32, device=weights.device)
280
281 grid_size = {"v": None}
282
283 def grid(meta):
284 grid_size_v = triton.cdiv(V, meta["BLOCK_SIZE_V"])
285 grid_size_h = triton.cdiv(H, meta["BLOCK_SIZE_H"])
286 grid_size["v"] = grid_size_v

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected