Skip to content

Commit 9602816

Browse files
Added CI to test CUDA C++ Extension Builds. (#99)
* Added CI integration. * Updated requirements file. * Installed NVIDIA CUDA toolkit on CI machine. * Included apt-get update. * No need to have CUDA available to build the extension. * Added badge and updated README.
1 parent e40d21f commit 9602816

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
numpy==2.2.5
2+
torch==2.7.0 --index-url https://download.pytorch.org/whl/cu128
3+
pytest==8.3.5
4+
ninja==1.11.1.4
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: OEQ CUDA C++ Extension Build Verification
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
types: [ labeled ]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
verify_cuda_extension:
15+
if: ${{ github.event.label.name == 'ci-ready' || github.event_name != 'pull_request' }}
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.10"
24+
cache: 'pip'
25+
cache-dependency-path: '**/requirements_cuda_ci.txt'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
sudo apt-get update
30+
sudo apt install nvidia-cuda-toolkit
31+
pip install -r .github/workflows/requirements_cuda_ci.txt
32+
pip install -e .
33+
34+
- name: Test extension build via import
35+
run: |
36+
pytest tests/import_test.py -k test_import

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# OpenEquivariance
2+
[![OEQ CUDA C++ Extension Build Verification](https://github.com/PASSIONLab/OpenEquivariance/actions/workflows/verify_extension_build.yml/badge.svg?event=push)](https://github.com/PASSIONLab/OpenEquivariance/actions/workflows/verify_extension_build.yml)
3+
[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
24

35
[[Examples]](#show-me-some-examples) [[Installation]](#installation)
46
[[Supported Tensor Products]](#tensor-products-we-accelerate)

openequivariance/extlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
torch_sources = ['torch_tp_jit.cpp']
2525

2626
include_dirs, extra_link_args = ['util'], None
27-
if torch.cuda.is_available() and torch.version.cuda:
27+
if torch.version.cuda:
2828
extra_link_args = ['-Wl,--no-as-needed', '-lcuda', '-lcudart', '-lnvrtc']
2929

3030
try:
@@ -36,7 +36,7 @@
3636
getLogger().info(str(e))
3737

3838
extra_cflags.append("-DCUDA_BACKEND")
39-
elif torch.cuda.is_available() and torch.version.hip:
39+
elif torch.version.hip:
4040
extra_link_args = [ '-Wl,--no-as-needed', '-lhiprtc']
4141

4242
def postprocess(kernel):

0 commit comments

Comments
 (0)