mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-16 16:27:45 +01:00
update build file
This commit is contained in:
1
.github/workflows/daily_regression.yaml
vendored
1
.github/workflows/daily_regression.yaml
vendored
@@ -32,7 +32,6 @@ jobs:
|
||||
|
||||
- name: Fetch LFS objects
|
||||
run: |
|
||||
git lfs install --local --force
|
||||
git lfs pull
|
||||
|
||||
- name: Run unittest
|
||||
|
||||
2
Makefile
2
Makefile
@@ -18,7 +18,7 @@ test:
|
||||
|
||||
.PHONY: whl
|
||||
whl:
|
||||
python setup.py sdist bdist_wheel
|
||||
python setup.py sdist --dist-dir $(WHL_BUILD_DIR)/dist bdist_wheel --dist-dir $(WHL_BUILD_DIR)/dist
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
||||
@@ -16,7 +16,7 @@ COPY {meta_file} /tmp/install.sh
|
||||
|
||||
ARG INSTALL_MS_DEPS={install_ms_deps}
|
||||
|
||||
ARG INSTALL_MEGATRON_DEPS={install_megatron_deps}
|
||||
ARG IMAGE_TYPE={image_type}
|
||||
|
||||
# install dependencies
|
||||
COPY requirements /var/modelscope
|
||||
@@ -56,7 +56,7 @@ fi
|
||||
ARG CUR_TIME={cur_time}
|
||||
RUN echo $CUR_TIME
|
||||
|
||||
RUN sh /tmp/install.sh {version_args} && \
|
||||
RUN bash /tmp/install.sh {version_args} && \
|
||||
curl -fsSL https://ollama.com/install.sh | sh && \
|
||||
pip install --no-cache-dir -U funasr scikit-learn && \
|
||||
pip install --no-cache-dir -U qwen_vl_utils qwen_omni_utils librosa timm transformers accelerate peft trl safetensors && \
|
||||
@@ -75,10 +75,7 @@ RUN sh /tmp/install.sh {version_args} && \
|
||||
cp /tmp/resources/ubuntu2204.aliyun /etc/apt/sources.list
|
||||
|
||||
|
||||
RUN if [ "$INSTALL_MS_DEPS" = "True" ]; then \
|
||||
pip install --no-cache-dir huggingface-hub transformers peft -U; \
|
||||
fi; \
|
||||
if [ "$INSTALL_MEGATRON_DEPS" = "True" ]; then \
|
||||
RUN if [ "$IMAGE_TYPE" = "swift" ]; then \
|
||||
pip install "sglang[all]<0.5" "math_verify==0.5.2" "gradio<5.33" -U && \
|
||||
pip install liger_kernel wandb swanlab nvitop pre-commit "transformers<4.57" "trl<0.21" huggingface-hub -U && \
|
||||
SITE_PACKAGES=$(python -c "import site; print(site.getsitepackages()[0])") && echo $SITE_PACKAGES && \
|
||||
@@ -88,6 +85,11 @@ if [ "$INSTALL_MEGATRON_DEPS" = "True" ]; then \
|
||||
cd apex && git checkout e13873debc4699d39c6861074b9a3b2a02327f92 && pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" ./ && \
|
||||
cd / && rm -fr /tmp/apex && pip cache purge; \
|
||||
pip install git+https://github.com/NVIDIA/Megatron-LM.git@core_r0.13.0; \
|
||||
elif [ "$IMAGE_TYPE" = "llm" ]; then \
|
||||
pip install --no-cache-dir huggingface-hub transformers peft diffusers -U; \
|
||||
pip uninstall autoawq -y; \
|
||||
else \
|
||||
pip install "transformers<4.56" "tokenizers<0.22" "trl<0.23" "diffusers<0.35" --no-dependencies; \
|
||||
fi
|
||||
|
||||
# install nvm and set node version to 18
|
||||
@@ -97,7 +99,6 @@ RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | b
|
||||
nvm install 22 && \
|
||||
nvm use 22
|
||||
|
||||
ENV SETUPTOOLS_USE_DISTUTILS=stdlib
|
||||
ENV VLLM_USE_MODELSCOPE=True
|
||||
ENV LMDEPLOY_USE_MODELSCOPE=True
|
||||
ENV MODELSCOPE_CACHE=/mnt/workspace/.cache/modelscope/hub
|
||||
|
||||
@@ -162,7 +162,7 @@ class CPUImageBuilder(Builder):
|
||||
content = content.replace('{version_args}', version_args)
|
||||
content = content.replace('{cur_time}', formatted_time)
|
||||
content = content.replace('{install_ms_deps}', 'True')
|
||||
content = content.replace('{install_megatron_deps}', 'False')
|
||||
content = content.replace('{image_type}', 'cpu')
|
||||
content = content.replace('{torch_version}',
|
||||
self.args.torch_version)
|
||||
content = content.replace('{torchvision_version}',
|
||||
@@ -207,6 +207,8 @@ class GPUImageBuilder(Builder):
|
||||
# pushd ~ popd is to solve the tf cannot use gpu problem.
|
||||
extra_content = """
|
||||
RUN pip install tf-keras==2.16.0 --no-dependencies && \
|
||||
pip install onnx==1.18.0 --no-dependencies && \
|
||||
pip install deepspeed==0.17.4 --no-dependencies && \
|
||||
pip install --no-cache-dir torchsde jupyterlab torchmetrics==0.11.4 basicsr pynvml shortuuid && \
|
||||
CUDA_HOME=/usr/local/cuda TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6 8.9 9.0" \
|
||||
pip install --no-cache-dir 'git+https://github.com/facebookresearch/detectron2.git'
|
||||
@@ -230,7 +232,7 @@ RUN pushd $(dirname $(python -c 'print(__import__("tensorflow").__file__)')) &&
|
||||
content = content.replace('{version_args}', version_args)
|
||||
content = content.replace('{cur_time}', formatted_time)
|
||||
content = content.replace('{install_ms_deps}', 'True')
|
||||
content = content.replace('{install_megatron_deps}', 'False')
|
||||
content = content.replace('{image_type}', 'gpu')
|
||||
content = content.replace('{torch_version}',
|
||||
self.args.torch_version)
|
||||
content = content.replace('{torchvision_version}',
|
||||
@@ -273,19 +275,19 @@ class LLMImageBuilder(Builder):
|
||||
# A mirrored image of nvidia/cuda:12.4.0-devel-ubuntu22.04
|
||||
args.base_image = 'nvidia/cuda:12.4.0-devel-ubuntu22.04'
|
||||
if not args.torch_version:
|
||||
args.torch_version = '2.6.0'
|
||||
args.torchaudio_version = '2.6.0'
|
||||
args.torchvision_version = '0.21.0'
|
||||
args.torch_version = '2.8.0'
|
||||
args.torchaudio_version = '2.8.0'
|
||||
args.torchvision_version = '0.23.0'
|
||||
if not args.cuda_version:
|
||||
args.cuda_version = '12.4.0'
|
||||
if not args.vllm_version:
|
||||
args.vllm_version = '0.8.5.post1'
|
||||
args.vllm_version = '0.11.0'
|
||||
if not args.lmdeploy_version:
|
||||
args.lmdeploy_version = '0.9.1'
|
||||
args.lmdeploy_version = '0.10.1'
|
||||
if not args.autogptq_version:
|
||||
args.autogptq_version = '0.7.1'
|
||||
if not args.flashattn_version:
|
||||
args.flashattn_version = '2.7.1.post4'
|
||||
args.flashattn_version = '2.7.4.post1'
|
||||
return args
|
||||
|
||||
def generate_dockerfile(self) -> str:
|
||||
@@ -306,7 +308,7 @@ class LLMImageBuilder(Builder):
|
||||
content = content.replace('{version_args}', version_args)
|
||||
content = content.replace('{cur_time}', formatted_time)
|
||||
content = content.replace('{install_ms_deps}', 'False')
|
||||
content = content.replace('{install_megatron_deps}', 'False')
|
||||
content = content.replace('{image_type}', 'llm')
|
||||
content = content.replace('{torch_version}',
|
||||
self.args.torch_version)
|
||||
content = content.replace('{torchvision_version}',
|
||||
@@ -382,7 +384,7 @@ RUN pip install --no-cache-dir -U icecream soundfile pybind11 py-spy
|
||||
content = content.replace('{version_args}', version_args)
|
||||
content = content.replace('{cur_time}', formatted_time)
|
||||
content = content.replace('{install_ms_deps}', 'False')
|
||||
content = content.replace('{install_megatron_deps}', 'True')
|
||||
content = content.replace('{image_type}', 'swift')
|
||||
content = content.replace('{torch_version}',
|
||||
self.args.torch_version)
|
||||
content = content.replace('{torchvision_version}',
|
||||
|
||||
@@ -28,6 +28,8 @@ pip install --no-cache-dir triton auto-gptq==$autogptq_version -U && pip cache p
|
||||
if [[ "$(printf '%s\n' "0.6.0" "$vllm_version" | sort -V | head -n1)" = "0.6.0" ]]; then
|
||||
# vllm_version is >= 0.6.0
|
||||
pip install --no-cache-dir vllm==$vllm_version && pip cache purge
|
||||
else
|
||||
echo "vllm_version < 0.6.0, skipping installation. (vllm_version = $vllm_version)"
|
||||
fi
|
||||
|
||||
# pip uninstall -y torch-scatter && TORCH_CUDA_ARCH_LIST="6.0;6.1;6.2;7.0;7.5;8.0;8.6;8.9;9.0" pip install --no-cache-dir -U torch-scatter
|
||||
|
||||
Reference in New Issue
Block a user