Skip to content

Commit

Permalink
Add BuildExtension from torch
Browse files Browse the repository at this point in the history
  • Loading branch information
casper-hansen committed Feb 15, 2024
1 parent 9ca91ec commit 7108f93
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 35 deletions.
96 changes: 61 additions & 35 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,42 @@ name: Build AutoAWQ Wheels with CUDA

on:
push:
tags:
- "v*"
branches:
- "fix_workflow"
# tags:
# - "v*"

jobs:
release:
# Retrieve tag and create release
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@v3
# release:
# # Retrieve tag and create release
# name: Create Release
# runs-on: ubuntu-latest
# outputs:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# steps:
# - name: Checkout
# uses: actions/checkout@v3

- name: Extract branch info
shell: bash
run: |
echo "release_tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
# - name: Extract branch info
# shell: bash
# run: |
# echo "release_tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Create Release
id: create_release
uses: "actions/github-script@v6"
env:
RELEASE_TAG: ${{ env.release_tag }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
const script = require('.github/workflows/scripts/github_create_release.js')
await script(github, context, core)
# - name: Create Release
# id: create_release
# uses: "actions/github-script@v6"
# env:
# RELEASE_TAG: ${{ env.release_tag }}
# with:
# github-token: "${{ secrets.GITHUB_TOKEN }}"
# script: |
# const script = require('.github/workflows/scripts/github_create_release.js')
# await script(github, context, core)

build_cuda_wheels:
name: Build AWQ with CUDA
runs-on: ${{ matrix.os }}
needs: release
# needs: release

strategy:
matrix:
Expand Down Expand Up @@ -114,16 +116,28 @@ jobs:
python setup.py sdist bdist_wheel
- name: Upload Assets
uses: shogo82148/actions-upload-release-asset@v1
- uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./dist/*.whl
name: 'linux-cuda-wheels'
path: ./dist/*.whl

- uses: actions/upload-artifact@v3
if: runner.os == 'Windows'
with:
name: 'windows-cuda-wheels'
path: ./dist/*.whl

# - name: Upload Assets
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ needs.release.outputs.upload_url }}
# asset_path: ./dist/*.whl

build_rocm_wheels:
name: Build AWQ with ROCm
runs-on: ${{ matrix.os }}
needs: release
# needs: release

strategy:
matrix:
Expand Down Expand Up @@ -225,8 +239,20 @@ jobs:
ROCM_VERSION=${{ matrix.rocm }} python setup.py sdist bdist_wheel
- name: Upload Assets
uses: shogo82148/actions-upload-release-asset@v1
- uses: actions/upload-artifact@v3
if: runner.os == 'Linux'
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./dist/*.whl
name: 'linux-cuda-wheels'
path: ./dist/*.whl

- uses: actions/upload-artifact@v3
if: runner.os == 'Windows'
with:
name: 'windows-cuda-wheels'
path: ./dist/*.whl

# - name: Upload Assets
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ needs.release.outputs.upload_url }}
# asset_path: ./dist/*.whl
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import requests
from pathlib import Path
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension


def get_latest_kernels_version(repo):
Expand Down Expand Up @@ -136,5 +137,6 @@ def get_kernels_whl_url(
"eval": ["lm_eval>=0.4.0", "tabulate", "protobuf", "evaluate", "scipy"],
"dev": ["black", "mkdocstrings-python", "mkdocs-material", "griffe-typingdoc"]
},
cmdclass={"build_ext": BuildExtension},
**common_setup_kwargs,
)

0 comments on commit 7108f93

Please sign in to comment.