Add TheRock PyTorch Dockerfile for MI300X - #511
Conversation
Signed-off-by: Essam Aly <essam.aly@amd.com>
| # Install the matching TheRock distribution over the public image's userspace | ||
| # ROCm stack. Keeping everything under one prefix prevents mixed /opt/rocm and | ||
| # /workspace/install link resolution. | ||
| RUN mkdir -p "${ROCM_PATH}" \ |
There was a problem hiding this comment.
why do we need this? The base docker comes with Rocm7.14 (rock) already. Please remove this
There was a problem hiding this comment.
You are correct. The base image already provides the matching ROCm 7.14 userspace stack, so downloading and overlaying another TheRock distribution is unnecessary and could result in mixed ROCm installations. I will remove the tarball installation and update the environment and build paths to use the ROCm stack from the base image.
| libgoogle-glog-dev libgtk2.0-dev libjpeg-dev libjsoncpp-dev \ | ||
| liblmdb-dev libomp-dev libpng-dev libsndfile1-dev libssl-dev \ | ||
| libswscale-dev libtbb-dev libtbbmalloc2 libtiff-dev libtool libva-dev \ | ||
| libva-drm2 make mesa-va-drivers nasm numactl perl pkg-config python3-dev \ |
There was a problem hiding this comment.
we should not install mesa-va-drivers anymore, comes with theRock
There was a problem hiding this comment.
Agreed. The base image already provides the VA driver through TheRock’s bundled system dependencies, so I removed mesa-va-drivers from the package installation.
| && cmake --build rapidjson/build -j"${BUILD_JOBS}" \ | ||
| && cmake --install rapidjson/build | ||
|
|
||
| RUN git clone --depth 1 --branch "${RPP_REF}" https://github.com/ROCm/rpp.git \ |
There was a problem hiding this comment.
wrong URL for RPP. Until we bump to rocm10.1, change this to use rocm-libraries
There was a problem hiding this comment.
Agreed. I updated the Dockerfile to clone ROCm/rocm-libraries and build RPP from projects/rpp instead of using the standalone ROCm/rpp repository.
| && cmake --install MIVisionX/build \ | ||
| && ldconfig | ||
|
|
||
| RUN git clone --depth 1 --branch "${ROCM_SYSTEMS_REF}" \ |
There was a problem hiding this comment.
why are you cloning and building rocJPEG/rocDecode? rocm7.14 already had rocJPEG in the Rock. Remove this section
There was a problem hiding this comment.
Agreed. I removed the rocJPEG and rocDecode source builds and now rely on the ROCm 7.14 components provided by the base image.
| && ldconfig | ||
|
|
||
| # Build optional diagnostic binaries while all source trees are available. | ||
| RUN cmake -S /workspace/rocm-systems/projects/rocjpeg/samples/jpegDecodePerf \ |
There was a problem hiding this comment.
do not build rocJPEG samples under a rocAL docker. We need this clean and bare minimum. Please remove
There was a problem hiding this comment.
Agreed. I removed the rocJPEG sample and jpegDecodePerf build to keep the rocAL image minimal.
| source /workspace/rocal_test_env.sh | ||
| fi | ||
|
|
||
| echo "===== Operating system =====" |
There was a problem hiding this comment.
please remove these extra steps to print environment setup. The dockerfile just needs to download the base docker and add the dependencies to build rocAL over it.
There was a problem hiding this comment.
Agreed. I removed the environment/version-reporting scripts and the additional diagnostic steps. The Dockerfile is now focused on installing the required dependencies and building rocAL.
| @@ -0,0 +1,278 @@ | |||
| # syntax=docker/dockerfile:1 | |||
There was a problem hiding this comment.
Please rename file to rocal-with-pytorch-therock. We do not need separate files fro each MI series
There was a problem hiding this comment.
Agreed. I renamed the file to rocal-with-pytorch-therock.dockerfile and removed the MI300-specific architecture default so it can be used across supported GPU series.
Motivation
Provide a reusable PyTorch and rocAL environment for testing on MI300X.
Technical Details
Adds a TheRock-based Dockerfile that builds rocAL and its dependencies.
The environment is application-independent and is not tied to a specific model.
Test Plan
Build the image, launch it with GPU access, and verify PyTorch GPU operations and rocAL imports.
Test Result
The image built and ran successfully on MI300X. PyTorch GPU operations and rocAL imports passed.