Build pecos-stab-tn at opt-level 2 in dev and test profiles like the other simulation crates - #709
Open
ciaranra wants to merge 1 commit into
Open
Build pecos-stab-tn at opt-level 2 in dev and test profiles like the other simulation crates#709ciaranra wants to merge 1 commit into
ciaranra wants to merge 1 commit into
Conversation
…other simulation crates
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.
Why
After #683/#684 the PR gate's critical path is
pr-core-rust, and inside it the workspace test phase: 2486 CPU-seconds of test work on a 4-core runner, ~10.4 min however it is scheduled (a nextest trial, #698, confirmed the phase is CPU-bound, not serialization-bound). The two largest contributors are the surface-code LER equivalence test and thepecos-stab-tntest binaries. The rootCargo.tomlalready builds the simulation crates atopt-level = 2in dev/test builds for exactly this reason, butpecos-stab-tnwas not on the list, so its tensor-network code ran unoptimized under test.Measured locally (14 cores):
pecos-stab-tnlib tests (352)pecos-stab-tntest targets (lib, verification, exact_default_measurement)Also tried
[profile.dev.package."*"] opt-level = 2for every external dependency: no further gain on stab-tn, 6% on the LER test, and every dependency recompiles slower. Not taken.What
One entry in the existing
[profile.dev.package.*]block plus a comment with the numbers.profile.testinherits the per-package overrides (verified by reading the rustc invocations:-C opt-level=2for the listed crates incargo testbuilds). Debug assertions stay on. Crates that depend onpecos-stab-tn(the stab-mps and mast Selene plugins, pecos-rslib-exp, benchmarks) get the optimized crate in their debug builds.Verification
cargo test --locked -p pecos-stab-tnwith the change: lib 352 passed / 8 ignored, verification 95 passed / 9 ignored, exact_default_measurement 9 passed / 20 ignored; 46 s wall including the 37 s compile.Cargo.toml: clean.pr-core-rust17 min end to end, down from 25 min on the previous warm-cache run and ~30 min before Cut ~20 min of wasted native builds from the Python CI lanes and make the PR-gate Rust caches restorable #683. Workspace test phase 5.1 min (per-binary times sum to 284 s, was 656 s; longest binary is now the LER test at 191 s), follow-up phases 1.6 min, compile 6.6 min.