You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(sync): GPU (torch/Metal/CUDA) and numba backends for all 9 metrics (#264)
Add hardware-accelerated backends to all connectivity metrics:
- numba JIT (prange): PLV, CCorr, Coh, ImCoh, PLI, wPLI, EnvCorr, PowCorr
- PyTorch MPS/CUDA/CPU (einsum): all 9 metrics
- Metal compute shaders: PLI, wPLI, ACCorr (Apple Silicon)
- CUDA raw kernels (CuPy): all 9 metrics (NVIDIA GPUs)
Benchmark-driven AUTO_PRIORITY compiled from Mac M4 Max (131 runs) and
Narval A100 (111 runs). The 'auto' optimization selects the best GPU
backend per metric and platform:
- MPS: torch for einsum metrics, Metal for sign-based + ACCorr
- CUDA: cuda_kernel first (OOM-safe at 512ch), torch as fallback
Add `priority` parameter on get_metric() and compute_sync() for custom
backend ordering.
New optional deps: pyobjc-framework-Metal, cupy-cuda12x.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- PyTorch (MPS/CUDA/CPU) via batched einsum: all 9 metrics
14
+
- Metal compute shaders (Apple Silicon): PLI, wPLI, ACCorr
15
+
- CUDA raw kernels via CuPy (NVIDIA GPUs): all 9 metrics
16
+
- Benchmark-driven `AUTO_PRIORITY` table for `optimization='auto'`, compiled from
17
+
Mac M4 Max (131 runs) and Narval A100 (111 runs) benchmarks
18
+
-`priority` parameter on `get_metric()` and `compute_sync()` for custom backend ordering
19
+
-`hypyp/sync/kernels/` submodule with Metal and CUDA dispatch infrastructure
20
+
- New optional dependencies: `pyobjc-framework-Metal` (Apple), `cupy-cuda12x` (NVIDIA)
21
+
-`multiply_conjugate_torch` and `multiply_conjugate_time_torch` GPU helpers
12
22
13
23
### Changed
14
24
-**BREAKING**: `accorr` metric now returns raw connectivity values with shape `(n_epoch, n_freq, 2*n_ch, 2*n_ch)` like all other metrics. The `swapaxes` and `epochs_average` operations are now handled by `compute_sync()` instead of being applied inside the metric.
@@ -18,7 +28,7 @@
18
28
-`_multiply_conjugate()` in analyses.py - use `hypyp.sync.multiply_conjugate` instead (will be removed in 1.0.0)
19
29
-`_multiply_conjugate_time()` in analyses.py - use `hypyp.sync.multiply_conjugate_time` instead (will be removed in 1.0.0)
20
30
-`_multiply_product()` in analyses.py - use `hypyp.sync.multiply_product` instead (will be removed in 1.0.0)
21
-
-`_accorr_hybrid()` in analyses.py - use `hypyp.sync.ACorr` instead (will be removed in 1.0.0)
31
+
-`_accorr_hybrid()` in analyses.py - use `hypyp.sync.ACCorr` instead (will be removed in 1.0.0)
0 commit comments