Skip to content

Instantly share code, notes, and snippets.

@NTT123
NTT123 / benchmark_matmul.py
Created October 3, 2025 10:58
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