benchmark-kernel
使用 CUPTI 計時功能對 GPU 核心進行效能測試
由於測量開銷,準確測量 GPU 核心效能具有挑戰性。本技能提供使用 CUPTI 硬體效能分析的逐步說明,以獲得精確的核心執行時間。比較不同的後端(如 FlashAttention 和 cuDNN),找出您工作負載的最快速實作。
スキルZIPをダウンロード
Claudeでアップロード
設定 → 機能 → スキル → スキルをアップロードへ移動
オンにして利用開始
テストする
「benchmark-kernel」を使用しています。 使用不同後端對解碼注意力進行效能測試
期待される結果:
- fa2: 中位數 0.145ms,125.3 TFLOPS
- fa2_tc: 中位數 0.138ms,131.5 TFLOPS
- cudnn: 中位數 0.142ms,127.8 TFLOPS
- 最佳:fa2_tc,吞吐量 131.5 TFLOPS
「benchmark-kernel」を使用しています。 如何安裝 CUPTI 以進行準確的效能測試
期待される結果:
- Install with: pip install -U cupti-python
- Requires CUDA 13 or higher
- Framework auto-detects and uses CUPTI when available
- Falls back to CUDA events if CUPTI not installed
「benchmark-kernel」を使用しています。 為什麼我的效能測試結果不一致
期待される結果:
- 增加暖機迭代次數(嘗試 10 次 dry_run_iters)
- 增加測量迭代次數(嘗試 50 次 num_iters)
- 使用冷 L2 快取選項以減少快取效應
- 檢查您的 GPU 是否發生熱節流
セキュリティ監査
安全Documentation-only skill containing tutorial instructions for GPU kernel benchmarking. No executable code, network calls, or file system access. Static findings are false positives caused by the analyzer incorrectly flagging documentation strings and bash command examples as security vulnerabilities.
リスク要因
🌐 ネットワークアクセス (1)
📁 ファイルシステムへのアクセス (1)
⚙️ 外部コマンド (96)
品質スコア
作れるもの
準確測量核心效能
使用 CUPTI 硬體效能分析來獲得精確的 GPU 執行時間,不受主機端開銷影響
比較注意力核心後端
對不同的注意力實作進行效能測試,找出您工作負載的最快速選項
對 FP8 GEMM 操作進行效能分析
測量混合精度矩陣乘法核心的效能
これらのプロンプトを試す
Help me benchmark my CUDA kernel using bench_gpu_time() with 30 iterations and 5 warmup runs
Show me how to benchmark BatchDecodeWithPagedKVCacheWrapper with fa2, cudnn, and cutlass backends
Create a test list file to benchmark different batch sizes and sequence lengths
Write a Python script that benchmarks my custom attention kernel with CUPTI timing
ベストプラクティス
- 可能的話安裝 CUPTI 以獲得硬體級準確度
- 使用參考檢查來驗證效能測試期間的核心正確性
- 執行足夠的迭代次數(30 次以上)以獲得統計意義
回避
- 在沒有暖機迭代次數的情況下進行效能測試
- 當 CUPTI 可用時卻只使用 CUDA 事件
- 在未驗證輸出正確性的情況下比較後端