fix: limit build and tweak post build commands

This commit is contained in:
drbh 2024-05-21 17:43:07 +00:00
parent 816e14f0b3
commit f4e7cdb04a

View File

@ -6,7 +6,7 @@ on:
branches: branches:
- main - main
tags: tags:
- '*' - "*"
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
@ -21,14 +21,26 @@ jobs:
# Using ubuntu-20.04 instead of 22.04 for more compatibility (glibc). Ideally we'd use the # Using ubuntu-20.04 instead of 22.04 for more compatibility (glibc). Ideally we'd use the
# manylinux docker image, but I haven't figured out how to install CUDA on manylinux. # manylinux docker image, but I haven't figured out how to install CUDA on manylinux.
os: [ubuntu-20.04] os: [ubuntu-20.04]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] python-version: [
torch-version: ["1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2", "2.3.0"] # "3.7", "3.8", "3.9", "3.10",
cuda-version: ["11.8.0", "12.2.2"] "3.11",
]
torch-version: [
# "1.12.1", "1.13.1", "2.0.1", "2.1.2", "2.2.2",
"2.3.0",
]
cuda-version: [
# "11.8.0",
"12.2.2",
]
# We need separate wheels that either uses C++11 ABI (-D_GLIBCXX_USE_CXX11_ABI) or not. # We need separate wheels that either uses C++11 ABI (-D_GLIBCXX_USE_CXX11_ABI) or not.
# Pytorch wheels currently don't use it, but nvcr images have Pytorch compiled with C++11 ABI. # Pytorch wheels currently don't use it, but nvcr images have Pytorch compiled with C++11 ABI.
# Without this we get import error (undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationESs) # Without this we get import error (undefined symbol: _ZN3c105ErrorC2ENS_14SourceLocationESs)
# when building without C++11 ABI and using it on nvcr images. # when building without C++11 ABI and using it on nvcr images.
cxx11_abi: ["FALSE", "TRUE"] cxx11_abi: [
# "FALSE",
"TRUE",
]
exclude: exclude:
# see https://github.com/pytorch/pytorch/blob/main/RELEASE.md#release-compatibility-matrix # see https://github.com/pytorch/pytorch/blob/main/RELEASE.md#release-compatibility-matrix
# Pytorch <= 1.12 does not support Python 3.11 # Pytorch <= 1.12 does not support Python 3.11
@ -144,9 +156,9 @@ jobs:
MAX_JOBS=2 FLASH_ATTENTION_FORCE_BUILD="TRUE" FLASH_ATTENTION_FORCE_CXX11_ABI=${{ matrix.cxx11_abi }} python setup.py bdist_wheel --dist-dir=dist MAX_JOBS=2 FLASH_ATTENTION_FORCE_BUILD="TRUE" FLASH_ATTENTION_FORCE_CXX11_ABI=${{ matrix.cxx11_abi }} python setup.py bdist_wheel --dist-dir=dist
# Generate a custom name for the wheel to include CUDA and Torch versions # Generate a custom name for the wheel to include CUDA and Torch versions
tmpname=cu${MATRIX_CUDA_VERSION}torch${MATRIX_TORCH_VERSION}cxx11abi${{ matrix.cxx11_abi }} tmpname=cu${MATRIX_CUDA_VERSION}torch${MATRIX_TORCH_VERSION}cxx11abi${{ matrix.cxx11_abi }}
wheel_name=$(ls dist/*.whl | xargs -n 1 basename | sed "s/-/+$tmpname-/2") wheel_name=$(ls dist/*whl | xargs -n 1 basename | sed "s/-/+$tmpname-/2")
# Rename the wheel with the custom name # Rename the wheel with the custom name
ls dist/*.whl | xargs -I {} mv {} dist/${wheel_name} ls dist/*whl |xargs -I {} mv {} dist/${wheel_name}
# Save the wheel name to the GitHub environment # Save the wheel name to the GitHub environment
echo "wheel_name=${wheel_name}" >> $GITHUB_ENV echo "wheel_name=${wheel_name}" >> $GITHUB_ENV