feat(presto/slurm): kernel perf flamegraph profiling pipeline - #394
Draft
misiugodfrey wants to merge 1 commit into
Draft
feat(presto/slurm): kernel perf flamegraph profiling pipeline#394misiugodfrey wants to merge 1 commit into
misiugodfrey wants to merge 1 commit into
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
misiugodfrey
force-pushed
the
misiug/bench-perf-profiling
branch
from
July 27, 2026 22:05
1160024 to
15e43c7
Compare
Based on kjmph's bench33 POC patch. Adds a fully self-contained CPU-time profiling pipeline using Linux kernel perf, with no Perl or CDN dependencies for flamegraph rendering. New scripts: - perf_flamegraph.py: dependency-free SVG flamegraph renderer; reads perf script output and writes a single self-contained HTML/SVG file - perf_profiler_functions.sh: coordinator-side enable/stop token handshake (filesystem sentinel files for query-bounded profiling) - perf-record-sharded.sh: bounded TID-shard perf record processes; each shard captures a subset of worker TIDs to keep file sizes manageable on multi-threaded workers - perf-worker-sampler.sh: host-side orchestration; preflight checks, perf attach after workers are live, token-gated stop, publish - process-perf-captures.sh: deferred symbolization and flamegraph rendering; runs from the login node after the job completes - presto-repl-from-job.sh: launch an interactive Presto CLI session connected to a coordinator from a running Slurm job Integration hooks: - functions.sh: perf sidecar launch in run_worker - launch-run.sh: --perf, --perf-output-dir, --perf-frequency flags - run-presto-benchmarks.sh: ENABLE_PERF propagation and result dir integration
misiugodfrey
force-pushed
the
misiug/bench-perf-profiling
branch
from
July 28, 2026 16:03
15e43c7 to
fd26f8b
Compare
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.
Summary
Adds a self-contained CPU-time profiling pipeline using Linux kernel
perf, with no Perl or CDN dependencies for flamegraph rendering. The pipeline is query-bounded (attach after workers are ready, stop after the query of interest), sharded across TIDs to keep per-worker file sizes manageable, and deferred for symbolization to avoid impact during the benchmark.Based on kjmph's bench33 POC patch.
New files
perf_flamegraph.py: dependency-free SVG flamegraph renderer written in Python stdlib; readsperf scripttext output and writes a single self-contained HTML/SVG file; no FlameGraph.pl, no CDN, no Node.jsperf_profiler_functions.sh: coordinator-side enable/stop token handshake using filesystem sentinel files; the benchmark loop writes an enable token before each query and a stop token after; the sampler uses these to bound its capture windowperf-record-sharded.sh: divides the worker's thread list into N shards and runs oneperf recordprocess per shard; keeps per-shard perf.data files below a configurable size ceilingperf-worker-sampler.sh: host-side orchestration; waits for the enable token, attaches to the worker process, records until the stop token, publishes capture files to the result directory; includes preflight checks forperf_event_paranoidand debug symbol availabilityprocess-perf-captures.sh: deferred post-processing script run from the login node after the job completes; callsperf scriptfor symbolization andperf_flamegraph.pyfor rendering; designed to run after job exit so symbolization doesn't interfere with benchmark timingpresto-repl-from-job.sh: launches an interactive Presto CLI session connected to a running job's coordinator usingsrun --overlap; useful for inspecting retained query state during a live benchmarkIntegration hooks
functions.sh:run_workerlaunchesperf-worker-sampler.shas a sidecar srun step whenENABLE_PERF=1launch-run.sh:--perf,--perf-output-dir,--perf-frequencyflagsrun-presto-benchmarks.sh:ENABLE_PERFpropagation and result dir integrationDependencies
bench-slurm-robustness) for the result directory structure that perf captures are written intoVerification
--perfon the NVL72 cluster; verifyperf-worker-sampler.shattaches to worker processes and producesperf.data.*shard files inresult_dir_<jobid>/perf/process-perf-captures.shon the result directory after the job; verify it producesflamegraph.svg(or.html) for each captured workerpresto-repl-from-job.sh <job_id>against a live benchmark; verify the Presto CLI connects and can execute queriesperf-record-sharded.shsplits the TID list correctly and each shard produces a separateperf.data.<n>file./ci/check_style.shon changed Python and shell files