Skip to content

Commit

Permalink
ci: bump version and build with new manylinux image (gcc-9) (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
guocuimi authored May 20, 2024
1 parent 9495167 commit 47e3b2f
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11"]
python: ["3.8", "3.9", "3.10", "3.11"]
cuda: ["11.8", "12.1"]
torch: ["2.1", "2.2", "2.3"]
runs-on: [self-hosted, linux, release]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_manylinux_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ./docker
file: ./docker/Dockerfile.manylinux_gcc11
file: ./docker/Dockerfile.manylinux
push: true
cache-from: type=local,src=$CI_CACHE_DIR/.buildx-cache
cache-to: type=local,dest=$CI_CACHE_DIR/.buildx-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: rename wheel to manylinux
run: |
for whl in python/dist/scalellm-*.whl; do
new_whl=${whl//"-linux_"/"-manylinux_2_28_"}
new_whl=${whl//"-linux_"/"-manylinux1_"}
if [ "$whl" != "$new_whl" ]; then
mv $whl $new_whl
fi
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ message(STATUS "TORCH_CXX_FLAGS: ${TORCH_CXX_FLAGS}")
add_compile_options(${TORCH_CXX_FLAGS})
add_compile_definitions(TORCH_CUDA=1)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DC10_USE_GLOG -flto=auto")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DC10_USE_GLOG")

message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
Expand Down
41 changes: 15 additions & 26 deletions docker/Dockerfile.manylinux
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM quay.io/pypa/manylinux_2_28_x86_64 as base
ARG CUDA_VERSION=12.1
FROM pytorch/manylinux-builder:cuda${CUDA_VERSION} as base

LABEL maintainer="[email protected]"
ENV DEBIAN_FRONTEND noninteractive
Expand All @@ -7,36 +8,24 @@ ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# Install common dependencies
COPY ./common/install_base.sh install_base.sh
RUN bash ./install_base.sh && rm install_base.sh

# Install user
COPY ./common/install_user.sh install_user.sh
RUN bash ./install_user.sh && rm install_user.sh

# Install cuda, cudnn and nccl
ARG CUDA_VERSION=12.1
COPY ./common/install_cuda.sh install_cuda.sh
RUN bash ./install_cuda.sh ${CUDA_VERSION} && rm install_cuda.sh
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:$PATH

# ARG CMAKE_VERSION=3.29.3
# COPY ./common/install_cmake.sh install_cmake.sh
# RUN if [ -n "${CMAKE_VERSION}" ]; then bash ./install_cmake.sh; fi
# RUN rm install_cmake.sh

ARG NINJA_VERSION=1.11.1
COPY ./common/install_ninja.sh install_ninja.sh
RUN if [ -n "${NINJA_VERSION}" ]; then bash ./install_ninja.sh; fi
RUN rm install_ninja.sh

# Install dependencies for vcpkg
RUN yum -y update && yum -y install \
zip \
unzip \
tar \
wget \
curl \
perl \
perl-IPC-Cmd \
sudo

# Install ccache
ARG CCACHE_VERSION=4.8.3
COPY ./common/install_ccache.sh install_ccache.sh
RUN if [ -n "${CCACHE_VERSION}" ]; then bash ./install_ccache.sh; fi
RUN rm install_ccache.sh

# install rust
# Install rust
ENV RUSTUP_HOME=/usr/local/rustup
ENV CARGO_HOME=/usr/local/cargo
ENV PATH=/usr/local/cargo/bin:$PATH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ ENV LANGUAGE en_US.UTF-8
COPY ./common/install_base.sh install_base.sh
RUN bash ./install_base.sh && rm install_base.sh

# Install user
COPY ./common/install_user.sh install_user.sh
RUN bash ./install_user.sh && rm install_user.sh

# Install gcc-11
RUN rm -rf /opt/rh/gcc-toolset-12
RUN yum install -y gcc-toolset-11-toolchain
Expand Down
2 changes: 1 addition & 1 deletion python/scalellm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.1.0"
__version__ = "0.1.1"
try:
# torch needs to be imported first, otherwise it will segfault upon import.
import torch # noqa: F401
Expand Down
7 changes: 6 additions & 1 deletion scripts/build_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ echo "::group::Install PyTorch"
pip install torch==$TORCH_VERSION --index-url "https://download.pytorch.org/whl/cu${CUDA_MAJOR}${CUDA_MINOR}"
echo "::endgroup::"

echo "::group::Install other dependencies"
pip install numpy
pip install --upgrade setuptools wheel
echo "::endgroup::"


echo "::group::Build wheel for ScaleLLM"
cd "$PROJECT_ROOT/python"
Expand All @@ -53,6 +58,6 @@ fi
# pip install auditwheel
# cd "$PROJECT_ROOT/python"
# for whl in dist/*.whl; do
# auditwheel repair "$whl" --plat manylinux_2_28_x86_64 -w dist/
# auditwheel repair "$whl" --plat manylinux1_x86_64 -w dist/
# done
# echo "::endgroup::"

0 comments on commit 47e3b2f

Please sign in to comment.