Skip to content

Commit 485aa31

Browse files
committed
Attempt fix
1 parent 171c7af commit 485aa31

File tree

2 files changed

+68
-39
lines changed

2 files changed

+68
-39
lines changed

.github/workflows/build.yaml

+62-36
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,42 @@ name: Build AutoAWQ Wheels with CUDA
22

33
on:
44
push:
5-
tags:
6-
- "v*"
5+
branches:
6+
- "fix_workflow"
7+
# tags:
8+
# - "v*"
79

810
jobs:
9-
release:
10-
# Retrieve tag and create release
11-
name: Create Release
12-
runs-on: ubuntu-latest
13-
outputs:
14-
upload_url: ${{ steps.create_release.outputs.upload_url }}
15-
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v3
11+
# release:
12+
# # Retrieve tag and create release
13+
# name: Create Release
14+
# runs-on: ubuntu-latest
15+
# outputs:
16+
# upload_url: ${{ steps.create_release.outputs.upload_url }}
17+
# steps:
18+
# - name: Checkout
19+
# uses: actions/checkout@v3
1820

19-
- name: Extract branch info
20-
shell: bash
21-
run: |
22-
echo "release_tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
21+
# - name: Extract branch info
22+
# shell: bash
23+
# run: |
24+
# echo "release_tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
2325

24-
- name: Create Release
25-
id: create_release
26-
uses: "actions/github-script@v6"
27-
env:
28-
RELEASE_TAG: ${{ env.release_tag }}
29-
with:
30-
github-token: "${{ secrets.GITHUB_TOKEN }}"
31-
script: |
32-
const script = require('.github/workflows/scripts/github_create_release.js')
33-
await script(github, context, core)
26+
# - name: Create Release
27+
# id: create_release
28+
# uses: "actions/github-script@v6"
29+
# env:
30+
# RELEASE_TAG: ${{ env.release_tag }}
31+
# with:
32+
# github-token: "${{ secrets.GITHUB_TOKEN }}"
33+
# script: |
34+
# const script = require('.github/workflows/scripts/github_create_release.js')
35+
# await script(github, context, core)
3436

3537
build_cuda_wheels:
3638
name: Build AWQ with CUDA
3739
runs-on: ${{ matrix.os }}
38-
needs: release
40+
# needs: release
3941

4042
strategy:
4143
matrix:
@@ -113,17 +115,29 @@ jobs:
113115
}
114116
115117
python setup.py sdist bdist_wheel
116-
117-
- name: Upload Assets
118-
uses: shogo82148/actions-upload-release-asset@v1
118+
119+
- uses: actions/upload-artifact@v3
120+
if: runner.os == 'Linux'
119121
with:
120-
upload_url: ${{ needs.release.outputs.upload_url }}
121-
asset_path: ./dist/*.whl
122+
name: 'linux-cuda-wheels'
123+
path: ./dist/*.whl
124+
125+
- uses: actions/upload-artifact@v3
126+
if: runner.os == 'Windows'
127+
with:
128+
name: 'windows-cuda-wheels'
129+
path: ./dist/*.whl
130+
131+
# - name: Upload Assets
132+
# uses: shogo82148/actions-upload-release-asset@v1
133+
# with:
134+
# upload_url: ${{ needs.release.outputs.upload_url }}
135+
# asset_path: ./dist/*.whl
122136

123137
build_rocm_wheels:
124138
name: Build AWQ with ROCm
125139
runs-on: ${{ matrix.os }}
126-
needs: release
140+
# needs: release
127141

128142
strategy:
129143
matrix:
@@ -225,8 +239,20 @@ jobs:
225239
226240
ROCM_VERSION=${{ matrix.rocm }} python setup.py sdist bdist_wheel
227241
228-
- name: Upload Assets
229-
uses: shogo82148/actions-upload-release-asset@v1
242+
- uses: actions/upload-artifact@v3
243+
if: runner.os == 'Linux'
244+
with:
245+
name: 'linux-cuda-wheels'
246+
path: ./dist/*.whl
247+
248+
- uses: actions/upload-artifact@v3
249+
if: runner.os == 'Windows'
230250
with:
231-
upload_url: ${{ needs.release.outputs.upload_url }}
232-
asset_path: ./dist/*.whl
251+
name: 'windows-cuda-wheels'
252+
path: ./dist/*.whl
253+
254+
# - name: Upload Assets
255+
# uses: shogo82148/actions-upload-release-asset@v1
256+
# with:
257+
# upload_url: ${{ needs.release.outputs.upload_url }}
258+
# asset_path: ./dist/*.whl

setup.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import torch
33
import platform
44
import requests
5-
import importlib_metadata
65
from pathlib import Path
76
from setuptools import setup, find_packages
87

@@ -94,9 +93,13 @@ def get_kernels_whl_url(
9493
]
9594

9695
try:
97-
importlib_metadata.version("autoawq-kernels")
96+
if ROCM_VERSION:
97+
import exlv2_ext
98+
else:
99+
import awq_ext
100+
98101
KERNELS_INSTALLED = True
99-
except importlib_metadata.PackageNotFoundError:
102+
except ImportError:
100103
KERNELS_INSTALLED = False
101104

102105
# kernels can be downloaded from pypi for cuda+121 only

0 commit comments

Comments
 (0)