Skip to content

Instantly share code, notes, and snippets.

@catswe
catswe / benchmark_matmul.py
Created October 3, 2025 14:48 — forked from NTT123/benchmark_matmul.py
Benchmark pytorch matrix multiplication with locked GPU clock for stable performance.
"""
Benchmark matrix multiplication with locked GPU clock for stable performance.
Requires: pip install nvidia-ml-py torch numpy
"""
import pynvml
import torch
import random
import os
import numpy as np
from torch.profiler import profile, ProfilerActivity, schedule