ci: refactor wheel handling and enable manylinux artifact generation

- Change wheel output to use full path instead of basename for better flexibility
- Add patchelf to build dependencies for wheel repair operations
- Enable auditwheel repair step with proper exclusions for CUDA/torch libraries
- Separate wheel path variable to track both standard and manylinux versions
- Rename manylinux workflow file to reflect its dedicated purpose
- Update workflow references to use renamed manylinux workflow
- Use fromjson() for runner parameter parsing in ARM build workflow
- Update test workflows to use container environment consistently
- Support both manylinux and standard wheel uploads to releases
This commit is contained in:
Junya Morioka
2025-12-13 18:18:50 +09:00
parent a18d6ac478
commit 92464a9b3b
6 changed files with 43 additions and 40 deletions
+33 -30
View File
@@ -78,7 +78,8 @@ jobs:
clang \
ninja-build \
keyboard-configuration \
time
time \
patchelf
- name: Install gh
shell: bash
@@ -121,14 +122,14 @@ jobs:
run: |
chmod +x build_linux.sh
./build_linux.sh ${{ inputs.flash-attn-version }} ${{ inputs.python-version }} ${{ inputs.torch-version }} ${{ inputs.cuda-version }}
wheel_name=$(basename $(ls flash-attention/dist/*.whl | head -n 1))
echo "WHEEL_NAME=$wheel_name" >> $GITHUB_OUTPUT
wheel_path=$(ls flash-attention/dist/*.whl | head -n 1)
echo "WHEEL_PATH=$wheel_path" >> $GITHUB_OUTPUT
- name: Install Test
shell: bash
run: |
pip uninstall -y flash-attn > /dev/null 2>&1
pip install --no-cache-dir flash-attention/dist/${{ steps.build_wheels.outputs.WHEEL_NAME }}
pip install --no-cache-dir ${{ steps.build_wheels.outputs.WHEEL_PATH }}
python -c "import flash_attn; print(flash_attn.__version__)"
- name: Upload Release Asset
@@ -138,7 +139,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name=${{ github.ref_name }}
wheel_path="flash-attention/dist/${{ steps.build_wheels.outputs.WHEEL_NAME }}"
wheel_path="${{ steps.build_wheels.outputs.WHEEL_PATH }}"
# Check if the file exists
if [ ! -f "$wheel_path" ]; then
@@ -149,33 +150,35 @@ jobs:
# Upload the release asset using GitHub CLI
gh release upload "$tag_name" "$wheel_path" --clobber
# - name: Apply auditwheel repair
# continue-on-error: true
# run: |
# pip install auditwheel
# auditwheel show flash-attention/dist/${{ steps.build_wheels.outputs.WHEEL_NAME }}
# auditwheel repair flash-attention/dist/${{ steps.build_wheels.outputs.WHEEL_NAME }} -w flash-attention/dist_manylinux
# wheel_name=$(basename $(ls flash-attention/dist_manylinux/*.whl | head -n 1))
# echo "WHEEL_NAME_MANYLINUX=$wheel_name" >> $GITHUB_OUTPUT
- name: Apply auditwheel repair
continue-on-error: true
run: |
auditwheel show ${{ steps.build_wheels.outputs.WHEEL_PATH }}
auditwheel repair \
--exclude libc10* --exclude libtorch* --exclude libcu* --exclude libnv* --exclude 'libtorch*' \
${{ steps.build_wheels.outputs.WHEEL_PATH }} -w flash-attention/dist_manylinux
wheel_path_manylinux=$(ls flash-attention/dist_manylinux/*manylinux*.whl | head -n 1)
echo "WHEEL_PATH_MANYLINUX=$wheel_path_manylinux" >> $GITHUB_OUTPUT
# - name: Apply auditwheel repair
# if: ${{ inputs.is-upload }}
# continue-on-error: true
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# pip uninstall -y flash-attn > /dev/null 2>&1
# pip install --no-cache-dir flash-attention/dist_manylinux/${{ steps.build_wheels.outputs.WHEEL_NAME_MANYLINUX }}
# python -c "import flash_attn; print(flash_attn.__version__)"
- name: Test manylinux wheel
continue-on-error: true
run: |
pip uninstall -y flash-attn > /dev/null 2>&1
pip install --no-cache-dir ${{ steps.build_wheels.outputs.WHEEL_PATH_MANYLINUX }}
python -c "import flash_attn; print(flash_attn.__version__)"
# wheel_path_manylinux="flash-attention/dist_manylinux/${{ steps.build_wheels.outputs.WHEEL_NAME_MANYLINUX }}"
# if [ ! -f "$wheel_path_manylinux" ]; then
# echo "Error: Wheel file not found at $wheel_path_manylinux"
# exit 1
# fi
# # Upload the release asset using GitHub CLI
# gh release upload "$tag_name" "$wheel_path_manylinux" --clobber
- name: Upload manylinux wheel
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wheel_path_manylinux="${{ steps.build_wheels.outputs.WHEEL_PATH_MANYLINUX }}"
if [ ! -f "$wheel_path_manylinux" ]; then
echo "Error: Wheel file not found at $wheel_path_manylinux"
exit 1
fi
# Upload the release asset using GitHub CLI
gh release upload "$tag_name" "$wheel_path_manylinux" --clobber
- name: Clean up
shell: bash