Repository navigation
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
Closed
mergify[bot] wants to merge 6 commits into
mergify[bot] wants to merge 6 commits into
Conversation
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
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.
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
changesqueue, to test #4857 and #4858 before they merged intomaster.🎉 What landed
Mergify merged each pull request into
masteron its own, then closed this draft:fb177a9d35a065This draft's code was built in this order:
masterat786b6d91106ed1Queued 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 ci1 scope
coreRequired conditions of queue rule
changesfor mergecheck-success = Conventional Commit titlecheck-success = Queue validationcheck-success = Verify workflow lockfiledepends-on=celox-sim/celox#4857[⛓️ perf(sv): lower the state modules of packages in parallel #4857 [stack]]depends-on = celox-sim/celox#4856[⛓️ celox-sim/celox#4856]number != 4857master]:check-success = @github-actions/Lint & Formatcheck-neutral = @github-actions/Lint & Formatcheck-skipped = @github-actions/Lint & Formatmaster]:check-success = @github-actions/Rust Test & NAPI Buildcheck-neutral = @github-actions/Rust Test & NAPI Buildcheck-skipped = @github-actions/Rust Test & NAPI Buildmaster]:check-success = @github-actions/JS Test (Ubuntu)check-neutral = @github-actions/JS Test (Ubuntu)check-skipped = @github-actions/JS Test (Ubuntu)master]:check-success = @github-actions/Conventional Commit titlecheck-neutral = @github-actions/Conventional Commit titlecheck-skipped = @github-actions/Conventional Commit titlemaster]:check-success = @github-actions/Queue validationcheck-neutral = @github-actions/Queue validationcheck-skipped = @github-actions/Queue validationmaster]:check-success = @github-actions/Verify workflow lockfilecheck-neutral = @github-actions/Verify workflow lockfilecheck-skipped = @github-actions/Verify workflow lockfileRequired conditions to stay in the queue
-conflict-draft-head ~= ^(integration/|renovate/veryl-crates$|upgrade/veryl-|release-please--branches--master--components--celox$|master$)-head ~= ^renovate/-label = release:holddepends-on=celox-sim/celox#4857[⛓️ perf(sv): lower the state modules of packages in parallel #4857 [stack]]base ~= ^(master|develop)$base ~= ^stack/body ~= (?m)^Depends-On:head != release-please--branches--master--components--celoxlabel = merge-readydepends-on = celox-sim/celox#4856[⛓️ celox-sim/celox#4856]number != 4857master]:check-success = @github-actions/Lint & Formatcheck-neutral = @github-actions/Lint & Formatcheck-skipped = @github-actions/Lint & Formatmaster]:check-success = @github-actions/Rust Test & NAPI Buildcheck-neutral = @github-actions/Rust Test & NAPI Buildcheck-skipped = @github-actions/Rust Test & NAPI Buildmaster]:check-success = @github-actions/JS Test (Ubuntu)check-neutral = @github-actions/JS Test (Ubuntu)check-skipped = @github-actions/JS Test (Ubuntu)master]:check-success = @github-actions/Conventional Commit titlecheck-neutral = @github-actions/Conventional Commit titlecheck-skipped = @github-actions/Conventional Commit titlemaster]:check-skipped = @github-actions/Queue validationcheck-neutral = @github-actions/Queue validationcheck-success = @github-actions/Queue validationmaster]:check-success = @github-actions/Verify workflow lockfilecheck-neutral = @github-actions/Verify workflow lockfilecheck-skipped = @github-actions/Verify workflow lockfile