test #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Release | |
on: | |
push: | |
branches: [main, ci] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: {} # Allow manual trigger | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build-with-cuda: | |
runs-on: ubuntu-latest | |
container: | |
image: pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel | |
steps: | |
- name: Install build dependencies | |
run: | | |
apt-get update && apt-get install -y --no-install-recommends \ | |
cmake ninja-build git | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set CUDA_HOME | |
run: | | |
# Find nvcc location | |
NVCC_PATH=$(which nvcc) | |
# Extract CUDA installation directory (remove /bin/nvcc from path) | |
export CUDA_HOME=$(dirname $(dirname $NVCC_PATH)) | |
echo "CUDA_HOME=${CUDA_HOME}" >> $GITHUB_ENV | |
echo "Found CUDA installation at: ${CUDA_HOME}" | |
echo "${CUDA_HOME}/bin" >> $GITHUB_PATH | |
- name: Verify CUDA installation | |
run: | | |
nvcc -V | |
echo "CUDA_HOME: ${CUDA_HOME}" | |
ls -la ${CUDA_HOME}/bin | |
echo "PATH: $PATH" | |
pwd | |
ls . -alh | |
ls cutlass -alh | |
ls gemm_int8 -alh | |
- name: Install cibuildwheel | |
run: pip install cibuildwheel | |
- name: Build wheels with cibuildwheel | |
run: cibuildwheel --output-dir wheelhouse | |
env: | |
CUDA_HOME: ${{ env.CUDA_HOME }} | |
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*" | |
CIBW_SKIP: "pp* *-win32 *-manylinux_i686 *-musllinux*" | |
CIBW_MANYLINUX_X86_64_IMAGE: "pytorch/pytorch:2.6.0-cuda12.6-cudnn9-devel" | |
CIBW_ENVIRONMENT: "CUDA_PATH=${CUDA_HOME}" | |
CIBW_BEFORE_BUILD: > | |
apt-get update && apt-get install -y --no-install-recommends cmake ninja-build git && | |
export CUDA_HOME=$(dirname $(dirname $(which nvcc))) && | |
echo 'CUDA_HOME: ${CUDA_HOME}' && | |
nvcc -V | |
CIBW_TEST_COMMAND: "" | |
CIBW_TEST_SKIP: "*" | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wheel | |
path: wheelhouse/*.whl | |
retention-days: 7 | |
publish-release: | |
needs: build-with-cuda | |
runs-on: ubuntu-latest | |
# if: github.ref == 'refs/heads/main' # Only run on main branch | |
permissions: | |
contents: write | |
steps: | |
- name: Download wheel artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: wheel | |
path: wheels/ | |
- name: List wheels | |
run: ls -la wheels/ | |
- name: Create/Update Release | |
uses: softprops/action-gh-release@v2.0.8 | |
with: | |
files: wheels/*.whl | |
prerelease: true | |
name: Latest Build from main | |
tag_name: latest-release | |
make_latest: true | |
draft: false | |
target_commitish: ${{ github.sha }} |