-
Notifications
You must be signed in to change notification settings - Fork 34
70 lines (61 loc) · 1.93 KB
/
Copy pathgpu_compat.yml
File metadata and controls
70 lines (61 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: GPU compatibility
on:
workflow_dispatch:
inputs:
backend:
description: "Installer backend to test"
required: true
default: "cu128"
type: choice
options:
- cu128
- cu130
pytest_mark:
description: "Pytest marker expression"
required: true
default: "not slow"
run_pytest:
description: "Run pytest after install and CUDA smoke"
required: true
default: true
type: boolean
jobs:
gpu-compat:
if: github.repository_owner == 'deepmodeling'
runs-on: [self-hosted, linux-x64, gpu]
timeout-minutes: 180
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Add safe directory
run: git config --global --add safe.directory "${GITHUB_WORKSPACE}"
- name: Show GPU
run: |
nvidia-smi
- name: Install DeePTB GPU stack
run: |
bash install.sh "${{ inputs.backend }}" --extra pythtb
- name: CUDA and torch-scatter smoke
run: |
.venv/bin/python - <<'PY'
import torch
import torch_scatter
from importlib import metadata
print("torch", torch.__version__, "cuda runtime", torch.version.cuda)
print("torch-scatter", metadata.version("torch-scatter"))
assert torch.cuda.is_available(), "CUDA is not available after GPU install"
x = torch.randn(16, device="cuda")
index = torch.tensor(
[0, 0, 1, 1, 2, 2, 3, 3, 0, 1, 2, 3, 0, 1, 2, 3],
device="cuda",
)
out = torch_scatter.scatter_add(x, index)
assert out.shape == (4,)
print("scatter_add", out.shape, out.dtype, out.device)
PY
- name: Run pytest
if: inputs.run_pytest
run: |
.venv/bin/python -m pytest dptb/tests -m "${{ inputs.pytest_mark }}" -q