Repository navigation
fix(pack): preserve HIP CuPy when installing Ray - #414
Conversation
Signed-off-by: thxCode <thxcode0824@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request removes the ray[cgraph] dependency from the ROCm Dockerfile to prevent CUDA CuPy from overwriting the base image's HIP CuPy, and adds a test to verify this dependency resolution. The feedback suggests specifying UTF-8 encoding and normalizing line endings when reading the Dockerfile in the test to avoid potential cross-platform compatibility issues.
| _wheel(tmp_path, "grpcio", "1.78.0") | ||
| _wheel(tmp_path, "colorful", "0.6.0") | ||
|
|
||
| recipe = (ROOT / "pack/rocm/Dockerfile.vllm").read_text() |
There was a problem hiding this comment.
Reading the Dockerfile without specifying an encoding can lead to UnicodeDecodeError on platforms where the default encoding is not UTF-8 (such as Windows), especially since the Dockerfile contains non-ASCII characters (like the em-dash —— on line 27). Additionally, parsing the file using split strings with \n will fail if the file is checked out with CRLF (\r\n) line endings. Specifying encoding="utf-8" and normalizing line endings resolves these cross-platform compatibility issues.
| recipe = (ROOT / "pack/rocm/Dockerfile.vllm").read_text() | |
| recipe = (ROOT / "pack/rocm/Dockerfile.vllm").read_text(encoding="utf-8").replace("\r\n", "\n") |
There was a problem hiding this comment.
Accepted the encoding part: forcing an ASCII locale reproduced two UnicodeDecodeError failures, and an explicit UTF-8 read makes both existing tests pass; the encoding fixup is now pushed as d9e69acd4cb95ea87fd0f7e765b9ae7f6c3885b0. The CRLF claim is a false positive: default text reads normalize newlines, and the same tests passed against a CRLF fixture under the ASCII locale without replace(), so that suggestion remains unimplemented for reviewer judgment.
Signed-off-by: thxCode <thxcode0824@gmail.com>
|
Review follow-up: read 1 top-level review, 1 inline thread, 0 ordinary PR comments, and 0 suppressed findings. The top-level review summarizes the same inline finding; the inline comment contains two independently verified claims.
Validation: both resolver cases passed under the forced ASCII locale, and both passed again against the CRLF Dockerfile fixture. Full pytest with the pinned auto-sync tools passed on macOS (1365 passed, 17 skipped); all-file hooks passed, and two No upgrade-compatibility findings or pending compatibility decisions were identified. This follow-up changes one test-file read. The fixup |
Pack run 41944899716 stopped at the final-image check because Ray installation added
cupy-cuda12xover the base image's HIP CuPy. Both distributions remained installed, andcupy.cuda.runtime.is_hipbecame false.Remove the
cgraphextra from the ROCm recipe while retaining Ray 2.54.0 and its client/default extras. In this pinned Ray version, cgraph's only dependency is CUDA CuPy; the graph code is included in the Ray wheel without selecting the extra. The base image continues to supply HIP CuPy. This applies to both ROCm runtime lines in the shared recipe.Add an offline dependency-resolution regression using reduced local wheel metadata and the recipe's actual requirements. It preserves the HIP distribution and client/default dependencies, and its negative case confirms that adding
cgraphreintroduces CUDA CuPy.Validation: the new regression failed against the original recipe and passed after the change. Full pytest with the pinned auto-sync tools passed on macOS (1365 passed, 17 skipped), including the 41 ROCm helper and resolver tests; all-file hooks, strict MkDocs, and Python distribution build passed. Dockerfile static checking could not finish because the local DockerHub credentials are expired, including when retried with a temporary anonymous configuration.
No rebuilt service image or GPU execution has been validated. After merge, a new Pack invocation must use the updated source revision; rerunning the original invocation retains its old recipe.
Relates #413.