Skip to main content

CPU tuning and NUMA scaling

User documentation · CLI reference

Run a C or OpenMP application through the same named-Operator interface:

DEVITO_ARCH=gcc DEVITO_LANGUAGE=openmp DEVITO_PLATFORM=cpu64 \
OMP_NUM_THREADS=6 OMP_PROC_BIND=close OMP_PLACES=cores \
taskset -c 6-11 python3 -m warper Forward --optimize-for 15m -- app.py

Choose the CPU mask and thread count for your allocation. The example uses six cores in one NUMA domain. An existing C/OpenMP Devito environment selects CPU automatically.

Fresh CPU commands record supplied DEVITOCOMP_ROOT, LIKWID_LIBRARY and LD_LIBRARY_PATH values for construction and resume. Keep those dependencies available at the recorded locations. Older sessions retain their original environment; supply any provider settings that were not recorded there.

The CLI and dashboard report the recorded CPU product and execution host. Older CPU records without a product show unavailable hardware metadata.

Warper checks all four min-storage/cire-rotate combinations. Fresh searches keep blockinner=False, overriding application and seed settings so the innermost loop stays unblocked. Existing sessions retain their recorded options. Each compiled Operator has two unscored one-step warmups at the probe block shape. Warmups initialise the runtime without collecting output norms. Their timings determine one common timestep count for compiler probes and block trials. Warper then screens the compiler’s runtime block parameters, starting with the fastest probe. Every trial advances all blocked loop nests together. Compiler-attributed section timings choose each nest’s shape. Block-only screens collect provisional timings without scanning output arrays or restoring compute buffers for every shape. Saving and compression retain any required resets. Warper restores inputs, measures and correctness-checks the combined whole Operator before it can become a winner. Nests sharing a timer or runtime parameter stay coupled. If independent timing is unavailable, Warper selects a measured whole-Operator setting. Changes to runtime blocks reuse the compiled Operator. cire-schedule is not tuned. Construction uses one worker and does not overlap measured execution.

The default block-size domain follows DevitoTuner: even sizes 2–64, a 16×16 probe, and a full-span innermost dimension when all spatial dimensions are blocked. The screen tries broad sizes early, then the remaining even values. It does not form a Cartesian product between nests. Unblocked and single-block-dimension nests need no sweep. Hierarchical blocking is unsupported. You can set --blk-size-min, --blk-size-max, --blk-size-step, and --blk-shape-probe X,Y on a fresh CPU session.

By default, trials target one second of native Operator time. Warper takes the median warmup time for each compiler variant and uses the slowest median to choose the timestep count, rounded down, with at least one step and at most the application’s original count. For example, 1.4 seconds per step selects one step; 0.1 seconds selects 10, if the application has that many. Every scored trial in the session uses this same count. Validated runs also pay reset and output-checking costs; a single step may exceed the target. Saved sessions retain their recorded target and checks.

Use --trial-time-target SECONDS to change the target or --timesteps-per-run N to fix a positive count explicitly. These options are mutually exclusive and apply only to fresh CPU sessions. CUDA keeps its existing minimum of 20 steps. Compiler probes and selected compositions restore identical inputs and check numerical outputs. Provisional block timings cannot promote a champion. An improvement above 0.5% retains a complete Operator. Coverage reports tested/planned shapes per nest. A budget stop is labelled partial; it does not establish the best shape in the full configured space. Warper reserves a run for the combined choice and reports construction, warmup, probe and block costs separately. The deadline bounds exploration; final correctness and timing use the application’s original horizon. The recommendation shows compiler opt and runtime apply parameters separately. SubDomains, supported compressed fields and saved output use the ordinary application semantics; saving remains enabled during CPU search and final validation. The separate CUDA NSYS I/O analysis is not used for CPU sessions.

Fresh CPU tuning commands automatically collect LIKWID memory-traffic evidence after ordinary correctness and timing. No profiler selection flags are needed. This requires DevitoPRO’s LIKWID integration and a loadable LIKWID shared library. Set LIKWID_LIBRARY=/path/to/liblikwid.so if it is not on the library search path. Keep its dependencies on LD_LIBRARY_PATH, including the MPI libraries. Counter permissions must already be available; Warper does not load drivers or change host perf permissions. Missing dependencies or events are reported as unavailable, while native results remain usable.

The current qualified event profile covers Linux AMD Zen 3. Warper uses two separate Data Fabric channel passes and falls back to genuine L3 misses times 64 bytes when those counters are unavailable. On Zen 3, genuine L3-miss counters are shared and may also be unavailable inside a VM. LIKWID’s CACHE group measures a different boundary and cannot substitute for them. Other architectures currently report unavailable rather than reuse Zen 3 events.

The CLI and GUI show individual compiler loop nests, their written fields and generated code, including CPML and receiver work. Native time and Operator share come from a separate timing-only control with counter callbacks disabled. For MPI, all loop times come from the rank with the longest timed Operator; remaining MPI/control time is reported separately. These diagnostic times do not replace the final application runtime. Larger per-nest rank maxima appear separately to expose imbalance; those maxima can belong to different ranks and cannot be added. The hardware table, sorting, source links and utilisation bars follow the GPU view’s layout.

Traffic is labelled a Data Fabric estimate or L3-miss traffic proxy. The proxy omits dirty writebacks. DF’s Zen 3 formulas are approximate and need NPS1 firmware qualification; unknown NPS and counter multiplexing coverage stay explicitly unverified. One collector owns the node’s shared counters and records disjoint active-rank/loop intervals. Ranks align at proven common nest boundaries; only windows identifying the same nest on every rank supply its bandwidth. Allocation, MPI and initialization stay outside those windows. Rank-dependent MPI control flow and nests too short relative to counter overhead show an explicit unavailable reason, while native loop time remains available. Fresh profiles also measure executed conditional loops on a single rank, such as output sampled every second timestep. Earlier profiles retain their saved conditional-loop policy.

Warper also measures a cache-exceeding streaming triad at the same placement, thread count, dtype, compiler flags and traffic boundary. Three checked samples supply its median reference. Reference arrays must fit the available memory, including cgroup v1/v2 limits; insufficient capacity leaves the reference unavailable. A per-nest STREAM percentage appears only when the counter methods match and reference spread is at most 5%. Both sides use counter-derived bytes; STREAM’s printed algorithmic byte count describes a different quantity. The ratio is a measured reference, not DRAM SOL, and does not automatically declare saturation. It describes the full placement’s capacity; boundary and sparse nests can leave some ranks idle. Other applications and overlapped MPI communication sharing the measured socket/cache scopes can affect counters. L3 misses can be served by peer caches, so the proxy is not a guaranteed upper or lower bound on DRAM traffic.

Counter callbacks perturb their separate diagnostic runs. Every replay restores inputs and checks outputs; its timing never replaces native measurements or changes winner selection. Replays use the frozen CPU search horizon, or the study’s chosen horizon for MPI. Only the selected Operator gets the extra build; DF normally needs two replay passes and the L3 proxy one. Paid counter passes, streaming controls, native loop controls and source excerpts are saved for recovery. Completed and older sessions keep their saved policy; add profiling through a new linked NUMA study when examining an older tuning result.

The trial selector and Profiler tab also show each CPU trial’s native compiler sections, including its configured I/O, even when counters were not requested. Sections may contain several nests. A Native complete badge describes the checked native timing receipt; the selected Operator’s optional LIKWID table adds per-nest counter evidence. The CPU champion’s Copy opt + apply action copies its compiler options and named runtime blocks. Trial configuration has a separate Copy apply arguments action; keep those arguments on the application’s existing Operator.apply call.

Start scaling by naming its completed CPU tuning baseline:

python3 -m warper --strong-scale-from SESSION_ID --single-node
# Or scale across a host allocation:
python3 -m warper --strong-scale-from SESSION_ID --hostfile hosts

Warper detects allocated NUMA domains and tests doubling counts through the available limit. Multiple hosts use all detected domains per node and doubling node counts through the allocation. Each rank uses one NUMA domain and one OpenMP thread per allocated physical core. Resources must match across hosts. Scaling runs its complete matrix without a tuning deadline. Results attach to the same session, beside Kernel tuning and its LIKWID reports; resume with --resume SESSION_ID. An optional command after -- selects a different fixed problem. Open MPI, a compatible MPI C compiler and shared paths are required.

Warper explores the supported MPI modes and legal decompositions, then selects the fastest candidate at each rank count. Each candidate supplies one checked sample at the original application horizon. Selected points reuse that sample and their compiled Operators, adding only the repeats needed to reach three. The final curve has one validated point per rank count. LIKWID collection stays in kernel tuning. An explicit MPI mode restricts the search; explicit short screening runs remain exploratory and cannot supply final points.

Warper runs one independent reference for the fixed scaling problem and checks every full sample against its global output norms. Each MPI launch has a one-timestep warmup, then restores inputs before measurement. Warmups do not count as measured repeats. Compatible cases share compiled publications. All rank thread masks are verified around each measurement. Saved schema-2 studies prefer CPU domains with local RAM, grouped by socket, before CPU-only domains. The plan records each domain’s socket membership and memory capacity. For RAM on nodes 1, 2, 5 and 6, those saved studies use those nodes first. Counting CPU/cache groups alone can assign two ranks to the same memory resource. taskset can restrict the available CPU groups. Fresh studies use Open MPI’s mapping and binding instead of rebinding workers. Automatic placement uses --map-by numa --bind-to numa while RAM-backed CPU domains suffice, then --map-by l3cache --bind-to l3cache for additional CPU-only groups. Open MPI can reuse NUMA masks on memoryless topologies, so Warper probes the actual masks and rejects overlaps before application setup. Each rank must remain within a CPU NUMA domain and inside the allocated physical cores.

Fresh studies prefer nearby allowed RAM, balancing CPU-only groups after reserving ranks with local RAM. This allows memory-capacity fallback. Preferred memory requires libnuma and NUMA policy syscalls; Docker validation uses --cap-add SYS_NICE. The probe and effective settings are immutable on resume. Older studies keep their saved worker-affinity and ordinary-memory policies. The CLI log and GUI report each point’s effective --map-by, --bind-to, command, CPU masks and memory preferences.

The CLI and GUI retain every decomposition, repeat spread and coverage, and identify the fastest valid measured case per rank count after coverage closes. A budget stop leaves remaining cases pending. One paid binding probe per count is reused across its cases, with affinity checked again in every worker.

Explicitly labelled short screening studies use fewer timesteps and cannot supply final application results. The GUI labels screening horizons in its note, charts and case table. Saved schemas 1–3 retain their single-decomposition plans; schema 4 retains all paid cases and the complete immutable case list.

The study reports native runtime without setup, including application I/O. Fresh studies sum the non-overlapping timed sections per rank and report the largest rank total; section-wise maxima can mix different slow ranks and overcount overlapping work and waits. Receipts retain both aggregates and each rank’s total. The study reports median speedup, parallel efficiency and repeat spread. The source tuning session is read-only.

CPU sessions and studies resume with the ordinary --resume SESSION_ID command. Paid results are retained; a completed resume performs no new measurements. The calibrated count is saved and reused on resume. Older CPU sessions keep their fixed trial counts and saved joint or sequential search and warmup policy. Older scaling plans keep their recorded numeric domain order and section-wise timing policy; new plans also validate the saved socket and memory topology on incomplete resume. Keep the original code, dependencies, thread settings and allocation available for an incomplete session.

CPU-specific records include application/cpu.json, cpu/horizon.json, cpu/builds/, loop0/trials/trialNNNN/cpu-evidence.json, and summary/result.json. NUMA studies retain cpu-mpi/plan.json, per-point samples, cpu-mpi/result.json and cpu-mpi/scaling.csv. Optional profiling adds application/cpu-profiler.json and cpu/profiler/ for tuning, or a frozen cpu_profiler policy and profiler/ beneath each MPI case.

Back to top