Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: update rustc-perf version used in CI and also the corresponding PGO benchmarks #95724

Merged
merged 1 commit into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
RUN ./build-clang.sh
ENV CC=clang CXX=clang++

ENV PERF_COMMIT 1e19fc4c6168d2f7596e512f42f358f245d8f09d
# rustc-perf version from 2022-04-05
ENV PERF_COMMIT 04fccd80396f954b339c366e30221f4bd52c5e03
RUN curl -LS -o perf.zip https://github.com/rust-lang/rustc-perf/archive/$PERF_COMMIT.zip && \
unzip perf.zip && \
mv rustc-perf-$PERF_COMMIT rustc-perf && \
Expand Down
19 changes: 12 additions & 7 deletions src/ci/pgo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
set -euxo pipefail

# Compile several crates to gather execution PGO profiles.
# Arg0 => builds (Debug, Opt)
# Arg1 => runs (Full, IncrFull, All)
# Arg0 => profiles (Debug, Opt)
# Arg1 => scenarios (Full, IncrFull, All)
# Arg2 => crates (syn, cargo, ...)
gather_profiles () {
cd /checkout/obj
Expand All @@ -27,10 +27,10 @@ gather_profiles () {
profile_local \
eprintln \
/checkout/obj/build/$PGO_HOST/stage2/bin/rustc \
Test \
--builds $1 \
--id Test \
--profiles $1 \
--cargo /checkout/obj/build/$PGO_HOST/stage0/bin/cargo \
--runs $2 \
--scenarios $2 \
--include $3

cd /checkout/obj
Expand Down Expand Up @@ -64,7 +64,10 @@ RUSTC=/checkout/obj/build/$PGO_HOST/stage0/bin/rustc \
RUSTC_BOOTSTRAP=1 \
/checkout/obj/build/$PGO_HOST/stage0/bin/cargo build -p collector

gather_profiles "Debug,Opt" "Full" "syn,cargo,serde,ripgrep,regex,clap-rs,hyper-2"
# Here we're profiling LLVM, so we only care about `Debug` and `Opt`, because we want to stress
# codegen. We also profile some of the most prolific crates.
gather_profiles "Debug,Opt" "Full" \
"syn-1.0.89,cargo-0.60.0,serde-1.0.136,ripgrep-13.0.0,regex-1.5.5,clap-3.1.6,hyper-0.14.18"

# Merge the profile data we gathered for LLVM
# Note that this uses the profdata from the clang we used to build LLVM,
Expand All @@ -83,8 +86,10 @@ python3 ../x.py build --target=$PGO_HOST --host=$PGO_HOST \
--stage 2 library/std \
--rust-profile-generate=/tmp/rustc-pgo

# Here we're profiling the `rustc` frontend, so we also include `Check`.
# The benchmark set includes various stress tests that put the frontend under pressure.
gather_profiles "Check,Debug,Opt" "All" \
"externs,ctfe-stress-4,inflate,cargo,token-stream-stress,match-stress-enum"
"externs,ctfe-stress-4,cargo-0.60.0,token-stream-stress,match-stress,tuple-stress"
Kobzol marked this conversation as resolved.
Show resolved Hide resolved

# Merge the profile data we gathered
./build/$PGO_HOST/llvm/bin/llvm-profdata \
Expand Down