Skip to content

[CI][ROCm] Make image dependencies cache-safe - #55093

Draft
AndreasKaratzas wants to merge 8 commits into
mainfrom
akaratza_deps_bugfix
Draft

AndreasKaratzas wants to merge 8 commits into
mainfrom
akaratza_deps_bugfix

Conversation

@AndreasKaratzas

@AndreasKaratzas AndreasKaratzas commented Sep 3, 2026

Copy link
Copy Markdown
Member

This PR makes ROCm image builds dependency-aware and makes their caches safer to reuse across CI and release jobs.

  • Add a generated ROCm source-build lock so test/runtime dependency churn does not invalidate base, csrc, or Rust builds.
  • Harden cache keys, manifests, forced refreshes, scoped writes, diagnostics, and digest-qualified image handoffs.
  • Fix dependency and ABI issues found during validation: pinned-source Decord, ABI-aware TorchCodec rebuilds, AITER's undeclared PyYAML runtime import, and LMCache's locked NumPy plus complete runtime roots.
  • Preserve native-build parallelism, pin AITER v0.1.21.post1 to its peeled commit with FlyDSL 0.3.2, checksum the ROCm Triton source, honor the configured Rust toolchain, and extend CI build triggers.
  • Keep credential-bearing SCCACHE_DOWNLOAD_URL values out of release BuildKit arguments and image history.
  • Explicitly install libdw1 in the final ROCm image so the copied profiler SDK remains loadable after Python-only installation cleanup.

Test Plan

Scope Validation
Static contracts Existing metadata pytest suite and all applicable pre-commit hooks
Cache protocol Offline fake-S3 matrix covering misses, corruption, force bypass, outages, interrupted writes, and concurrent writers
Images Earlier ROCm base, ci_base, full test and production-default final images with cache repeats, as supporting evidence
Runtime Offline package/PyYAML/import/linkage/native-payload checks plus one-GCD gfx90a Torch and AITER native-core/ABI imports
Commands run
.venv/bin/python -m pytest -q tests/tools/test_docker_build_metadata_args.py
mapfile -t pr_files < <(git diff --name-only "$(git merge-base origin/main HEAD)"..HEAD)
.venv/bin/pre-commit run --files "${pr_files[@]}"

The base and ci_base validation used the production refresh and Bake paths against an isolated local registry. Image results predate the dependency-naming/security follow-up and remain supporting evidence.

Test Result

Check Result
Existing metadata tests PASS — 13/13
Pre-commit and static validation PASS
Fake-S3 cache protocol PASS — 92/92
Earlier ROCm base PASS (supporting evidence) — offline package/PyYAML/import/linkage/native-payload and gfx90a Torch/AITER checks passed; repeat returned the same digest with zero BuildKit vertices
Earlier ci_base PASS (supporting evidence) — package/import/core-linkage and gfx90a checks passed; repeat returned immediately with zero BuildKit vertices
Earlier full test image PASS (supporting evidence) — package, import, linkage, artifact, and cache-repeat checks passed
Earlier production-default final image with LMCache PASS (supporting evidence) — uv/pip, runtime-root, import, native-linkage, and gfx90a core checks passed

The Python-only Installation failure in Buildkite build 12676 exposed an additional runtime dependency: purging the repository-setup packages left libdw1 eligible for the test's later apt autoremove, and Torch then failed to import libdw.so.1. The final image now installs libdw1 explicitly. For this follow-up, applicable pre-commit hooks, git diff --cached --check, and shell syntax validation passed; a controlled APT simulation using copied metadata confirmed that manual ownership preserves libdw1, with host package state unchanged. Cache review confirmed the Dockerfile change invalidates the base image identity. Rebuilt-image execution of the installation test remains unverified.

AI assistance was used for the dependency audit, validation, and drafting.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@mergify mergify Bot added ci/build rocm Related to AMD ROCm labels Sep 3, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Sep 3, 2026
@AndreasKaratzas
AndreasKaratzas marked this pull request as draft September 3, 2026 06:37
@AndreasKaratzas AndreasKaratzas changed the title [CI][ROCm] Pin base image Python dependencies [CI][ROCm] Lock CI image component dependencies Sep 3, 2026
@AndreasKaratzas
AndreasKaratzas force-pushed the akaratza_deps_bugfix branch 2 times, most recently from 2439b3a to 4665b84 Compare September 3, 2026 10:51
@AndreasKaratzas AndreasKaratzas changed the title [CI][ROCm] Lock CI image component dependencies [CI][ROCm] Make image dependencies cache-safe Sep 3, 2026
@mergify

mergify Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @AndreasKaratzas.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Sep 3, 2026
Comment thread .buildkite/scripts/rocm/refresh-base-image.sh
Comment thread docker/Dockerfile.rocm
Comment thread docker/Dockerfile.rocm Outdated
Comment thread tools/install_torchcodec_rocm.sh
Comment thread tools/install_torchcodec_rocm.sh Outdated
AndreasKaratzas and others added 3 commits September 4, 2026 19:34
Close mutable dependency resolution and cache-identity gaps in the ROCm base and CI image lineages, using the existing ROCm test lock as the shared constraint set.

Co-authored-by: OpenAI Codex <codex@openai.com>
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Separate source-build constraints from runtime and test dependencies while preserving native-build fanout.

Harden cache manifests, forced refreshes, scoped writes, and immutable release handoffs.

Repair Python, Decord, TorchCodec, and LMCache dependency validation, and keep credential-bearing download URLs out of release image history.

Co-authored-by: OpenAI Codex <noreply@openai.com>

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
Install PyYAML under the ROCm build constraints because AITER imports yaml at runtime but omits it from wheel metadata.

Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Integrate upstream through 874df93, including the Mamba padded-prompt state fix, while preserving the ROCm dependency and cache changes.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
@mergify mergify Bot removed the needs-rebase label Sep 4, 2026
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/amd-ci run

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite AMD CI #12647 for commit 01509d083644.

AndreasKaratzas and others added 2 commits September 5, 2026 05:47
Use the conventional ROCm build input/lock pair without changing package pins. Extract release base/wheel orchestration, preserve paired digest handoffs, and harden literal Bake values and sccache endpoint handling.

Validation: 59 focused pytest tests, 92 offline S3 checks, five real Bake parsing/replay checks, and applicable pre-commit hooks passed. Full images were not rebuilt for this follow-up.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/amd-ci run

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite AMD CI #12652 for commit d094e57118bd.

AndreasKaratzas added a commit that referenced this pull request Sep 7, 2026
Stack the existing regression coverage on the cache-safe image dependency
fixes. Cover build/cache contracts and isolated release orchestration, and
wire both suites into the CPU and AMD Buildkite metadata jobs.

Extracted unchanged from #55093; the completed stack has the same tree as
d094e57.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
Keep the cache, dependency, and release fixes in #55093. Restore the
existing Docker metadata suite and its Buildkite wiring to the merge-base
versions; move the added coverage and release suite to the child branch.

Validation: the 13 existing metadata tests and applicable pre-commit hooks
passed. The child branch restores these four files byte-for-byte.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
AndreasKaratzas added a commit that referenced this pull request Sep 7, 2026
Stack the existing regression coverage on the cache-safe image dependency
fixes. Cover build/cache contracts and isolated release orchestration, and
wire both suites into the CPU and AMD Buildkite metadata jobs.

Extracted unchanged from #55093; the completed stack has the same tree as
d094e57.

Co-authored-by: OpenAI Codex <noreply@openai.com>
Signed-off-by: Andreas Karatzas <akaratza@amd.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/amd-ci run

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite AMD CI #12676 for commit 1c212c77ca41.

…lation

Install libdw1 explicitly in the final ROCm image so apt autoremove
preserves the runtime dependency of the copied profiler SDK. This keeps
Torch importable during the existing Python-only installation test.

Assisted-by: OpenAI Codex
Signed-off-by: Andreas Karatzas <Andreas.Karatzas@amd.com>
@AndreasKaratzas

Copy link
Copy Markdown
Member Author

/amd-ci run

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite AMD CI #12698 for commit 50990b54cafa.

@mergify

mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @AndreasKaratzas.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants