Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
193 changes: 0 additions & 193 deletions benchmarks/prototype/moe_training/benchmark_kernels.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class Experiment:


def get_configs() -> List[ExperimentConfig]:
input_shapes = [(2**8, 4096), (2**12, 4096), (2**16, 4096)]
n_groups_list = [4, 8, 16]
input_shapes = [(16640, 5120)] # (Mg, K)
n_groups_list = [16, 128]
high_precision_dtypes = [torch.bfloat16]
configs = []
for input_shape, n_groups, high_precision_dtype in itertools.product(
Expand Down Expand Up @@ -129,6 +129,7 @@ def run_triton(

# bench torch
compiled_run_torch = torch.compile(run_torch)
warmup(compiled_run_torch, input_row_major, input_col_major, offs)
torch_time_us = benchmark_cuda_function_in_microseconds(
compiled_run_torch, input_row_major, input_col_major, offs
)
Expand All @@ -152,6 +153,7 @@ def print_results(experiments: List[Experiment]):
"high_precision_dtype",
"torch_time_us",
"triton_time_us",
"triton_speedup",
]
rows = []
for experiment in experiments:
Expand All @@ -165,6 +167,7 @@ def print_results(experiments: List[Experiment]):
experiment.config.high_precision_dtype,
experiment.result.torch_time_us,
experiment.result.triton_time_us,
f"{experiment.result.torch_time_us / experiment.result.triton_time_us:.2f}x",
]
)
print(tabulate(rows, headers=headers))
Expand Down