Skip to content

Instantly share code, notes, and snippets.

View akihironitta's full-sized avatar

Akihiro Nitta akihironitta

View GitHub Profile
@Chillee
Chillee / mm_weird.py
Last active May 1, 2024 18:23
Strangely, Matrix Multiplications Run Faster When Given "Predictable" Data!
import torch
torch.set_default_device('cuda')
from triton.testing import do_bench
from collections import defaultdict
from functools import partial
import random
random.seed(0)
def get_flops(A, B):
ms = do_bench(lambda: torch.mm(A, B))