Skip to content

ROCm pytorch: reduce peak disk during uv/torch install in Dockerfile #2493

Description

@jiridanek

Parent: #2491

Idea

ROCm pytorch images are the largest matrix builds. Peak disk during uv pip install + de-vendor-torch.sh may hit 100% before the build finishes — pruning after success does not help.

Approach

In jupyter/rocm/pytorch/ubi9-python-3.12/Dockerfile.konflux.rocm and runtimes/rocm-pytorch/ubi9-python-3.12/Dockerfile.konflux.rocm:

  • Delete pip/uv cache in the same RUN layer as install (rm -rf /root/.cache/uv)
  • Remove torch vendored ROCm blobs before de-vendor-torch.sh symlinks system libs (script already rm -rfs rocblas/hipblaslt dirs — ensure ordering minimizes peak usage)
  • Strip unnecessary artifacts where safe (__pycache__, static .a in site-packages if not needed at runtime)

Compare with green rocm-jupyter-tensorflow Dockerfile for patterns that keep peak disk lower.

Out of scope

Acceptance criteria

  • make rocm-jupyter-pytorch-ubi9-python-3.12 completes on GHA amd64 without ENOSPC
  • make rocm-runtime-pytorch-ubi9-python-3.12 same
  • Image tests and check-payload still pass on the built image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions