Skip to content

AZP/TESTS: Build once per GPU test row and share the tree with the workers - #11896

Merged
gleon99 merged 1 commit into
openucx:masterfrom
Alexey-Rivkin:ci-prebuild-gpu-tests
Oct 20, 2026
Merged

gleon99 merged 1 commit into
openucx:masterfrom
Alexey-Rivkin:ci-prebuild-gpu-tests

Conversation

@Alexey-Rivkin

@Alexey-Rivkin Alexey-Rivkin commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

What?

Build UCX once per GPU test row and share the tree with its 4 workers.

Why?

Each worker rebuilds the same tree, and that build is 15-40% of every GPU job. The GPU pool is the pipeline's bottleneck.

How?

  • tests.yml: new prebuild option adds a build job that publishes build-test + install as an artifact; workers download it and skip the build. Enabled for Tests/gpu and AddressSanitizer/gpu.
  • test_jenkins.sh: workers stamp the extracted tree with one timestamp so make rebuilds nothing, and fail early if the tree was built at a different workspace path.
  • Container rows only: the tree holds absolute paths, and the container workspace path is the same on every agent.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread contrib/test_jenkins.sh Resolved
Comment thread buildlib/pr/tests.yml Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

contrib/test_jenkins.sh

With prebuild set, run_mpi_tests and run_configure_tests now run only in the build job, not on each worker. Can you confirm this is intended and that losing the per-worker repetition is fine?

Portability assumption: the build tree holds absolute paths and relies on the container workspace path being identical on every agent (rpaths, --prefix=${WORKSPACE}/install, ucx_inst references). This is documented, which is good, but it is load-bearing — if agents ever differ in workspace mount path this silently breaks. Consider a note in the PR description or a guard that fails early if the extracted install prefix does not match the current WORKSPACE.

Residual coverage gap: there is no dry-run/CI evidence in the diff that the prebuilt artifact is byte-consistent with a fresh build on a different agent. The PR should show a green run of the affected lanes (GPU tests and centos8 ASAN) to demonstrate the prebuild path actually reuses the tree without triggering a rebuild.

Alexey-Rivkin added a commit to Alexey-Rivkin/ucx that referenced this pull request Sep 3, 2026
BUILD_ONLY_TARBALL runs the mpi and configure tests plus the devel build
(or the ASAN build), packs build-test and install into the named tarball
and exits. PREBUILT_TARBALL extracts that tarball over a fresh checkout
with tar -m, so make sees the objects as newer than the sources and the
worker skips its own build. Everything else in the flow is unchanged.

This is the same script change as openucx#11896, carried here so the DL cluster
job can build once per allocation without waiting on merge order. Whichever
lands second rebases to an empty diff on this file.

Signed-off-by: Alexey Rivkin <arivkin@nvidia.com>
@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread contrib/test_jenkins.sh Resolved
Comment thread contrib/test_jenkins.sh Resolved
Comment thread buildlib/pr/tests.yml Resolved
Comment thread buildlib/pr/tests.yml Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

Residual coverage gap worth noting: nothing here validates that a worker actually reuses the extracted tree without rebuilding. tar -m stamps every extracted file with the extraction time, but tar stores files in directory-traversal order, so a target archived before its prerequisite ends up older and gets relinked — green runs of the Tests/gpu and AddressSanitizer/gpu lanes with build-step timings would show whether the reuse is real.

@Alexey-Rivkin

Alexey-Rivkin commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

With prebuild set, run_mpi_tests and run_configure_tests now run only in the build job, not on each worker.

Yes, intended. MPI tests do not run on the GPU rows (mpirun not found in the container), so this only moves the configure tests, which every worker repeated. They now run once.

@Alexey-Rivkin

Copy link
Copy Markdown
Contributor Author

Portability assumption: the build tree holds absolute paths and relies on the container workspace path being identical on every agent

Added a guard: the build job records its workspace path, and workers fail early if theirs differs.

…rkers

Every worker of a test row rebuilds UCX from scratch before running its
share of the tests, so the GPU rows build the same tree four times per
build (five with the ASAN row). On the GPU pool, which is 100% booked and
the longest queue in the pipeline, that build is 15-40% of each job.

Add an optional prebuild job to tests.yml: it builds once, tars build-test
and install into a pipeline artifact, and the four workers download it and
skip the build. The workers give the extracted tree a single timestamp,
newer than the fresh checkout, so make does not rebuild or relink any of it.
Only container rows can use this, since the build tree holds absolute paths
and the container workspace path is the same on every agent; the workers
fail early if the tree was built at a different path. Enable it for the two
GPU rows.

Signed-off-by: Alexey Rivkin <arivkin@nvidia.com>
@Alexey-Rivkin

Copy link
Copy Markdown
Contributor Author

tar -m stamps every extracted file with the extraction time, but tar stores files in directory-traversal order, so a target archived before its prerequisite ends up older and gets relinked

Good catch, reproduced it. Now the whole tree gets one timestamp after extraction, so nothing is rebuilt.

@svc-nvidia-pr-review

Copy link
Copy Markdown

🤖 Starting review — findings will be posted here when done.

Comment thread buildlib/pr/tests.yml Resolved
Comment thread buildlib/pr/tests.yml Resolved
@svc-nvidia-pr-review

Copy link
Copy Markdown

contrib/test_jenkins.sh

minor: can we compress the build-only artifact, e.g. tar -I 'zstd -3' -cf? the build tree plus install dir is large (gtest with debug info/ASAN) and every one of the 4 matrix workers downloads it. (line: tar -cf "$BUILD_ONLY_TARBALL" -C ${WORKSPACE} build-test install)

@Alexey-Rivkin

Copy link
Copy Markdown
Contributor Author

minor: can we compress the build-only artifact, e.g. tar -I 'zstd -3' -cf?

Azure artifacts already compress it: the 1438 MB tar went over the wire as 377 MB, upload 1.1 min, download 0.7 min. Also no zstd in the Ubuntu image. Leaving as is.

@Alexey-Rivkin

Copy link
Copy Markdown
Contributor Author

nothing here validates that a worker actually reuses the extracted tree without rebuilding

Confirmed on run 138786: a worker on gpu-01 used the tree built on gpu-02, compiled nothing, and started tests 23 s into the step.

@Alexey-Rivkin
Alexey-Rivkin marked this pull request as ready for review October 12, 2026 13:43
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.

4 participants