feat(benchmark): Add unified benchmark suite#166
Merged
Conversation
Add modular benchmark suite with:
- BenchmarkSuite class for unified benchmark orchestration
- GEMM benchmarks (fp32, tf32, bf16, fp16, fp8)
- GEMV benchmarks (bf16, fp8, nvf4, int4, w8a8)
- Attention benchmarks (SDPA, GQA)
- JSON export and baseline comparison
- Regression detection with configurable threshold
- CLI interface: python -m pygpukit.benchmark
Usage:
from pygpukit.benchmark import BenchmarkSuite
suite = BenchmarkSuite()
suite.add_gemm().add_gemv()
report = suite.run()
report.save("baseline.json")
# Compare with baseline
comparison = suite.compare("baseline.json")
if comparison.has_regression(threshold=0.05):
raise RuntimeError("Regression detected!")
Closes #163
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Deleted: - scripts/benchmark.py - benchmarks/benchmark_gemv_*.py - benchmarks/benchmark_nvf4_*.py - benchmarks/benchmark_w8a16_gemm.py - examples/benchmark_*.py Use 'python -m pygpukit.benchmark' instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add .claude/skills/benchmark/README.md - Update CLAUDE.md to use 'python -m pygpukit.benchmark' - Update PR checklist benchmark command 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/pygpukit/benchmark/python -m pygpukit.benchmarkFeatures
BenchmarkSuite API
CLI Usage
Modules
__init__.pybase.pyresults.pygemm.pygemv.pyattention.pycli.pyTest plan
python -m pygpukit.benchmark --quickpython -m pygpukit.benchmark --save test.jsonpython -m pygpukit.benchmark --compare test.jsonCloses #163
🤖 Generated with Claude Code