Repository navigation
π chore: release 0.7.2 - #66
Merged
Merged
Conversation
Before glibc 2.34 the target maps libc-2.28.so and libdl-2.28.so, so injection looked only for libc.so* and libdl.so* and failed with "target runtime symbol malloc was not found" on RHEL 8 and Ubuntu 20.04.
scripts/build-release.sh builds both CUPTI Agents in NVIDIA's Rocky Linux 8 CUDA images and the CLI in manylinux_2_28, then packages them. CI, the release workflow, and `just package` all run it, so release jobs no longer install packages on the runner. The CLI needs at most GLIBC_2.28 and the Agents GLIBC_2.17; the archive, installer, and wheel (manylinux_2_28) now accept glibc 2.28. Closes #57
A live --duration-ms capture kept collecting while any edge had no pair, until the timeout or --max-events. A graph edge that never matched ran a 300 ms capture for 16 s into EVENT_RATE_TOO_HIGH, and on a longer run the stop timed out as CLEANUP_FAILED. The duration now ends the capture and the final evaluation reports NO_MATCHED_SAMPLES for the edge.
Every node a cudaGraphLaunch replays carries the launch's correlation ID, and exact matching dropped one API call with several activities as ambiguous, so a graph launch never paired. A CUDA API call now pairs with each kernel, copy, or memset it issued.
Kernel names longer than 127 bytes, as many ATen template names are, were cut without a mark and then failed to demangle. A cut name now carries attributes.name_complete: false, like --aggregate's name_complete.
references/pytorch.md states what eager, torch.compile, CUDA Graph replay, and emit_nvtx leave in Event JSONL and --python-sample JSONL, how the records join and how exactly, and recipes for GPU time per kernel, Triton kinds, kernels per graph replay, the ATen op behind a kernel, and the Python frame behind a launch. The facts and recipes come from PyTorch 2.8 captures kept as fixtures; test_pytorch_reference.py runs every recipe on them, and just capture-pytorch-fixtures records them again. Closes #61
Without --samples only --duration-ms ends a capture, yet the loop took back-to-back snapshots, each flushing CUPTI in the target and re-evaluating every event. Under sustained GPU work a 100 ms capture ran for 15-48 s and filled --max-events. It now waits for the duration and stops once.
STOP flushed twice with activity and callbacks still recording. Under sustained GPU work the buffers never went quiet, each flush waited its 5 s limit, and the capture kept filling until --max-events or a failed state. STOP now stops API and NVTX recording and disables activity first, then delivers what was recorded. The buffer callback stops walking a buffer once the capture is no longer active.
The Agent served each control connection under flush_mutex with blocking recv and send, so a client that stopped reading or writing held it indefinitely. Each recv and send now times out after 30 s.
A snapshot flushed CUPTI and then waited until no buffer arrived for 100 ms, which never happens under sustained GPU work, so --samples captures stalled for up to 5 s per snapshot and kept filling. A snapshot now asks CUPTI to deliver completed buffers and replies at once; the next snapshot or STOP's final flush reads what arrives later.
CUPTI before 13.0 Update 1 deadlocks in cuptiActivityDisable(CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL) while another thread is inside cuGraphLaunch (NVIDIA bug 5350647): a tight CUDA Graph replay loop hung the target on the first or second STOP. Leaving kernel activity on is no way out: a forced flush with it on crashed the target once about 25 million graph-node kernels had been traced. On those versions the Agent counts cuGraphLaunch calls inside the driver during a kernel capture. STOP holds new graph launches at their API entry, waits until none is inside, disables kernel activity, lets them go, and then flushes; launches wait 15 ms at most under a tight replay loop. If a launch stays inside for 1 s, kernel activity stays on until the next capture, the Agent prints why on the target's stderr, and measure warns CUPTI_KERNEL_ACTIVITY_LEFT_ON. STOP now also stops API and NVTX recording first and drops activity that started after it.
test-cupti-graph-stress-live and its CUDA 12 variant arm and stop kernel captures 50 and 100 times while the target replays a 24-node graph without pause. They fail if a capture fails, the target stops advancing, or a STOP leaves kernel activity on. Both run in test-release-live.
A child forked from the target inherited the Agent's atexit handler. On exit it shut down the shared snapshot listener, joined a thread that does not exist in the child, unlinked the parent's control socket, and called CUPTI. The parent's snapshot thread then spun on accept errors and later measures could not connect. The handler now returns in any process other than the one that registered it. The CUDA Graph stress fixture forks and exits a child before its first capture, and the test rejects accept errors on the target's stderr.
The Agent registered its activity buffer callbacks once and skipped enabling kernel activity it believed was still on. After torch.profiler ran with TEARDOWN_CUPTI=1 in the same target, every later capture failed with EVENTS_DROPPED because CUPTI no longer delivered to the Agent. Each ARM now registers the callbacks and enables its activity kinds again; both calls are idempotent on CUDA 12.9 and 13.3. torch.profiler without TEARDOWN_CUPTI keeps the CUPTI subscriber after its first run, so the conflict hint no longer suggests stopping it. test-pytorch-profiler-live alternates xprobe and torch.profiler on one target and checks both outcomes.
cuptiSubscribe can return MAX_LIMIT_REACHED instead of MULTIPLE_SUBSCRIBERS_NOT_SUPPORTED when another profiler holds the subscriber. Map both to stop reason 7 so measure names the tools holding it instead of reporting a generic CUPTI error.
The stress test failed a round when the target's heartbeat had not moved 0.2 s after a capture, which a busy host can cause. Wait up to 10 s for the next beat, since a deadlocked target never beats again, and report waits over 1 s.
- Add Combining captures examples and first-run pitfall notes to SKILL.md (CUDA Graph launch selector, short stream-order windows, multi-process PID split, torch.profiler TEARDOWN_CUPTI, and skill-dir analyze_trace.py path). - Extend capture_pytorch_fixtures.py, references/pytorch.md, and test_pytorch_reference.py with real training-step (autograd thread, pageable HtoD, .item() DtoH sync) and two-process prefill/decode serving fixtures and recipes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
xprobe 0.7.2. Rebase-merge, then tag the merged commit
v0.7.2.This release lowers the glibc floor, adds a PyTorch reference to the Skill, and fixes a set of CUPTI Agent bugs found while capturing real PyTorch workloads. The worst of them could hang or crash the target. Closes #57 and #61.
Releases run on glibc 2.28 (#57)
scripts/build-release.shbuilds both CUPTI Agents in NVIDIA's Rocky Linux 8 CUDA images and the CLI in manylinux_2_28, then packages them. CI, the release workflow, andjust packageall use it, so release jobs no longer install toolchains on the runner.GLIBC_2.28, the AgentsGLIBC_2.17. The archive,install.sh, and the wheel (now taggedmanylinux_2_28) accept glibc 2.28, so RHEL 8, Rocky 8, and Ubuntu 20.04 hosts work.libc-2.28.soandlibdl-2.28.so, and injection looked only forlibc.so*/libdl.so*, failing withtarget runtime symbol malloc was not found.libdlexplicitly and the build rejects undefined symbols, so a missing dependency fails at build time instead of atdlopenin the target.PyTorch reference in the Skill (#61)
skills/xprobe-perf-profiling/references/pytorch.mdcovers eager,torch.compile(Triton), CUDA Graph replay, NVTX, a training step (autograd thread, pageable HtoD copies,.item()sync), and a two-process prefill/decode server.tests/agent-contract/fixtures/pytorch/.test-agent-contractruns them;just capture-pytorch-fixturesrecords them again.TEARDOWN_CUPTI, and callinganalyze_trace.pyfrom the Skill directory.CUDA Graph captures no longer hang the target
CUPTI before 13.0 Update 1 (all of CUDA 12, and 13.0.0) deadlocks in
cuptiActivityDisable(CUPTI_ACTIVITY_KIND_CONCURRENT_KERNEL)while another thread is insidecuGraphLaunch(NVIDIA bug 5350647). A tight CUDA Graph replay loop, as in LLM decode, hung the target on the first or secondSTOP. EagercuLaunchKerneldoes not trigger it.Leaving kernel activity on is no way out on CUDA 12: with it on, a forced flush crashed the target with an illegal memory access after about 25 million traced graph-node kernels (reproduced at the same count every run on 12.9; 13.3 passed 31M+).
On those CUPTI versions the Agent now:
cuGraphLaunch/cuGraphLaunch_ptszcalls inside the driver during a kernel capture;STOP, holds new graph launches at their API entry, waits until none is inside, disables kernel activity, and lets them go;Graph launches wait 15 ms at most under a tight replay loop. A standalone test ran 300 rounds (38.6M kernels) with the gate and no hang or crash. Without it, rounds 1, 2, and 5 hung.
If a launch stays inside the driver for 1 s, kernel activity stays on until the next capture turns it off. The Agent prints why on the target's stderr,
measurewarnsCUPTI_KERNEL_ACTIVITY_LEFT_ON, and the header sets a new feature flag. Measured cost while it stays on (CUDA 12.9, empty kernels, the worst case):CUDA 13.0.1 and later disable kernel activity directly.
test-cupti-graph-stress-live(CUDA 13.3, 50 rounds) and-cuda12(12.9, 100 rounds) arm and stop kernel captures while the target replays a 24-node graph without pause. They fail if a capture fails, the target stops beating, or aSTOPleaves kernel activity on. A round now waits up to 10 s for the target's next heartbeat before calling it hung and reports any wait over 1 s, so a busy host no longer fails it. Both run intest-release-live.Captures under sustained GPU load end on time
Under sustained kernel traffic a 100 ms capture could run for 15β48 s and fill
--max-events:--duration-mscapture without--samplestook back-to-back snapshots, each flushing CUPTI and re-evaluating every event. It now waits for the duration and stops once.STOPflushed twice while API callbacks and activity were still recording, and each flush waited up to 5 s for quiet buffers that never came.STOPnow stops API and NVTX recording and disables activity first, then delivers what was recorded. Activity that started afterSTOPis dropped.--duration-mscapture kept collecting while any edge had no pair, until the timeout. An edge that never matched turned a 300 ms capture into 16 s andEVENT_RATE_TOO_HIGH, orCLEANUP_FAILEDon longer runs. The duration now ends the capture, and the edge reportsNO_MATCHED_SAMPLES.recv/sendtimes out after 30 s, so a stuck client cannot hold the Agent's flush lock.Exact pairing and kernel names
attributes.name_complete: falsein Event JSONL.Agent fixes from an audit against Kineto and XLA
atexithandler. On exit it shut down the shared snapshot listener, joined a thread that does not exist in the child, unlinked the parent's control socket, and called CUPTI. The parent's snapshot thread then spun onaccepterrors, and latermeasurecalls could not connect. The handler now does nothing outside the process that registered it. The graph stress fixture forks and exits a child before its first capture.TEARDOWN_CUPTI=1in the same target, every later xprobe capture failed withEVENTS_DROPPED. EachARMnow registers the callbacks and enables its activity kinds again. Both calls were verified to be idempotent on CUDA 12.9 and 13.3: enabling twice and disabling once turns the kind off, and re-registering while activity is on hands pending buffers to the new callbacks.TEARDOWN_CUPTI, torch.profiler keeps the CUPTI subscriber after its first run, so the conflict hint no longer suggests stopping it.cuptiSubscribereturningCUPTI_ERROR_MAX_LIMIT_REACHEDis also reported as a subscriber conflict (stop reason 7,CUPTI_NOT_AVAILABLEwith the hint) instead of a generic CUPTI error.just test-pytorch-profiler-livealternates xprobe and torch.profiler on one target. After torch.profiler releases CUPTI, captures must receive kernels; while it holds the subscriber, they must fail withCUPTI_NOT_AVAILABLE. It runs intest-release-live.Checked and left unchanged: CUPTI 13.1 release notes mention zero kernel timestamps with
cuptiActivityRegisterTimestampCallbacksince 12.6 Update 2. On the 13.0.0 and 13.0.1 runtimes, 48,100 kernels (eager plus graph replay) all had timestamps, and the CUPTI live test with the release-built Agent passed with aligned clocks.Verification
On the NVIDIA dev machine (RTX 3060 Laptop, WSL2), on the code of ea11554 (the release commit); the two docs commits before it change only README, docs, the Skill, and its fixture tests:
fmt-check,lint,test,test-agent-contract,test-cupti, andtest-install;test-release-live: BPF and CPU; CUPTI, burst, graph stress, NVTX, injection, and multisource on CUDA 12.9 and 13.3; the CUDA 12 minimum; trigger and Python-sample; PyTorch, PyTorch CUDA, the new torch.profiler handoff, and triage; and every benchmark it runs.All passed, and neither graph stress run recorded a heartbeat stall. The Agent builds with
-Werrorin the pinned CUDA 12.9 and 13.3 images. After the docs commits,test-agent-contractandlint-commitspassed again.