Skip to main content

mprof

A within-kernel profiler for CUDA. Opens the opaque kernel box nsys leaves shut — any kernel, low-overhead — and tells you what hurts and where, as a human view or agent-readable XML. One Rust binary, no Python.

mprof views

Install

uv tool install mprof

Prebuilt wheels for macOS-arm64 and Linux-x86_64 (else builds from source). view/summary/diff run anywhere on a trace; record needs a CUDA GPU box.

Use

mprof record  -- ./your_program     # capture: CUPTI PC sampling + auto SASS attach
mprof summary trace.mprof           # kernel triage — XML default, also --human / --json
mprof view    trace.mprof           # GUI: diagnosis-first, drill into any kernel
mprof diff    a.mprof b.mprof       # per-kernel timing delta

Views

  • Summary — the diagnosis: verdict + per-dimension state (ok/minor/issue) + hot instructions. Facts, not fixes.
  • Hotspots — instructions grouped by opcode family, ranked by sample share; click to expand variants.
  • Flame — sampled SASS in instruction-category lanes.
  • Trace — the outer CUDA timeline; double-click a kernel to drill in.
  • Mega / Density — measured per-SM timeline, for .mkprof traces.

PC sampling has no per-sample timestamps, so hotspots are ranked, never placed on a fabricated time axis.

Capture on a GPU box

mprof setup                          # build the CUPTI producer against local CUDA
mprof doctor                         # check toolkit / producer / perf-counter permission
mprof record -- ./your_program       # -> trace.mprof (+ .pc.json sidecar)

doctor prints the exact sudo+reboot step if PC sampling is restricted (NVreg_RestrictProfilingToAdminUsers). Copy the trace anywhere to view it.

For a real within-kernel time axis (PC sampling can't give one), annotate with producers/cuda/mprof.cuh: MPROF_SCOPE(id) around phases, or MPROF_BLOCK(id) at the top of a kernel for a measured SM-occupancy timeline.

Development

cargo build --release
cargo nextest run

Metadata

Release files for mprof 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mprof 0.1.2
File Size Uploaded
mprof-0.1.2.tar.gz 89.5 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for mprof 0.1.2
File Interpreter ABI Platform
mprof-0.1.2-py3-none-manylinux_2_39_x86_64.whl Python 3 none Linux glibc 2.39+ x86-64 Details
mprof-0.1.2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details

Total release size: 10.9 MB

Release files / mprof-0.1.2.tar.gz

Download URL mprof-0.1.2.tar.gz
Size 89.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b2ca93b63b5286c88b8a32af5f6267309e5049ded3f2afecdd073d4dfeada66f
BLAKE2b-256 checksum
How to use checksums
f705ad8cc22a4fb7938aafa2532407624d3221829cef82d4b56d8535587cd147
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mprof-0.1.2-py3-none-manylinux_2_39_x86_64.whl

Download URL mprof-0.1.2-py3-none-manylinux_2_39_x86_64.whl
Size 6.2 MB
Tags Linux glibc 2.39+ x86-64 Python 3
SHA-256 checksum
How to use checksums
696cb29c86e2b50ef16cd1c685f06857c0a1bcb9f3adb9da04f290c65da1bf54
BLAKE2b-256 checksum
How to use checksums
a2da031787cddcb2c37fa8027e5dde9411c4069436d77b967a024c9a27d58ba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mprof-0.1.2-py3-none-macosx_11_0_arm64.whl

Download URL mprof-0.1.2-py3-none-macosx_11_0_arm64.whl
Size 4.6 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a18d23b2b1bdcc648f84c84525f72993957019ec9bebc052f63d9426598d07e0
BLAKE2b-256 checksum
How to use checksums
31348d34fa7dfa97cc86799d9df84c6934cd969b7007cc49eaeab537e12e184c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.2 This release

3 release files

0.1.1

3 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page