-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: investigate why extensions are not compiled
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Investigate Linux compilation issues | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "optimum/quanto/**" | ||
- "examples/**" | ||
- "pyproject.toml" | ||
pull_request: | ||
types: [assigned, opened, synchronize, reopened] | ||
paths: | ||
- "optimum/quanto/**" | ||
- "examples/**" | ||
- "pyproject.toml" | ||
|
||
jobs: | ||
investigate: | ||
runs-on: [self-hosted, single-gpu , nvidia-gpu, a10, ci] | ||
strategy: | ||
fail-fast: false | ||
container: | ||
image: pytorch/pytorch:2.3.1-cuda12.1-cudnn8-devel | ||
options: --gpus 0 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Check CUDA installation | ||
run: | | ||
nvcc -V | ||
- name: Build and install packages | ||
run: | | ||
pip install --upgrade pip | ||
pip install .[examples] | ||
# Run examples | ||
- name: Run Dummy example | ||
run: | | ||
pip show -f optimum-quanto | ||
python examples/check_extension_compiled.py |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import torch | ||
from optimum.quanto.library.ext.cpp import ext as cpp_ext | ||
from optimum.quanto.library.ext.cuda import ext as cuda_ext | ||
|
||
assert cpp_ext.lib is not None | ||
print("CPP extension is available") | ||
if torch.cuda.is_available(): | ||
assert cuda_ext.lib is not None | ||
print("CUDA extension is available") |
This file contains 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