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

Function torch_matmul

src/fused_mm_sampling/persistent_matmul.py:686–696  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

684
685
686def torch_matmul(a, b):
687 M, K = a.shape
688 N, K = b.shape
689 bytes_per_elem = a.element_size()
690 flops_str = f"flops{bytes_per_elem * 8}"
691 with proton.scope(
692 f"torch [M={M}, N={N}, K={K}]",
693 {"bytes": bytes_per_elem * (M * K + N * K + M * N), flops_str: 2.0 * M * N * K},
694 ):
695 c = torch.matmul(a, b.T)
696 return c
697
698
699def torch_matmul_nontransposed(a, b):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected