Skip to content

Commit

Permalink
Attempt to fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
casper-hansen committed Jan 21, 2024
1 parent fc700a8 commit d9cf3ac
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 32 deletions.
66 changes: 34 additions & 32 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,46 @@ name: Build AutoAWQ Wheels with CUDA

on:
push:
tags:
- "v*"
branches:
- fix-windows-build
# 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_wheels:
name: Build AWQ
runs-on: ${{ matrix.os }}
needs: release
# needs: release

strategy:
matrix:
os: [ubuntu-20.04, windows-latest]
os: [windows-latest] #[ubuntu-20.04, windows-latest]
pyver: ["3.8", "3.9", "3.10", "3.11"]
cuda: ["11.8.0", "12.1.1"]
defaults:
Expand Down Expand Up @@ -114,8 +116,8 @@ jobs:
python setup.py sdist bdist_wheel
- name: Upload Assets
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_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
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def get_compute_capabilities():


check_dependencies()
extra_link_args = []
include_dirs = get_include_dirs()
generator_flags = get_generator_flag()
arch_flags = get_compute_capabilities()
Expand All @@ -117,6 +118,9 @@ def get_compute_capabilities():
extra_compile_args = {"nvcc": arch_flags}
else:
extra_compile_args = {}

cuda_path = os.environ.get("CUDA_PATH", None)
extra_link_args = ["-L", f"{cuda_path}/lib/x64/cublas.lib"]
else:
extra_compile_args = {
"cxx": ["-g", "-O3", "-fopenmp", "-lgomp", "-std=c++17", "-DENABLE_BF16"],
Expand Down Expand Up @@ -151,6 +155,7 @@ def get_compute_capabilities():
extra_compile_args=extra_compile_args,
)
]

extensions.append(
CUDAExtension(
"exllama_kernels",
Expand All @@ -162,6 +167,7 @@ def get_compute_capabilities():
"awq_ext/exllama/cuda_func/q4_matrix.cu",
],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)
)
extensions.append(
Expand All @@ -173,6 +179,7 @@ def get_compute_capabilities():
"awq_ext/exllamav2/cuda/q_gemm.cu",
],
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
)
)

Expand Down

0 comments on commit d9cf3ac

Please sign in to comment.