Skip to content

Commit

Permalink
support python 3.12 (#1605)
Browse files Browse the repository at this point in the history
* use cudaStreamSynchronize(stream)

* update runtime

* update build docker

* update script
  • Loading branch information
irexyc authored May 16, 2024
1 parent ec1a39e commit a31639e
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cuda11.8-whl-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
linux-build:
strategy:
matrix:
pyver: [py38, py39, py310, py311]
pyver: [py38, py39, py310, py311, py312]
runs-on: ubuntu-latest
env:
PYTHON_VERSION: ${{ matrix.pyver }}
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
windows-build:
strategy:
matrix:
pyver: ['3.8', '3.9', '3.10', '3.11']
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: windows-latest
steps:
- name: Checkout repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
linux-build:
strategy:
matrix:
pyver: [py38, py39, py310, py311]
pyver: [py38, py39, py310, py311, py312]
runs-on: ubuntu-latest
env:
PYTHON_VERSION: ${{ matrix.pyver }}
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
windows-build:
strategy:
matrix:
pyver: ['3.8', '3.9', '3.10', '3.11']
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
runs-on: windows-latest
steps:
- name: Checkout repository
Expand Down
4 changes: 3 additions & 1 deletion builder/manywheel/Dockerfile_2014
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ RUN /opt/conda/bin/conda create -n py38 python=3.8 -yq && \
/opt/conda/bin/conda create -n py310 python=3.10 -yq && \
/opt/conda/envs/py310/bin/pip install pybind11 && \
/opt/conda/bin/conda create -n py311 python=3.11 -yq && \
/opt/conda/envs/py311/bin/pip install pybind11
/opt/conda/envs/py311/bin/pip install pybind11 && \
/opt/conda/bin/conda create -n py312 python=3.12 -yq && \
/opt/conda/envs/py312/bin/pip install pybind11

FROM base as mpi
ADD manywheel/scripts/install_openmpi.sh install_openmpi.sh
Expand Down
2 changes: 1 addition & 1 deletion builder/manywheel/build_all_wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ PLAT_NAME=manylinux2014_x86_64
for cuver in ${CUDA_VER}; do
DOCKER_TAG=cuda${cuver}
OUTPUT_FOLDER=cuda${cuver}_dist
for pyver in py38 py39 py310 py311; do
for pyver in py38 py39 py310 py311 py312; do
bash ${TOPDIR}/manywheel/build_wheel.sh ${pyver} ${PLAT_NAME} ${DOCKER_TAG} ${OUTPUT_FOLDER} \
|& tee ${PLAT_NAME}.${pyver}.cuda${cuver}.log.txt
done
Expand Down
1 change: 1 addition & 0 deletions builder/manywheel/entrypoint_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ source /opt/conda/bin/activate
conda activate $PYTHON_VERSION

cd lmdeploy
rm -rf lmdeploy/lib
mkdir -p build && cd build && rm -rf *
bash ../generate.sh make
make -j$(nproc) && make install
Expand Down
1 change: 1 addition & 0 deletions requirements/runtime.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sentencepiece
shortuuid
tiktoken
torch<=2.2.2,>=2.0.0
torchvision<=0.17.2,>=0.15.0
transformers
triton>=2.1.0,<=2.2.0; sys_platform == "linux"
uvicorn
4 changes: 0 additions & 4 deletions src/turbomind/kernels/stop_criteria_kernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,7 @@ void invokeLengthCriterion(bool* finished,

length_criterion<<<grid, block, 0, stream>>>(
finished, should_stop, h_pinned_finished_sum_, sequence_limit_length, batch_size, beam_width, step);
#ifdef _MSC_VER
cudaStreamSynchronize(stream);
#else
while (((volatile int*)h_pinned_finished_sum_)[0] == -1) {};
#endif
sync_check_cuda_error();

*should_stop = h_pinned_finished_sum_[0] == batch_size * beam_width;
Expand Down

0 comments on commit a31639e

Please sign in to comment.