CUDA MPS SM-percentage strong-scaling sweep - #12
Open
philipnickel wants to merge 4 commits into
Open
philipnickel wants to merge 4 commits into
philipnickel wants to merge 4 commits into
Conversation
added 4 commits
June 7, 2026 23:47
# Conflicts: # conf/sim/benchmark.yaml # simulate.py
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 the ability to clamp the process to a fraction of the GPU's SMs via CUDA MPS, and a strong-scaling sweep over that fraction.
mps_thread_percentconfig option (conf/config.yaml, defaultnull). When set, a preamble at the top ofsimulate.pyexportsCUDA_MPS_ACTIVE_THREAD_PERCENTAGEbeforeimport jax— required because CUDA reads the clamp once, when JAX creates its context. Recorded in metrics for the plot x-axis.conf/sweep/sm_scaling.yaml— Hydra-native sweep: fixed N=10M / G=128, backends swept in-process, a static sweep dir so repeated invocations aggregate, and the standard 3 plots (x = MPS thread %).run_sm_scaling.sh— the irreducible per-process loop. CUDA fixes the SM clamp at context creation and JAX keeps one context per process, so each percentage must be its own process (same constraint as MPI rank layout atMPI_Init— mirrors therun_solvertrick from the LSM-P2 codebase). The script starts the MPS daemon only for the sweep and stops it after, so ordinarypixi runcommands never depend on MPS.pixi run sweep-sm [overrides]task;mps-stop/mps-statushelpers.Why no Hydra multirun / activation hook
mps_thread_percentcan't work: all jobs share one CUDA context at the first job's clamp.pixi runcoupled all commands (tests, sims) to a healthy daemon and caused intermittent "no supported devices" failures. Removed — MPS is now started only byrun_sm_scaling.sh.Result (cutile_v3, N=10M, G=128)
Near-linear to ~50% SMs, then strong-scaling saturation as fixed per-step overhead dominates.
Also in this branch
PLOTTING_TODO.md— nsight-metric plots to add (atomic throughput/replay, warp stalls, L2 hit rate).steps_per_frame,num_grids).Test plan
pixi run lintcleanpixi run sweep-sm backend=cutile_v3— MPS clamp varies correctly, daemon self-cleans🤖 Generated with Claude Code