[CPU] Apply uv as package manager (#14106)
This commit is contained in:
@@ -207,7 +207,7 @@
|
|||||||
"can_tag_run_ci_label": true,
|
"can_tag_run_ci_label": true,
|
||||||
"can_rerun_failed_ci": true,
|
"can_rerun_failed_ci": true,
|
||||||
"cooldown_interval_minutes": 0,
|
"cooldown_interval_minutes": 0,
|
||||||
"reason": "top contributor"
|
"reason": "custom override"
|
||||||
},
|
},
|
||||||
"ZhengdQin": {
|
"ZhengdQin": {
|
||||||
"can_tag_run_ci_label": true,
|
"can_tag_run_ci_label": true,
|
||||||
@@ -230,7 +230,7 @@
|
|||||||
"airMeng": {
|
"airMeng": {
|
||||||
"can_tag_run_ci_label": true,
|
"can_tag_run_ci_label": true,
|
||||||
"can_rerun_failed_ci": true,
|
"can_rerun_failed_ci": true,
|
||||||
"cooldown_interval_minutes": 60,
|
"cooldown_interval_minutes": 0,
|
||||||
"reason": "custom override"
|
"reason": "custom override"
|
||||||
},
|
},
|
||||||
"alisonshao": {
|
"alisonshao": {
|
||||||
|
|||||||
@@ -80,13 +80,13 @@ jobs:
|
|||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
run: |
|
run: |
|
||||||
docker exec -w /sglang-checkout/ ci_sglang_xeon \
|
docker exec -w /sglang-checkout/ ci_sglang_xeon \
|
||||||
bash -c "python3 -c 'import torch; import sgl_kernel; assert torch._C._cpu._is_amx_tile_supported(); assert hasattr(torch.ops.sgl_kernel, \"convert_weight_packed\"); '"
|
bash -c "source /opt/.venv/bin/activate && python3 -c 'import torch; import sgl_kernel; assert torch._C._cpu._is_amx_tile_supported(); assert hasattr(torch.ops.sgl_kernel, \"convert_weight_packed\"); '"
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
timeout-minutes: 36
|
timeout-minutes: 36
|
||||||
run: |
|
run: |
|
||||||
docker exec -w /sglang-checkout/ ci_sglang_xeon \
|
docker exec -w /sglang-checkout/ ci_sglang_xeon \
|
||||||
bash -c "cd ./test/srt && python3 run_suite.py --suite per-commit-cpu --timeout-per-file 1500"
|
bash -c "source /opt/.venv/bin/activate && cd ./test/srt && python3 run_suite.py --suite per-commit-cpu --timeout-per-file 1500"
|
||||||
|
|
||||||
- name: Change permission
|
- name: Change permission
|
||||||
timeout-minutes: 2
|
timeout-minutes: 2
|
||||||
|
|||||||
+24
-20
@@ -18,35 +18,39 @@ RUN apt-get update && \
|
|||||||
vim \
|
vim \
|
||||||
gcc \
|
gcc \
|
||||||
g++ \
|
g++ \
|
||||||
make
|
make \
|
||||||
|
libsqlite3-dev \
|
||||||
|
google-perftools \
|
||||||
|
libtbb-dev \
|
||||||
|
libnuma-dev \
|
||||||
|
numactl
|
||||||
|
|
||||||
|
WORKDIR /opt
|
||||||
|
|
||||||
|
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
||||||
|
source $HOME/.local/bin/env && \
|
||||||
|
uv venv --python 3.12
|
||||||
|
|
||||||
|
RUN echo -e '[[index]]\nname = "torch"\nurl = "https://download.pytorch.org/whl/cpu"\n\n[[index]]\nname = "torchvision"\nurl = "https://download.pytorch.org/whl/cpu"\n\n[[index]]\nname = "triton"\nurl = "https://download.pytorch.org/whl/cpu"' > .venv/uv.toml
|
||||||
|
|
||||||
|
ENV UV_CONFIG_FILE=/opt/.venv/uv.toml
|
||||||
|
|
||||||
WORKDIR /sgl-workspace
|
WORKDIR /sgl-workspace
|
||||||
|
RUN source $HOME/.local/bin/env && \
|
||||||
RUN curl -fsSL -o miniforge.sh -O https://github.com/conda-forge/miniforge/releases/download/25.3.1-0/Miniforge3-25.3.1-0-Linux-x86_64.sh && \
|
source /opt/.venv/bin/activate && \
|
||||||
bash miniforge.sh -b -p ./miniforge3 && \
|
git clone ${SGLANG_REPO} sglang && \
|
||||||
rm -f miniforge.sh && \
|
|
||||||
. miniforge3/bin/activate && \
|
|
||||||
conda install -y libsqlite==3.48.0 gperftools tbb libnuma numactl
|
|
||||||
|
|
||||||
ENV PATH=/sgl-workspace/miniforge3/bin:/sgl-workspace/miniforge3/condabin:${PATH}
|
|
||||||
ENV PIP_ROOT_USER_ACTION=ignore
|
|
||||||
ENV CONDA_PREFIX=/sgl-workspace/miniforge3
|
|
||||||
|
|
||||||
RUN pip config set global.index-url https://download.pytorch.org/whl/cpu && \
|
|
||||||
pip config set global.extra-index-url https://pypi.org/simple
|
|
||||||
|
|
||||||
RUN git clone ${SGLANG_REPO} sglang && \
|
|
||||||
cd sglang && \
|
cd sglang && \
|
||||||
git checkout ${VER_SGLANG} && \
|
git checkout ${VER_SGLANG} && \
|
||||||
cd python && \
|
cd python && \
|
||||||
cp pyproject_cpu.toml pyproject.toml && \
|
cp pyproject_cpu.toml pyproject.toml && \
|
||||||
pip install . && \
|
uv pip install . && \
|
||||||
pip install torch==${VER_TORCH} torchvision==${VER_TORCHVISION} triton==${VER_TRITON} --force-reinstall && \
|
uv pip install torch==${VER_TORCH} torchvision==${VER_TORCHVISION} triton==${VER_TRITON} --force-reinstall && \
|
||||||
cd ../sgl-kernel && \
|
cd ../sgl-kernel && \
|
||||||
cp pyproject_cpu.toml pyproject.toml && \
|
cp pyproject_cpu.toml pyproject.toml && \
|
||||||
pip install .
|
uv pip install .
|
||||||
|
|
||||||
ENV SGLANG_USE_CPU_ENGINE=1
|
ENV SGLANG_USE_CPU_ENGINE=1
|
||||||
ENV LD_PRELOAD=/sgl-workspace/miniforge3/lib/libiomp5.so:/sgl-workspace/miniforge3/lib/libtcmalloc.so:/sgl-workspace/miniforge3/lib/libtbbmalloc.so.2
|
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libtcmalloc.so.4:/usr/lib/x86_64-linux-gnu/libtbbmalloc.so:/opt/.venv/lib/libiomp5.so
|
||||||
|
RUN echo 'source /opt/.venv/bin/activate' >> /root/.bashrc
|
||||||
|
|
||||||
WORKDIR /sgl-workspace/sglang
|
WORKDIR /sgl-workspace/sglang
|
||||||
|
|||||||
@@ -54,6 +54,22 @@ if(DEFINED ENV{CONDA_PREFIX})
|
|||||||
message(FATAL_ERROR "libnuma not found in Conda environment at ${CONDA_LIB_DIR}\n"
|
message(FATAL_ERROR "libnuma not found in Conda environment at ${CONDA_LIB_DIR}\n"
|
||||||
"Please install it using: conda install libnuma numactl\n")
|
"Please install it using: conda install libnuma numactl\n")
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
if(DEFINED ENV{VIRTUAL_ENV})
|
||||||
|
set(VENV_LIB_DIR "$ENV{VIRTUAL_ENV}/lib")
|
||||||
|
message(STATUS "Using venv lib dir: ${VENV_LIB_DIR}")
|
||||||
|
link_directories(${VENV_LIB_DIR})
|
||||||
|
set(VENV_INCLUDE_DIR "$ENV{VIRTUAL_ENV}/include")
|
||||||
|
include_directories(${VENV_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
# Look for libnuma in system env paths
|
||||||
|
find_library(NUMA_LIB numa)
|
||||||
|
if(NUMA_LIB)
|
||||||
|
message(STATUS "Found libnuma: ${NUMA_LIB}")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "libnuma not found in system environment\n"
|
||||||
|
"Please install it using: apt-get install libnuma numactl\n")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
|
||||||
|
|||||||
Reference in New Issue
Block a user