Dockerfile.rocm 1.96 KB
Newer Older
1
# Usage (to build SGLang ROCm docker image):
2
#   docker build --build-arg SGL_BRANCH=v0.4.1.post5 -t v0.4.1.post5-rocm620 -f Dockerfile.rocm .
3
4

# default base image
sogalin's avatar
sogalin committed
5
ARG BASE_IMAGE="rocmshared/vllm-rocm:20250113-tuned-elementwise"
6
7
8
9
10

FROM $BASE_IMAGE AS base
USER root

WORKDIR /sgl-workspace
11
ARG BUILD_TYPE=all
12
13
14
15
ARG SGL_REPO="https://github.com/sgl-project/sglang"
ENV SGL_DEFAULT="main"
ARG SGL_BRANCH=${SGL_DEFAULT}

16
17
18
ARG TRITON_REPO="https://github.com/triton-lang/triton.git"
ARG TRITON_COMMIT="845d75a"

19
20
21
22

ARG ATER_REPO="https://github.com/HaiShaw/ater"
ARG CK_COMMITS="fa05ae"

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
RUN git clone ${SGL_REPO} \
    && cd sglang \
    && if [ "${SGL_BRANCH}" = ${SGL_DEFAULT} ]; then \
         echo "Using ${SGL_DEFAULT}, default branch."; \
       else \
         echo "Using ${SGL_BRANCH} branch."; \
         git checkout ${SGL_BRANCH}; \
       fi \
    && if [ "$BUILD_TYPE" = "srt" ]; then \
         python -m pip --no-cache-dir install -e "python[srt_hip]"; \
       else \
         python -m pip --no-cache-dir install -e "python[all_hip]"; \
       fi

RUN cp -r /sgl-workspace/sglang /sglang
RUN python -m pip cache purge

kk's avatar
kk committed
40
41
42
43
44
45
RUN pip install IPython \
    && pip install orjson \
    && pip install python-multipart \
    && pip install torchao \
    && pip install pybind11

46
47
48
49
50
51
52
RUN pip uninstall -y triton
RUN git clone ${TRITON_REPO} \
    && cd triton \
    && git checkout ${TRITON_COMMIT} \
    && cd python \
    && python3 setup.py install

53
54
55
56
57
RUN git clone ${ATER_REPO} \
    && cd ater \
    && git submodule update --init --recursive \
    && PREBUILD_KERNELS=1 GPU_ARCHS=gfx942 python3 setup.py develop

58
59
60
# Performance environment variable.

ENV HIP_FORCE_DEV_KERNARG=1
61
ENV SGLANG_SET_CPU_AFFINITY=1
62
63
64
65
66
67
68
69
ENV SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1
ENV NCCL_MIN_NCHANNELS=112

ENV MOE_PADDING=1
ENV VLLM_FP8_PADDING=1
ENV VLLM_FP8_ACT_PADDING=1
ENV VLLM_FP8_WEIGHT_PADDING=1
ENV VLLM_FP8_REDUCE_CONV=1
70
71
ENV TORCHINDUCTOR_MAX_AUTOTUNE=1
ENV TORCHINDUCTOR_MAX_AUTOTUNE_POINTWISE=1
72
73

CMD ["/bin/bash"]