From b6151ba5dbd930d27e9ca1e7fca8a0c13a242202 Mon Sep 17 00:00:00 2001 From: biondizzle Date: Sun, 12 Apr 2026 02:47:33 +0000 Subject: [PATCH] fix aiter --- Dockerfile | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9c5166e..47eaf89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,29 @@ FROM lmsysorg/sglang-rocm:v0.5.10rc0-rocm700-mi30x-20260411 -# Replace the vllm binary with our shim so no matter how the -# production stack invokes vllm, we intercept it +# --------------------------------------------------------------- +# Fix aiter — try pip upgrade first, fall back to source build +# --------------------------------------------------------------- +RUN pip install --upgrade aiter || \ + ( \ + echo "=== pip upgrade failed, building aiter from source ===" && \ + pip uninstall -y aiter || true && \ + pip install psutil pybind11 flydsl==0.0.1.dev95158637 && \ + git clone --recursive https://github.com/ROCm/aiter.git /tmp/aiter && \ + cd /tmp/aiter && \ + git checkout v0.1.11.post1 && \ + git submodule sync && \ + git submodule update --init --recursive && \ + PREBUILD_KERNELS=1 GPU_ARCHS=gfx942 python3 setup.py install && \ + cd / && rm -rf /tmp/aiter \ + ) + +# --------------------------------------------------------------- +# Replace the vllm binary with our shim +# --------------------------------------------------------------- COPY vllm-shim.sh /usr/local/bin/vllm RUN chmod +x /usr/local/bin/vllm -# Also handle `python -m vllm.entrypoints.openai.api_server` and -# `python -m vllm.entrypoints.cli.main` by shadowing the vllm package +# Shadow `python -m vllm.*` invocations RUN mkdir -p /opt/vllm-shim/vllm/entrypoints/openai \ /opt/vllm-shim/vllm/entrypoints/cli COPY vllm_shim_module.py /opt/vllm-shim/vllm/__main__.py @@ -17,9 +34,12 @@ RUN touch /opt/vllm-shim/vllm/__init__.py \ /opt/vllm-shim/vllm/entrypoints/openai/__init__.py \ /opt/vllm-shim/vllm/entrypoints/cli/__init__.py -# Prepend shim to PYTHONPATH so it shadows any real vllm install ENV PYTHONPATH="/opt/vllm-shim:${PYTHONPATH}" +# --------------------------------------------------------------- +# MI300X tuning +# --------------------------------------------------------------- ENV HIP_FORCE_DEV_KERNARG=1 ENV NCCL_MIN_NCHANNELS=112 -ENV GPU_MAX_HW_QUEUES=2 \ No newline at end of file +ENV GPU_MAX_HW_QUEUES=2 +ENV SGLANG_USE_AITER=1 \ No newline at end of file