Skip to content

merge queue: merged #4857, #4858: perf(sv): lower the state modules of packages in parallel (+1 more) - #4860

Closed
mergify[bot] wants to merge 6 commits into
masterfrom
mergify/merge-queue/a34d3b4ac5
Closed

mergify[bot] wants to merge 6 commits into
masterfrom
mergify/merge-queue/a34d3b4ac5

Conversation

@mergify

@mergify mergify Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Note

This is a merge queue draft opened by Mergify. Its pull requests have merged, and nobody needs to act on it.
Mergify opened it for batch firm-saintemaure-ak0yg1 of the changes queue, to test #4857 and #4858 before they merged into master.

🎉 What landed

Mergify merged each pull request into master on its own, then closed this draft:

  • #4857 perf(sv): lower the state modules of packages in parallel (tignear), as fb177a9
  • #4858 perf(sv): lower the specialized modules in parallel (tignear), as d35a065

This draft's code was built in this order:

  1. master at 786b6d9
  2. the pull request queued ahead of this batch, listed below, which brought the tip to 1106ed1
  3. #4857 + #4858, the pull requests of this batch, tested together as one tip

Queued ahead of this batch

This pull request entered the queue before this batch and is not part of it.

Metadata for CI tooling, read by mergify ci
---
all_scopes: false
checking_base_sha: 1106ed1aa0fca2d636d5f33858224a9c78fcce2d
previous_check_retries: []
previous_failed_batches: []
pull_requests:
  - number: 4857
    scopes:
      - core
  - number: 4858
    scopes:
      - core
queue_base_sha: 786b6d9d7abc7c47241fc3e55b94a1dbe0fa2c4f
scopes:
  - core
...
1 scope
  • core
Required conditions of queue rule changes for merge
Required conditions to stay in the queue

tignear and others added 6 commits November 28, 2026 22:58
Each package state module is lowered by a task that owns its module and
returns its warnings, the lines of its recursion report and its result;
`lower_package_states` passes them on in the order of the modules, up to the
first that fails, as the loop that lowered them one after another did. The
tasks still run one after another on the calling thread.

The ordered task runner of the native backend (`compile_resources::
compile_tasks_with`) moves to `celox_frontend_core::tasks`, so that the
frontend can use it too, with `run_owned` for tasks that own their input.
Its worker threads now log through the caller's tracing dispatcher and get
an 8 MiB stack, as the main thread has. No change in output.

VeeR-EL2 (heliodor-dev): instructions:u 1197.11 / 1197.04 G -> 1197.10 G;
its simulation executes 12740.84 M -> 12741.64 M instructions (+0.006%),
the layout of the host binary after the runner moved between crates (the
same with the runner's threads set up as before).

Change-Id: Iba2b12367a0c9f2f5388d1dceee72b67caf56fb0
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
The specializations still to lower are prepared one after another in the
order of the modules, which may analyze one (`prepare_specialization`: the
only step that uses the design), and then lowered on up to
`compile_workers` threads, the largest first (`lower_specialization`).
Each lowering keeps its warnings; they and the modules are passed on in
the order of the modules, up to the first that fails, as lowering them one
after another did.

AVIP axi4_base_test (nocb copy, heliodor-dev, 16 cores, quiet lock),
master -> the stack tip, two runs each: `specialize_modules` 6.1 / 5.7 s ->
2.4 / 2.6 s (bounded by hvl_top, ~2.4 s); with the package states of the
commit before, wall 1:24.6 / 1:24.1 -> 1:13.3 / 1:13.0 (-13%); peak RSS
10.90 / 10.96 GB -> 10.93 / 11.03 GB; 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: If495923592bd5fedd86d546274efa7c78f1a1f63
@mergify mergify Bot changed the title merge queue: checking #4857 + #4858 together on master (786b6d9), stacked on #4856 merge queue: merged #4857, #4858: perf(sv): lower the state modules of packages in parallel (+1 more) Nov 28, 2026
@mergify mergify Bot closed this Nov 28, 2026
@mergify
mergify Bot deleted the mergify/merge-queue/a34d3b4ac5 branch November 28, 2026 14:47
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