Skip to content

Start milestone 7a: add CUDA-event step profiler - #7

Merged
feitreim merged 2 commits into
mainfrom
feat/milestone-7a-step-profiler
Jul 17, 2026
Merged

feitreim merged 2 commits into
mainfrom
feat/milestone-7a-step-profiler

Conversation

@feitreim

Copy link
Copy Markdown
Owner

Summary

  • add a reusable StepProfiler/KernelProfiler API to gpu/bench-util using timing-enabled CUDA events
  • instrument every forward/backward launch in gpu/llama-model while keeping normal runs on a zero-event NoopProfiler path
  • add ./run.sh llama-model profile, including warmup steps and a tabular per-kernel/full-step report
  • report unattributed device time separately so copies, allocation/zero-fill work, and gaps are not misrepresented as kernel time

Current scope

Milestone 6 has not landed yet, so this first 7a PR profiles the complete GPU work currently available: forward + backward. The profile binary explicitly calls out that optimizer timing will join the scope when the training loop/AdamW lands.

B200 result

A profile run on an NVIDIA B200 recorded 67 launches for the tiny parity model:

  • full step: 1.1205 ms
  • measured kernels: 0.4958 ms (44.25%)
  • unattributed copies/allocations/gaps: 0.6246 ms (55.75%)

Modal run: https://modal.com/apps/feitreim/main/ap-D3J87n2uSPBeRRfZfy8ncB

Validation

  • cargo test
  • cargo clippy --workspace --all-targets -- -D warnings
  • ./run.sh llama-model profile (B200)
  • ./run.sh llama-model (B200; full fp32 forward/backward still matches CPU)

Parity run: https://modal.com/apps/feitreim/main/ap-IekW0QjlOhC5F579pov5RS

@feitreim
feitreim merged commit c3cc056 into main Jul 17, 2026
@feitreim
feitreim deleted the feat/milestone-7a-step-profiler branch July 17, 2026 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant