Clean up AMD CI (#6365)

This commit is contained in:
Sai Enduri
2025-05-18 01:17:28 -07:00
committed by GitHub
parent 11553c1a37
commit c47a51db7e
5 changed files with 150 additions and 246 deletions

37
scripts/amd_ci_exec.sh Executable file
View File

@@ -0,0 +1,37 @@
#!/bin/bash
set -euo pipefail
# Default working directory
WORKDIR="/sglang-checkout/test/srt"
ENV_ARGS=(
-e SGLANG_AMD_CI=1
-e SGLANG_IS_IN_CI=1
-e SGLANG_AITER_MOE=1
)
# Parse optional -w/--workdir and -e ENV=VAL flags
while [[ $# -gt 0 ]]; do
case "$1" in
-w|--workdir)
WORKDIR="$2"
shift 2
;;
-e)
ENV_ARGS+=("-e" "$2")
shift 2
;;
--)
shift
break
;;
*)
break
;;
esac
done
# Run docker exec
docker exec \
-w "$WORKDIR" \
"${ENV_ARGS[@]}" \
ci_sglang "$@"

View File

@@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
# Install the required dependencies in CI.
docker exec ci_sglang pip install --upgrade pip
docker exec ci_sglang pip uninstall sgl-kernel -y || true
docker exec -w /sglang-checkout/sgl-kernel ci_sglang bash -c "rm -f pyproject.toml && mv pyproject_rocm.toml pyproject.toml && python3 setup_rocm.py install"
docker exec ci_sglang pip install -e "python[dev_hip]"
docker exec -w / ci_sglang git clone https://github.com/merrymercy/human-eval.git
docker exec -w /human-eval ci_sglang pip install -e .
docker exec -w / ci_sglang mkdir -p /dummy-grok
mkdir -p dummy-grok && wget https://sharkpublic.blob.core.windows.net/sharkpublic/sglang/dummy_grok.json -O dummy-grok/config.json
docker cp ./dummy-grok ci_sglang:/

View File

@@ -0,0 +1,26 @@
#!/bin/bash
set -euo pipefail
# Set up DEVICE_FLAG based on Kubernetes pod info
if [ -f "/etc/podinfo/gha-render-devices" ]; then
DEVICE_FLAG=$(cat /etc/podinfo/gha-render-devices)
else
DEVICE_FLAG="--device /dev/dri"
fi
# Pull the image
IMAGE="lmsysorg/sglang:v0.4.6.post3-rocm630"
echo "Pulling Docker image: $IMAGE"
docker pull "$IMAGE"
# Run the container
echo "Starting container: ci_sglang"
docker run -dt --user root --device=/dev/kfd $DEVICE_FLAG \
-v "${GITHUB_WORKSPACE:-$PWD}:/sglang-checkout" \
--ipc=host --group-add video \
--cap-add=SYS_PTRACE \
-e HF_TOKEN="${HF_TOKEN:-}" \
--security-opt seccomp=unconfined \
-w /sglang-checkout \
--name ci_sglang \
"$IMAGE"