From b13797e0e85243ce83a6ff26c0066dd8d07949d1 Mon Sep 17 00:00:00 2001 From: Mark Saroufim Date: Sun, 5 Jul 2026 17:15:01 -0700 Subject: [PATCH] Document eigh Brev profiling --- README.md | 15 ++++++-- docs/profiling.md | 87 ++++++++++++++++++++++++++++++++++++----------- src/cmd/mod.rs | 6 ++-- 3 files changed, 85 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 425176c..4d743bf 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ A command-line interface tool for submitting solutions to the [gpumode.com](http Tested on linux and mac but should just work on Windows as well. -## New: QR v2 Nsight Compute Profiling +## New: Nsight Compute Profiling -Profile QR v2 submissions on the hosted GPU Mode B200 Nsight Compute service. +Profile QR v2 and `eigh` submissions on the hosted GPU Mode B200 Nsight Compute service. See [docs/profiling.md](docs/profiling.md) for a complete copy-paste flow. Quick QR v2 example: @@ -18,6 +18,14 @@ export POPCORN_BREV_PROFILER_URL=https://http--brev-profiler-proxy--dxfjds728w5v popcorn submit submission.py --leaderboard qr_v2 --profile-brev --benchmark-index 0 --no-tui ``` +Quick `eigh` dense row example: + +```bash +curl -O https://raw.githubusercontent.com/gpu-mode/reference-kernels/main/problems/linalg/eigh_py/submission.py +export POPCORN_BREV_PROFILER_URL=https://http--brev-profiler-proxy--dxfjds728w5v.code.run +popcorn submit submission.py --leaderboard eigh --profile-brev --benchmark-index 3 --no-tui +``` + The CLI downloads and extracts `ncu-details.txt` and `ncu-details.csv` for agent-readable analysis. It also extracts the optional `.ncu-rep` GUI report and ends with a macOS command that opens it in Nsight Compute: @@ -129,6 +137,9 @@ POPCORN_BREV_PROFILER_URL=https://http--brev-profiler-proxy--dxfjds728w5v.code.r # Profile one QR v2 benchmark shape POPCORN_BREV_PROFILER_URL=https://http--brev-profiler-proxy--dxfjds728w5v.code.run popcorn submit --leaderboard qr_v2 --profile-brev --benchmark-index 0 solution.py +# Profile one eigh benchmark shape +POPCORN_BREV_PROFILER_URL=https://http--brev-profiler-proxy--dxfjds728w5v.code.run popcorn submit --leaderboard eigh --profile-brev --benchmark-index 3 solution.py + # Plain output mode (no TUI, good for CI/scripts) popcorn submit --no-tui --leaderboard grayscale_v2 --gpu A100 --mode test solution.py diff --git a/docs/profiling.md b/docs/profiling.md index be7df04..3b21a2c 100644 --- a/docs/profiling.md +++ b/docs/profiling.md @@ -1,8 +1,12 @@ -# QR v2 Nsight Compute Profiling +# Nsight Compute Profiling -This profiles the GPU Mode QR v2 problem from `reference-kernels` and downloads -Nsight Compute details that AI agents can read directly. The full `.ncu-rep` -GUI report is still included for local inspection. +This profiles GPU Mode submissions on the hosted B200 Nsight Compute service and +downloads agent-readable `ncu-details.txt` / `ncu-details.csv` artifacts. The +full `.ncu-rep` GUI report is still included for local inspection. + +The profiler uses the `benchmarks:` list from the active `reference-kernels` +checkout. `--benchmark-index N` profiles `benchmarks[N]`; omitting +`--benchmark-index` profiles every benchmark entry for that leaderboard. ## 1. Install and Register @@ -13,24 +17,26 @@ popcorn register discord Restart your terminal if `popcorn` is not found after installation. -## 2. Get the QR v2 Starter Submission +## 2. Set the Hosted Profiler URL ```bash -mkdir -p qr-v2-profile -cd qr-v2-profile -curl -O https://raw.githubusercontent.com/gpu-mode/reference-kernels/main/problems/linalg/qr_v2/submission.py +export POPCORN_BREV_PROFILER_URL=https://http--brev-profiler-proxy--dxfjds728w5v.code.run ``` -The profiler uses the hosted GPU Mode NCU service: +`BREV_PROFILER_URL` is also accepted as a fallback, but +`POPCORN_BREV_PROFILER_URL` is preferred. + +## 3. Profile QR v2 + +Get the QR v2 starter submission: ```bash -export POPCORN_BREV_PROFILER_URL=https://http--brev-profiler-proxy--dxfjds728w5v.code.run +mkdir -p qr-v2-profile +cd qr-v2-profile +curl -O https://raw.githubusercontent.com/gpu-mode/reference-kernels/main/problems/linalg/qr_v2/submission.py ``` -## 3. Profile One QR v2 Shape - -This profiles `benchmarks[0]` from -`reference-kernels/problems/linalg/qr_v2/task.yml`: +Profile one benchmark shape: ```bash popcorn submit submission.py \ @@ -46,7 +52,50 @@ The first QR v2 benchmark shape is: batch: 20; n: 32; cond: 1; seed: 43214 ``` -## 4. Read the Details +## 4. Profile Eigh + +Get the `eigh` starter submission: + +```bash +mkdir -p eigh-profile +cd eigh-profile +curl -O https://raw.githubusercontent.com/gpu-mode/reference-kernels/main/problems/linalg/eigh_py/submission.py +``` + +Profile the dense `n=512` leverage row: + +```bash +popcorn submit submission.py \ + --leaderboard eigh \ + --profile-brev \ + --benchmark-index 3 \ + --no-tui +``` + +The hosted profiler uses a deeper Nsight Compute launch window for `eigh` than +for QR v2 so PyTorch/cuSOLVER submissions can reach solver-path kernels after +clone/setup launches. + +Current `eigh` benchmark index table from `reference-kernels` main +`4a1153e`: + +| Index | Shape | +| ---: | --- | +| 0 | `batch: 20; n: 32; cond: 1; seed: 43214` | +| 1 | `batch: 40; n: 176; cond: 1; seed: 423011` | +| 2 | `batch: 40; n: 352; cond: 1; seed: 123456` | +| 3 | `batch: 640; n: 512; cond: 2; seed: 1029` | +| 4 | `batch: 60; n: 1024; cond: 2; seed: 75342` | +| 5 | `batch: 8; n: 2048; cond: 1; seed: 224466` | +| 6 | `batch: 640; n: 512; cond: 2; seed: 770001; case: mixed` | +| 7 | `batch: 60; n: 1024; cond: 2; seed: 770002; case: mixed` | +| 8 | `batch: 640; n: 512; cond: 0; seed: 770003; case: rankdef` | +| 9 | `batch: 640; n: 512; cond: 0; seed: 770004; case: clustered` | +| 10 | `batch: 60; n: 1024; cond: 0; seed: 770005; case: nearrank` | +| 11 | `batch: 640; n: 512; cond: 0; seed: 780001; case: lapack_dense_even_spectrum` | +| 12 | `batch: 60; n: 1024; cond: 0; seed: 780007; case: lapack_dense_geometric_spectrum` | + +## 5. Read the Details After the run finishes, the CLI downloads and extracts files like: @@ -66,19 +115,19 @@ The last line printed by the CLI opens the optional GUI report on macOS: open -a "NVIDIA Nsight Compute" 'profile.0-batch-20-n-32-cond-1-seed-43214/profile.ncu-rep' ``` -## Profile All QR v2 Benchmark Shapes +## Profile All Benchmark Shapes Omit `--benchmark-index`: ```bash popcorn submit submission.py \ - --leaderboard qr_v2 \ + --leaderboard eigh \ --profile-brev \ --no-tui ``` -This profiles every entry in the `benchmarks:` list in QR v2 `task.yml`, not -the `tests:` list. It will produce one zip plus extracted details and optional +This profiles every entry in the leaderboard's `benchmarks:` list, not the +`tests:` list. It will produce one zip plus extracted details and optional `.ncu-rep` files per benchmark shape. ## Normal Submit Commands diff --git a/src/cmd/mod.rs b/src/cmd/mod.rs index a2b7a92..f6353b4 100644 --- a/src/cmd/mod.rs +++ b/src/cmd/mod.rs @@ -62,7 +62,8 @@ pub struct Cli { #[arg(long)] pub mode: Option, - /// Profile on the GPU Mode Brev B200 and save the Nsight Compute trace locally + /// Profile on the hosted GPU Mode Brev B200 and save Nsight Compute artifacts locally. + /// Requires POPCORN_BREV_PROFILER_URL, or BREV_PROFILER_URL as a fallback. #[arg(long)] pub profile_brev: bool, @@ -145,7 +146,8 @@ enum Commands { #[arg(long)] mode: Option, - /// Profile on the GPU Mode Brev B200 and save the Nsight Compute trace locally + /// Profile on the hosted GPU Mode Brev B200 and save Nsight Compute artifacts locally. + /// Requires POPCORN_BREV_PROFILER_URL, or BREV_PROFILER_URL as a fallback. #[arg(long)] profile_brev: bool,