adds docker for therock with asan enabled#144
Conversation
a47d7c0 to
35b0771
Compare
…ired for hipruntime
There was a problem hiding this comment.
Pull request overview
Adds a new Docker image variant intended for debugging host-side HIP/ROCm issues with AddressSanitizer enabled via TheRock, and exposes it through the existing Docker env selection flow.
Changes:
- Adds
Dockerfile.therock-host-asan-pytorchto build TheRock with HOST_ASAN and then build PyTorch against that stack. - Extends
docker/setup-env.shto allow selecting the new Dockerfile (choice5). - Documents the new Dockerfile option in
docker/.env.example.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| docker/setup-env.sh | Adds interactive selection entry for the new TheRock HOST_ASAN + PyTorch Dockerfile. |
| docker/Dockerfile.therock-host-asan-pytorch | New Dockerfile that builds TheRock with HOST_ASAN and builds PyTorch from source against it. |
| docker/.env.example | Adds the new Dockerfile option and brief description to the env template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RUN git clone --branch ${THEROCK_GIT_REF} --single-branch \ | ||
| https://github.com/ROCm/TheRock.git |
There was a problem hiding this comment.
git clone --branch ${THEROCK_GIT_REF} only supports branches/tags. If you want to support commit SHAs for reproducible builds, clone without --branch (or fetch) and git checkout the SHA explicitly.
| RUN git clone --branch ${THEROCK_GIT_REF} --single-branch \ | |
| https://github.com/ROCm/TheRock.git | |
| RUN git clone https://github.com/ROCm/TheRock.git && \ | |
| cd TheRock && \ | |
| git checkout ${THEROCK_GIT_REF} |
There was a problem hiding this comment.
Thanks for flagging this. I am keeping git clone --branch ${THEROCK_GIT_REF} --single-branch --depth 1 as-is: THEROCK_GIT_REF is documented (and enforced in THEROCK_ASAN_BUILD_ISSUES.md) to be a release tag that must match THEROCK_TARBALL_VERSION for ABI compatibility, so an arbitrary commit SHA is intentionally out of scope, and the shallow single-branch clone is a deliberate build-time optimization a SHA checkout would lose. Happy to revisit if we ever need SHA-pinned ASAN builds.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…eed_gpu, doc+README fixes (#144) Co-authored-by: Cursor <cursoragent@cursor.com>
…RARY_PATH under set -u, use overlay-dir var in messages, readelf over ldd, non-empty BASE_IMAGE default (#144) Co-authored-by: Cursor <cursoragent@cursor.com>
| RUN apt-get update && apt-get install -y \ | ||
| build-essential \ | ||
| gfortran \ | ||
| git \ | ||
| ninja-build \ |
There was a problem hiding this comment.
Thanks for flagging this. I am keeping it as-is: the cmake --preset invocation runs inside . .venv/bin/activate (line 219), and cmake is provided by TheRock requirements.txt installed into that venv at line 197 (pip install -r requirements.txt), so a system cmake is not needed for the TheRock ASAN build. The Kitware system cmake added later (line 314) is only for the separate PyTorch build stage, which is why the initial apt layer intentionally omits cmake. Happy to add a one-line comment there if it helps future readers.
| RUN cmake --install build-asan --prefix /tmp/rocm-asan-full && \ | ||
| mkdir -p /opt/rocm-asan/lib && \ | ||
| for lib in libamdhip64 libhsa-runtime64 libhsakmt libamd_comgr; do \ | ||
| find /tmp/rocm-asan-full/lib -name "${lib}.so*" -exec cp -a {} /opt/rocm-asan/lib/ \; ; \ | ||
| done && \ | ||
| rm -rf /tmp/rocm-asan-full |
| NORMAL_HIP="$ROCM/lib/libamdhip64.so" | ||
| if [ -f "$NORMAL_HIP" ]; then | ||
| if nm -D "$NORMAL_HIP" 2>/dev/null | grep -q '__asan_'; then | ||
| check "Normal libamdhip64.so is NOT ASAN-instrumented" "fail" | ||
| else | ||
| check "Normal libamdhip64.so is NOT ASAN-instrumented" "pass" | ||
| fi | ||
| fi |
adds docker for therock with asan enabled