Skip to content

Adding scaling study documentation#2573

Merged
akenmorris merged 8 commits into
masterfrom
amorris/scaling_study
Jul 6, 2026
Merged

Adding scaling study documentation#2573
akenmorris merged 8 commits into
masterfrom
amorris/scaling_study

Conversation

@akenmorris

Copy link
Copy Markdown
Contributor

This PR adds a test harness and documentation on the optimization scaling with regards to number of particles and number of shapes.

Benchmarks shapeworks optimize runtime and CPU-core utilization vs
number of subjects (N) and particles (P). Generates a synthetic cohort
by replicating a base mesh with rigid + vertex-noise jitter, runs the
optimizer with per-phase profiling (SW_TIME_PROFILE), and records
wall-clock, serial-SVD vs parallel-sampling time, cores busy, and RSS.

- scaling_study.py: cohort generation, project build, run, metrics -> CSV
- scaling_plots.py: runtime/phase/utilization plots
- run_scaling.sh: env wrapper for the local build
Expose iters_per_split (--iters-per-split / --init-schedule), multiscale,
and multiscale_particles so the study can cover the initialization phase,
not just optimization. Initialization runs in mean-energy mode (no SVD)
and parallelizes well, so it scales very differently from the optimization
phase. Adds per-phase wall attribution (init_ms = Optimize::Initialize,
runopt_ms = Optimize::RunOptimize) to the CSV and log output.
scaling_phase_plots.py: initialization vs optimization wall time,
optimization-fraction, and blended CPU utilization vs N.
Each chart now names the phase it measures (OPTIMIZATION phase / INITIALIZATION
vs OPTIMIZATION), and the optimization-only charts note iterations_per_split=0,
so it's unambiguous which phase a graph represents.
The cores-vs-subjects charts used a log2 axis that matplotlib labeled as
2^4, 2^6, etc. Set explicit integer ticks (8, 16, ... 4096) via ScalarFormatter
for readability.
Extend the plain-integer log2 x-axis to the log-log runtime/phase charts too
(via a shared _int_xaxis helper), removing only x minor ticks so the y-axis
log minor gridlines are preserved.
Fold the per-phase CPU-utilization comparison (init-only vs opt-only isolated
runs) into scaling_phase_plots.py instead of an ad-hoc inline script, reading
--init-only-csv and --opt-only-csv at --compare-p.
@akenmorris akenmorris force-pushed the amorris/scaling_study branch from f01675d to 5349d34 Compare July 6, 2026 15:42
@akenmorris akenmorris merged commit f1f1b1c into master Jul 6, 2026
5 checks passed
@akenmorris akenmorris deleted the amorris/scaling_study branch July 6, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant