Repository navigation
perf(sv): lower the state modules of packages in parallel - #4857
Merged
mergify[bot] merged 1 commit intoNov 28, 2026
Conversation
The state modules of the packages are lowered on up to `compile_workers` threads (`ParallelScheduleOptions`), the largest first, and what they give is passed on in their order as before, so the result is the same for every thread count. A UVM design has one per package, each with thousands of subroutines. The count comes from the new `compile_threads` option (`SimulatorBuilder::compile_threads`, NAPI/TS `compileThreads`, `celox run --compile-threads`), which defaults to the available parallelism and is not the simulation `threads`. It is one budget for compiling: native code generation takes its workers within it too (`compile_resources`, the lane kernels), still at most four and as its memory budget allows. One thread compiles everything on the calling thread. `opt_level`, `optimize` and `optimize_options` keep a count set before them, as they keep the lanes. A test lowers six packages and four module specializations at 1, 2, 4 and 16 threads and compares the SIR, the warnings and the recursion report. AVIP axi4_base_test (nocb copy, heliodor-dev, 16 cores, quiet lock), this commit alone at 16 threads: the `packages` phase 10.9 s -> 4.4 s, wall 1:22.9 -> 1:17.0. With the next commit, master -> tip, two runs each: - wall 1:24.6 / 1:24.1 -> 1:13.3 / 1:13.0 (-13%) - `packages` 11.8 / 11.8 s -> 4.2 / 4.5 s; `specialize_modules` 6.1 / 5.7 s -> 2.4 / 2.6 s; sv_frontend 63.7 / 63.3 s -> 53.1 / 53.7 s - CPU 129.5 / 128.4 s -> 137.2 / 137.0 s; instructions:u 988.7 / 992.4 G -> 1009.1 / 1018.4 G - peak RSS 10.90 / 10.96 GB -> 10.93 / 11.03 GB; 10.73 GB at 4 threads, 10.96 GB at 8, 9.05 GB at 1 (native code generation on one worker) - stdout identical to master at 1, 4, 8 and 16 threads Gates (heliodor-dev, master ee408c1 -> the stack tip at the default 16 compile threads): - the UVM cases give output identical to master: 18.10 instructions:u 182.2 -> 182.6 G, 16.10 245.4 -> 247.1 G, uvm_scoreboard_env 287.2 -> 289.0 G; the 16.9 elaboration exits 0 (183.8 -> 185.5 G); - VeeR-EL2: compile 91.7 / 92.5 s -> 89.3 / 89.5 s; instructions:u 1197.11 / 1197.04 G -> 1198.64 / 1198.64 G (+0.13%, the thread overhead: 1197.02 G with --compile-threads 1). Its simulation executes 12740.84 M -> 12741.64 M instructions (+0.006%) at 1 and at 16 threads alike, from the first commit of the stack on, which only moves the task runner between crates: the layout of the host binary, not the generated code. Change-Id: I3c8a40603fbb829a8fcc81728424963c925d0efa
Contributor
Author
|
This pull request is part of a Mergify stack:
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
Queue requested — the merge queue status continues in this comment ↓. |
Contributor
✅ Merged into
|
Base automatically changed from
stack/tignear/perf/sv-parallel-lowering/lower-pkg-state-modules-self-contained-tasks--ba2b1236
to
master
November 28, 2026 14:39
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.
The state modules of the packages are lowered on up to
compile_workersthreads (
ParallelScheduleOptions), the largest first, and what they giveis passed on in their order as before, so the result is the same for every
thread count. A UVM design has one per package, each with thousands of
subroutines.
The count comes from the new
compile_threadsoption(
SimulatorBuilder::compile_threads, NAPI/TScompileThreads,celox run --compile-threads), which defaults to the available parallelism and isnot the simulation
threads. It is one budget for compiling: native codegeneration takes its workers within it too (
compile_resources, the lanekernels), still at most four and as its memory budget allows. One thread
compiles everything on the calling thread.
opt_level,optimizeandoptimize_optionskeep a count set before them, as they keep the lanes.A test lowers six packages and four module specializations at 1, 2, 4
and 16 threads and compares the SIR, the warnings and the recursion
report.
AVIP axi4_base_test (nocb copy, heliodor-dev, 16 cores, quiet lock), this
commit alone at 16 threads: the
packagesphase 10.9 s -> 4.4 s, wall1:22.9 -> 1:17.0. With the next commit, master -> tip, two runs each:
packages11.8 / 11.8 s -> 4.2 / 4.5 s;specialize_modules6.1 / 5.7 s-> 2.4 / 2.6 s; sv_frontend 63.7 / 63.3 s -> 53.1 / 53.7 s
1009.1 / 1018.4 G
10.96 GB at 8, 9.05 GB at 1 (native code generation on one worker)
Gates (heliodor-dev, master ee408c1 -> the stack tip at the default 16
compile threads):
182.2 -> 182.6 G, 16.10 245.4 -> 247.1 G, uvm_scoreboard_env 287.2 ->
289.0 G; the 16.9 elaboration exits 0 (183.8 -> 185.5 G);
1197.11 / 1197.04 G -> 1198.64 / 1198.64 G (+0.13%, the thread
overhead: 1197.02 G with --compile-threads 1). Its simulation executes
12740.84 M -> 12741.64 M instructions (+0.006%) at 1 and at 16 threads
alike, from the first commit of the stack on, which only moves the task
runner between crates: the layout of the host binary, not the generated
code.
Depends-On: #4856