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

Function matmul

src/fused_mm_sampling/helion_impl.py:87–97  ·  view source on GitHub ↗
(x: torch.Tensor, y: torch.Tensor)

Source from the content-addressed store, hash-verified

85 },
86)
87def matmul(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
88 m, k = x.size()
89 k2, n = y.size()
90 assert k == k2, f"size mismatch {k} != {k2}"
91 out = torch.empty([m, n], dtype=torch.promote_types(x.dtype, y.dtype), device=x.device)
92 for tile_m, tile_n in hl.tile([m, n]):
93 acc = hl.zeros([tile_m, tile_n], dtype=torch.float32)
94 for tile_k in hl.tile(k):
95 acc = torch.addmm(acc, x[tile_m, tile_k], y[tile_k, tile_n])
96 out[tile_m, tile_n] = acc
97 return out

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected