Skip to main content

Within-kernel timeline profiler for CUDA: view, summary, diff over .mprof traces

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mprof-0.1.2.tar.gz (89.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mprof-0.1.2-py3-none-manylinux_2_39_x86_64.whl (6.2 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

mprof-0.1.2-py3-none-macosx_11_0_arm64.whl (4.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file mprof-0.1.2.tar.gz.

File metadata

  • Download URL: mprof-0.1.2.tar.gz
  • Upload date:
  • Size: 89.5 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for mprof-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b2ca93b63b5286c88b8a32af5f6267309e5049ded3f2afecdd073d4dfeada66f
MD5 020b57cdb58f9a4e2f03d43eaafb0318
BLAKE2b-256 f705ad8cc22a4fb7938aafa2532407624d3221829cef82d4b56d8535587cd147

See more details on using hashes here.

File details

Details for the file mprof-0.1.2-py3-none-manylinux_2_39_x86_64.whl.

File metadata

  • Download URL: mprof-0.1.2-py3-none-manylinux_2_39_x86_64.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: Python 3, manylinux: glibc 2.39+ x86-64
  • Uploaded using 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}

File hashes

Hashes for mprof-0.1.2-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 696cb29c86e2b50ef16cd1c685f06857c0a1bcb9f3adb9da04f290c65da1bf54
MD5 bdbb678a6d453fb55669921b952cb7fb
BLAKE2b-256 a2da031787cddcb2c37fa8027e5dde9411c4069436d77b967a024c9a27d58ba9

See more details on using hashes here.

File details

Details for the file mprof-0.1.2-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: mprof-0.1.2-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 4.6 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using 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}

File hashes

Hashes for mprof-0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a18d23b2b1bdcc648f84c84525f72993957019ec9bebc052f63d9426598d07e0
MD5 ab13ea6dab455f3606b4c6868df0af0d
BLAKE2b-256 31348d34fa7dfa97cc86799d9df84c6934cd969b7007cc49eaeab537e12e184c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page