[ROCm][CI] pass merge-base to container for python-only wheel metadata (#45869)
Signed-off-by: Divakar Verma <divakar.verma@amd.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
co-authored by
Andreas Karatzas
parent
275b43183c
commit
568874fec2
@@ -367,6 +367,20 @@ remove_docker_container() {
|
||||
}
|
||||
trap remove_docker_container EXIT
|
||||
|
||||
# python_only_compile.sh runs `python setup.py develop` and needs the full repo tree
|
||||
# under /vllm-workspace (Dockerfile.rocm test stage: mkdir src && mv vllm).
|
||||
# The ROCm wheel artifact tarball only ships a thin tree (tests, etc.), so
|
||||
# artifact images cannot satisfy that test — use the full rocm/vllm-ci image.
|
||||
_cmd_probe="${VLLM_TEST_COMMANDS:-}"
|
||||
if [[ -z "${_cmd_probe}" ]]; then
|
||||
_cmd_probe="$*"
|
||||
fi
|
||||
if [[ "${VLLM_CI_USE_ARTIFACTS:-0}" == "1" && "${_cmd_probe}" == *python_only_compile.sh* ]]; then
|
||||
echo "INFO: disabling VLLM_CI_USE_ARTIFACTS for python_only_compile (requires full /vllm-workspace tree)"
|
||||
export VLLM_CI_USE_ARTIFACTS=0
|
||||
fi
|
||||
unset -v _cmd_probe
|
||||
|
||||
if ! prepare_artifact_image; then
|
||||
echo "Using full ROCm CI image: ${image_name}"
|
||||
docker pull "${image_name}" || exit 1
|
||||
@@ -426,6 +440,24 @@ fi
|
||||
|
||||
echo "Final commands: $commands"
|
||||
|
||||
# The ROCm test image often ships /vllm-workspace without .git (artifact tarball unpack).
|
||||
# tests/standalone_tests/python_only_compile.sh uses merge-base(HEAD, origin/main) for
|
||||
# wheels.vllm.ai; compute on the agent (full git checkout) and pass into the container.
|
||||
vllm_standalone_merge_base=""
|
||||
checkout="${BUILDKITE_BUILD_CHECKOUT_PATH:-}"
|
||||
if [[ -z "${checkout}" || ! -d "${checkout}" ]]; then
|
||||
checkout="."
|
||||
fi
|
||||
if git -C "${checkout}" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
vllm_standalone_merge_base="$(
|
||||
git -C "${checkout}" merge-base HEAD origin/main 2>/dev/null || true
|
||||
)"
|
||||
fi
|
||||
if [[ -z "${vllm_standalone_merge_base}" ]]; then
|
||||
vllm_standalone_merge_base="${BUILDKITE_COMMIT:-}"
|
||||
fi
|
||||
echo "INFO: passing VLLM_STANDALONE_MERGE_BASE into container: ${vllm_standalone_merge_base}"
|
||||
|
||||
MYPYTHONPATH="/vllm-workspace"
|
||||
|
||||
container_job_id="${BUILDKITE_JOB_ID:-${BUILDKITE_PARALLEL_JOB:-0}}"
|
||||
@@ -525,6 +557,7 @@ else
|
||||
-e "VLLM_CACHE_ROOT=${CONTAINER_CACHE_ROOT}/vllm" \
|
||||
-e "XDG_CACHE_HOME=${CONTAINER_CACHE_ROOT}/xdg" \
|
||||
-e "PYTORCH_ROCM_ARCH=" \
|
||||
-e "VLLM_STANDALONE_MERGE_BASE=${vllm_standalone_merge_base}" \
|
||||
--name "${container_name}" \
|
||||
"${image_name}" \
|
||||
/bin/bash -c "${CONTAINER_PREFLIGHT} && ${commands}"
|
||||
|
||||
@@ -262,6 +262,16 @@ steps:
|
||||
- setup.py
|
||||
commands:
|
||||
- bash standalone_tests/python_only_compile.sh
|
||||
mirror:
|
||||
amd:
|
||||
device: mi325_1
|
||||
timeout_in_minutes: 20
|
||||
depends_on:
|
||||
- image-build-amd
|
||||
source_file_dependencies:
|
||||
- tests/standalone_tests/python_only_compile.sh
|
||||
- setup.py
|
||||
- vllm/platforms/rocm.py
|
||||
|
||||
- label: Async Engine, Inputs, Utils, Worker
|
||||
device: h200_35gb
|
||||
|
||||
@@ -4,9 +4,26 @@
|
||||
|
||||
set -e
|
||||
|
||||
merge_base_commit=$(git merge-base HEAD origin/main)
|
||||
# ROCm CI runs this script inside `run-amd-test.sh` where /vllm-workspace often has no .git
|
||||
# (wheel artifact layout). The wrapper passes VLLM_STANDALONE_MERGE_BASE from the agent checkout.
|
||||
merge_base_commit=""
|
||||
if [[ -n "${VLLM_STANDALONE_MERGE_BASE:-}" ]]; then
|
||||
merge_base_commit="${VLLM_STANDALONE_MERGE_BASE}"
|
||||
elif merge_base_commit="$(git -C /vllm-workspace merge-base HEAD origin/main 2>/dev/null)"; then
|
||||
:
|
||||
elif merge_base_commit="$(git merge-base HEAD origin/main 2>/dev/null)"; then
|
||||
:
|
||||
else
|
||||
echo "ERROR: need a git checkout or VLLM_STANDALONE_MERGE_BASE to resolve wheels.vllm.ai commit." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "INFO: current merge base commit with main: $merge_base_commit"
|
||||
git show --oneline -s "$merge_base_commit"
|
||||
if git show --oneline -s "$merge_base_commit" 2>/dev/null; then
|
||||
:
|
||||
else
|
||||
echo "INFO: git show unavailable in this environment; using SHA above for precompiled metadata."
|
||||
fi
|
||||
|
||||
# test whether the metadata.json url is valid, retry each 3 minutes up to 5 times
|
||||
# this avoids cumbersome error messages & manual retries in case the precompiled wheel
|
||||
@@ -59,7 +76,12 @@ cd /vllm-workspace/
|
||||
# uninstall vllm
|
||||
pip3 uninstall -y vllm
|
||||
# restore the original files
|
||||
mv src/vllm ./vllm
|
||||
if [[ -d src/vllm ]]; then
|
||||
mv src/vllm ./vllm
|
||||
elif [[ ! -d vllm ]]; then
|
||||
echo "ERROR: expected vllm package at /vllm-workspace/src/vllm or /vllm-workspace/vllm" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# remove all compilers
|
||||
apt remove --purge build-essential -y
|
||||
@@ -67,7 +89,14 @@ apt autoremove -y
|
||||
|
||||
echo 'import os; os.system("touch /tmp/changed.file")' >> vllm/__init__.py
|
||||
|
||||
VLLM_PRECOMPILED_WHEEL_COMMIT=$merge_base_commit VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
|
||||
# ROCm CI uses setuptools develop for editable installs (see Dockerfile.rocm and run-amd-test.sh).
|
||||
_vllm_target_lower="$(printf '%s' "${VLLM_TARGET_DEVICE:-}" | tr '[:upper:]' '[:lower:]')"
|
||||
if [[ "${_vllm_target_lower}" == "rocm" ]]; then
|
||||
VLLM_PRECOMPILED_WHEEL_COMMIT=$merge_base_commit VLLM_USE_PRECOMPILED=1 python3 setup.py develop
|
||||
else
|
||||
VLLM_PRECOMPILED_WHEEL_COMMIT=$merge_base_commit VLLM_USE_PRECOMPILED=1 pip3 install -vvv -e .
|
||||
fi
|
||||
unset -v _vllm_target_lower
|
||||
# Run the script
|
||||
python3 -c 'import vllm'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user