ho22joshua commited on
Commit
3efae5d
·
1 Parent(s): 916755e

ci: support macOS core development

Browse files
.github/workflows/ci.yml CHANGED
@@ -34,6 +34,18 @@ jobs:
34
  - run: uv sync --dev
35
  - run: uv run pytest
36
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  package:
38
  name: package
39
  runs-on: ubuntu-latest
 
34
  - run: uv sync --dev
35
  - run: uv run pytest
36
 
37
+ test-macos:
38
+ name: test (macOS core)
39
+ runs-on: macos-14
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - uses: astral-sh/setup-uv@v6
43
+ with:
44
+ version: "0.8.x"
45
+ enable-cache: true
46
+ - run: uv sync --dev
47
+ - run: uv run pytest tests/unit tests/integration -m "not gpu"
48
+
49
  package:
50
  name: package
51
  runs-on: ubuntu-latest
README.md CHANGED
@@ -19,20 +19,24 @@ historical checkpoint investigation, not a supported runtime backend.
19
 
20
  ## Installation
21
 
22
- The supported development environment is Python 3.12 (`>=3.12,<3.13`), with
23
- PyTorch 2.2.2 and the optional ROOT-GNN stack DGL 2.4.0. The canonical setup
24
- is:
25
 
26
  ```bash
 
 
 
 
27
  uv sync --dev --extra root-gnn
28
  ```
29
 
30
  The core package can be installed without DGL when only shared data or task
31
  code is needed. ROOT-GNN models, graph construction, and ROOT-GNN parity tests
32
- require the `root-gnn` extra. The DGL extra uses the validated CUDA 12.1 wheel
33
- source configured in `pyproject.toml`; a compatible NVIDIA driver is still
34
- required. Do not add site-specific CUDA, Slurm, or filesystem paths to model
35
- or task configuration.
 
36
 
37
  ## Quick start
38
 
 
19
 
20
  ## Installation
21
 
22
+ The supported development environment is Python 3.12 (`>=3.12,<3.13`). Core
23
+ development is supported on macOS and Linux:
 
24
 
25
  ```bash
26
+ # macOS (Apple Silicon): core package development and CPU tests
27
+ uv sync --dev
28
+
29
+ # Linux x86_64 with an NVIDIA GPU: validated ROOT-GNN development
30
  uv sync --dev --extra root-gnn
31
  ```
32
 
33
  The core package can be installed without DGL when only shared data or task
34
  code is needed. ROOT-GNN models, graph construction, and ROOT-GNN parity tests
35
+ require the `root-gnn` extra on Linux x86_64. That extra uses the validated
36
+ CUDA 12.1 wheel sources configured in `pyproject.toml`; a compatible NVIDIA
37
+ driver is still required. On macOS, use the core environment for shared code,
38
+ configuration, linting, and tests that do not require DGL or CUDA. Do not add
39
+ site-specific CUDA, Slurm, or filesystem paths to model or task configuration.
40
 
41
  ## Quick start
42
 
docs/testing.md CHANGED
@@ -19,6 +19,10 @@ uv run pytest -m gpu -v
19
  GNN4COLLIDERS_ROOT_FIXTURE=/path/to/reduced.root uv run pytest -m real_data -v
20
  ```
21
 
 
 
 
 
22
  Unit tests use deterministic, small tensors and generated ROOT files. DGL,
23
  ONNX, CUDA, distributed execution, and reduced real-data fixtures remain
24
  optional layers. Tests should assert public contracts and scientific
 
19
  GNN4COLLIDERS_ROOT_FIXTURE=/path/to/reduced.root uv run pytest -m real_data -v
20
  ```
21
 
22
+ On macOS, use `uv sync --dev` and run the shared-package tests. ROOT-GNN,
23
+ CUDA, and the required ROOT-GNN parity gate are validated on Linux x86_64 with
24
+ the `root-gnn` extra installed.
25
+
26
  Unit tests use deterministic, small tensors and generated ROOT files. DGL,
27
  ONNX, CUDA, distributed execution, and reduced real-data fixtures remain
28
  optional layers. Tests should assert public contracts and scientific
pyproject.toml CHANGED
@@ -19,7 +19,7 @@ dependencies = [
19
 
20
  [project.optional-dependencies]
21
  root-gnn = [
22
- "dgl==2.4.0+cu121",
23
  ]
24
  onnx = [
25
  "onnx>=1.16,<2",
@@ -50,12 +50,11 @@ version = { attr = "gnn4colliders.__version__" }
50
  "gnn4colliders.configs" = ["*.yaml", "*/*.yaml", "*/*/*.yaml"]
51
 
52
  [tool.uv.sources]
53
- torch = { index = "pytorch-cu121" }
54
- dgl = { index = "dgl" }
55
-
56
- [tool.uv]
57
- environments = [
58
- "sys_platform == 'linux' and platform_machine == 'x86_64' and python_full_version >= '3.12' and python_full_version < '3.13'",
59
  ]
60
 
61
  [[tool.uv.index]]
 
19
 
20
  [project.optional-dependencies]
21
  root-gnn = [
22
+ "dgl==2.4.0+cu121; sys_platform == 'linux' and platform_machine == 'x86_64'",
23
  ]
24
  onnx = [
25
  "onnx>=1.16,<2",
 
50
  "gnn4colliders.configs" = ["*.yaml", "*/*.yaml", "*/*/*.yaml"]
51
 
52
  [tool.uv.sources]
53
+ torch = [
54
+ { index = "pytorch-cu121", marker = "sys_platform == 'linux' and platform_machine == 'x86_64'" },
55
+ ]
56
+ dgl = [
57
+ { index = "dgl", marker = "sys_platform == 'linux' and platform_machine == 'x86_64'" },
 
58
  ]
59
 
60
  [[tool.uv.index]]
tests/unit/graphs/test_dgl_graph.py CHANGED
@@ -1,7 +1,10 @@
 
1
  import torch
2
 
3
  from gnn4colliders.graphs import build_dgl_graph
4
 
 
 
5
 
6
  def test_build_dgl_graph_attaches_compatible_features():
7
  node_features = torch.tensor(
 
1
+ import pytest
2
  import torch
3
 
4
  from gnn4colliders.graphs import build_dgl_graph
5
 
6
+ pytest.importorskip("dgl")
7
+
8
 
9
  def test_build_dgl_graph_attaches_compatible_features():
10
  node_features = torch.tensor(
uv.lock CHANGED
The diff for this file is too large to render. See raw diff