Efficient Poincaré Convolutions through Patch-Statistics Factorization
Organizations: Department of Computer Science, Faculty of Electrical Engineering and Computer Science, VSB–Technical University of Ostrava, 17. listopadu 2172/15, 708 00 Ostrava-Poruba, Czech Republic
Abstract
Published implementations of the Poincaré convolution in Hyperbolic Neural Networks++ (HNN++) map every overlapping image patch to the Poincaré ball before evaluating its score. We show that the clipped score depends on each patch only through two statistics, its squared norm and its inner products with the filters, which a native convolution and a single-channel box filter compute directly. The factorized layer therefore evaluates the specified score exactly, without constructing ball-valued patches, and its single-precision outputs and gradients agree with double-precision evaluations at least as closely as those of the explicit reference. On an RTX A6000 under two versions of JAX, complete training updates of a Poincaré U-Net and a Poincaré ResNet-20 are 1.5 to 1.8 times faster than the faster of two explicit implementations that map patches to the ball (1.2 to 1.4 times against an explicit implementation that skips this mapping); on a V100, the gain over the gather-based one persists as the ResNet-20 is widened eightfold. In 15 paired training runs per task, updates are 2.0 and 1.8 times faster than a reference that follows the published execution order, with no consistent change in final segmentation or classification quality, and peak memory falls by 38 to 55% in a U-Net scaling study. Replacing the convolutions of the official PyTorch Hyperbolic U-Net makes its training step 1.4 times faster with half the memory. Evaluating an existing layer from its patch statistics thus makes Poincaré convolutional networks cheaper to train in the tested models and software stacks.
Figures & tables
| Setting | ISIC16: Poincaré U-Net | CIFAR-100: Poincaré ResNet-20 |
|---|---|---|
| Data split | 810 training / 90 development / 379 test | 45,000 training / 5,000 development / 10,000 test |
| Architecture | Depth 4; widths | Three residual groups; widths |
| Parameters | 486,941; 19 spatial convolutions | 71,727; 21 spatial convolutions |
| Curvature | Learned, initialized at | Fixed at |
| Training budget | Batch 8; 50 epochs; 5,100 updates | Batch 128; 100 epochs; 35,200 updates |
| Loss | Dice and focal loss | Cross entropy |
| Outputs | Gradients | ||||||
|---|---|---|---|---|---|---|---|
| Path | Run | Passed | Precision | Median | Max | Median | Max |
| F | Accepted | 1,360 / 1,360 | FP32 | ||||
| FP64 | |||||||
| Replay | 1,328 / 1,360 | FP32 | |||||
| FP64 | |||||||
| T | Accepted | 1,327 / 1,360 | FP32 | ||||
| Workload | Forward | Forward + gradient |
|---|---|---|
| S1: , | ||
| S2: , | ||
| S3: , | ||
| Conv–BN–ReLU | ||
| Four-layer dense stack |
| Workload | Path | Time (ms) | Speedup [95% interval] | Peak (GiB) |
|---|---|---|---|---|
| Batch 1, forward | R | 9.83 | – | 0.237 |
| F | 5.14 | 0.395 | ||
| E | 1.24 | – | 0.395 | |
| Batch 8, forward | R | 48.44 | – | 0.885 |
| F | 17.86 | 0.619 | ||
| E | 3.59 | – | 0.619 |
| Workload | Path | Time (ms) | [95% interval] | Peak (GiB) |
|---|---|---|---|---|
| U-Net, batch 8, forward | R | 37.56 | – | 1.400 |
| Rg | 25.02 | 0.432 | ||
| Mg | 18.80 | 0.432 | ||
| F | 13.97 | 0.182 | ||
| E | 3.09 | 0.182 | ||
| U-Net, batch 8, update | R | 105.18 | – | 5.581 |
| Workload | JAX | Over R | Over Rg | Over Mg | F / E |
|---|---|---|---|---|---|
| U-Net, batch 8, forward | 0.4.25 | 4.5 | |||
| 0.11.2 | 5.7 | ||||
| U-Net, batch 8, update | 0.4.25 | 3.2 | |||
| 0.11.2 | 5.7 | ||||
| ResNet-20, batch 128, update | 0.4.25 | 3.2 | |||
| 0.11.2 | 4.8 |
| Width | Parameters | Over Rg | Over R | Peak R / Rg / F (GiB) |
|---|---|---|---|---|
| 71,727 | 2.00 / 1.70 / 1.01 | |||
| 278,247 | 3.66 / 2.95 / 1.85 | |||
| 1,096,023 | 7.04 / 4.81 / 3.42 | |||
| 4,350,519 | 13.88 / 9.39 / 6.67 |
| Training updates | Elapsed worker time | |||||
|---|---|---|---|---|---|---|
| Task | GPU | Seeds | R / F (min) | Speedup | R / F (min) | Speedup |
| ISIC16 | V100 | 5 | 10.76 / 5.92 | 25.06 / 19.02 | ||
| A6000 | 15 | 8.98 / 4.45 | 12.44 / 7.58 | |||
| CIFAR-100 | V100 | 5 | 30.65 / 22.91 | 53.37 / 48.75 | ||
| A6000 | 15 | 23.93 / 13.56 | 35.37 / 21.38 | |||
| Task / metric | GPU | R | F | F minus R [95% interval] |
|---|---|---|---|---|
| ISIC16 Dice | V100 | |||
| A6000 | ||||
| CIFAR-100 top-1 | V100 | |||
| A6000 |
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | V100 | RTX A6000 |
|---|---|---|
| Python / JAX | 3.11.16 / 0.4.25 | Same |
| jaxlib | 0.4.25+cuda11.cudnn86 | Same |
| NumPy / SciPy | 1.26.4 / 1.11.4 | Same |
| CUDA runtime | 11.8.89 | Same |
| cuDNN / cuBLAS | 8.6.0.163 / 11.11.3.6 | Same |
| NVIDIA driver | 520.61.05 | 560.35.03 |
| Workload | Boundary | [95% interval] |
|---|---|---|
| S2 | Forward | |
| S3 | Forward | |
| S2 | Forward + gradient | |
| S3 | Forward + gradient | |
| U-Net, batch 8 | Complete update | |
| ISIC16 U-Net | Training updates |
| Task | GPU | Endpoint | F minus R [95% interval] |
|---|---|---|---|
| ISIC16 | V100 | Duplicate-excluded | |
| A6000 | Duplicate-excluded | ||
| V100 | Development-selected | ||
| A6000 | Development-selected | ||
| CIFAR-100 | V100 | Duplicate-excluded | |
| A6000 | Duplicate-excluded |
| Boundary | Mode | ||
|---|---|---|---|
| S1 ( , ) | forward | 1.833 [1.740, 1.932] | 1.864 [1.825, 1.904] |
| fwd+grad | 2.070 [1.940, 2.210] | 1.970 [1.769, 2.194] | |
| S2 ( , ) | forward | 9.581 [9.478, 9.685] | 10.110 [10.011, 10.210] |
| fwd+grad | 3.382 [3.310, 3.457] | 2.818 [2.755, 2.883] | |
| S3 ( , ) | forward | 25.810 [25.027, 26.618] | 27.228 [26.683, 27.783] |
| fwd+grad | 5.668 [5.585, 5.752] | 4.996 [4.912, 5.082] |
| Boundary | Variant | Latency (ms) | Speedup [95% interval] | Peak live (GiB) |
|---|---|---|---|---|
| Batch-1 forward | R | 9.831 | – | 0.237 |
| F | 5.143 | 1.864 [1.787, 1.944] | 0.395 | |
| T | 5.222 | 1.890 [1.854, 1.926] | 0.395 | |
| Batch-8 forward | R | 48.438 | – | 0.885 |
| F | 17.858 | 2.687 [2.608, 2.768] | 0.619 | |
| T | 17.655 | 2.741 [2.678, 2.804] | 0.619 |
| Task / metric | Path | Mean SD | Difference [95% interval] | Update speedup |
|---|---|---|---|---|
| ISIC16 Dice | R | – | – | |
| F | [ , ] | 1.821 [1.716, 1.934] | ||
| T | [ , ] | 1.758 [1.593, 1.940] | ||
| CIFAR-100 top-1 | R | – | – | |
| F | [ , ] | 1.343 [1.192, 1.512] | ||
| T | [ , ] | 1.329 [1.167, 1.513] |
| Task | Seed | R | F | T | F–R | T–R |
|---|---|---|---|---|---|---|
| ISIC16 Dice | 11 | 0.87927 | 0.86861 | 0.87532 | ||
| 29 | 0.87179 | 0.83465 | 0.86054 | |||
| 47 | 0.83940 | 0.85263 | 0.86709 | |||
| 71 | 0.87158 | 0.85589 | 0.86329 | |||
| 101 | 0.86841 | 0.86858 | 0.86343 | |||
| CIFAR-100 top-1 | 11 | 0.4942 | 0.5079 | 0.4841 |
| ISIC16 Dice | CIFAR-100 top-1 | |||||
|---|---|---|---|---|---|---|
| Seed | R | F | F–R | R | F | F–R |
| 205785622 | 0.81872 | 0.84830 | 0.4978 | 0.5064 | ||
| 458014223 | 0.86188 | 0.85724 | 0.5023 | 0.4879 | ||
| 565813932 | 0.87312 | 0.87395 | 0.4981 | 0.4970 | ||
| 646228129 | 0.86857 | 0.87216 | 0.5024 | 0.5007 | ||
| 821637680 | 0.87377 | 0.87369 | 0.4911 | 0.4959 | ||
| GPU | Outcome | Path | Mean / ratio | Difference [95% interval] |
| V100 | Duplicate-excluded Dice | F | – | [ , ] |
| T | – | [ , ] | ||
| V100 | Final foreground IoU | R | 0.78809 | – |
| F | 0.77622 | [ , ] | ||
| T | 0.78664 | [ , ] | ||
| V100 | Validation-selected Dice | R | 0.86624 | – |
| GPU | Outcome | Path | Mean / ratio | Difference [95% interval] |
| V100 | Duplicate-excluded top-1 | F | – | [ , ] |
| T | – | [ , ] | ||
| V100 | Validation-selected top-1 | R | 0.50244 | – |
| F | 0.50236 | [ , ] | ||
| T | 0.49490 | [ , ] | ||
| V100 | Final cross-entropy | R | – |
| Path | Module span (ms) | Kernel time (ms/call) | Launches | Reduction share |
|---|---|---|---|---|
| R | 102.697 | 119.099 | 4,121 | 49.80% |
| F | 54.369 | 59.060 | 3,603 | 64.59% |
| T | 53.862 | 60.926 | 3,503 | 62.38% |
| Precision | Path | Tensors | Passed | Median | Max p99 | Max p99.9 | Maximum |
|---|---|---|---|---|---|---|---|
| FP32 | F | Outputs | 20/20 | 0 | |||
| FP32 | F | Gradients | 628/660 | ||||
| FP32 | T | Outputs | 20/20 | 0 | |||
| FP32 | T | Gradients | 660/660 | ||||
| FP64 | F | Outputs | 20/20 | 0 | |||
| FP64 | F | Gradients | 660/660 |
| GPU | Seed | R | F | F–R |
|---|---|---|---|---|
| V100 | 11 | 0.0670 | 0.0686 | |
| 29 | 0.0684 | 0.0901 | ||
| 47 | 0.0873 | 0.0782 | ||
| 71 | 0.0741 | 0.0717 | ||
| 101 | 0.0662 | 0.0796 | ||
| A6000 | 205785622 | 0.0892 | 0.0829 |
| Tensors | Path | Median rel. L2 | Max rel. L2 | Max abs. | Median p99 | / |
|---|---|---|---|---|---|---|
| Outputs (20) | R | – | ||||
| F | – | |||||
| T | – | |||||
| Gradients (660) | R | |||||
| F | ||||||
| T |
| Workload | Boundary | HypLL (ms) | F (ms) | Speedup [95% interval] | Peak (GiB) |
|---|---|---|---|---|---|
| S1 | forward | 0.988 | 0.645 | 1.524 [1.493, 1.555] | 0.084 / 0.020 |
| forward + gradient | 6.693 | 3.976 | 1.426 [1.042, 1.953] | 0.184 / 0.048 | |
| S2 | forward | 25.084 | 5.077 | 4.940 [4.932, 4.947] | 2.387 / 0.575 |
| forward + gradient | 152.205 | 24.325 | 6.255 [6.247, 6.264] | 5.288 / 1.368 | |
| S3 | forward | 69.746 | 7.301 | 9.555 [9.549, 9.562] | 7.137 / 0.825 |
| forward + gradient | 422.852 | 36.232 | 11.673 [11.663, 11.684] | 15.663 / 1.743 |
| Largest layer fraction | Largest | |||||
|---|---|---|---|---|---|---|
| Task | Path | All-layer fraction | Pooled | One checkpoint | All layers | First conv. |
| ISIC16 U-Net | R | 0 | 0 | 0 | 0.9425 | 0.4430 |
| F | 0 | 0 | 0 | 0.9224 | 0.4491 | |
| CIFAR-100 ResNet-20 | R | 0.9964 | 0.4694 | |||
| F | 0.9964 | 0.4694 | ||||
| Paths | R controls | ||||
|---|---|---|---|---|---|
| Task | State | F | T | R repeat | R one-ulp |
| ISIC16 U-Net | R | 0 | |||
| F | 0 | ||||
| T | 0 | ||||
| CIFAR-100 ResNet-20 | R | ||||
| F | |||||
| States | F | T | R | R, no stem | R in FP64 |
|---|---|---|---|---|---|
| ResNet-20, final (15) | 8.7e-4 (3.0e-3) | 5.5e-4 (1.9e-3) | 0.11 (0.16) | 6.5e-4 (3.2e-3) | 0.042 (0.11) |
| ResNet-20, mid (15) | 3.1e-4 (7.1e-4) | 3.7e-4 (1.9e-3) | 0.070 (0.13) | 3.7e-4 (1.4e-3) | 0.024 (0.050) |
| U-Net, final (10) | 3.0e-5 (4.2e-4) | 3.3e-5 (7.8e-4) | 2.0e-5 (1.3e-4) | – | 6.6e-15 (1.2e-14) |
| Cohort | Checkpoint | R | F | T |
|---|---|---|---|---|
| CIFAR-100, V100 (5 seeds) | Mid-training | 1.00 [0.91, 1.14] | 0.79 [0.74, 0.87] | 0.81 [0.78, 0.98] |
| Final | 21.2 [6.17, 61.3] | 1.08 [1.03, 1.22] | 1.10 [1.03, 1.30] | |
| Final, repeated R | 1.16 [1.02, 1.51] | – | – | |
| CIFAR-100, A6000 (15 seeds) | Final | 1.18 [1.05, 1.49] | 1.10 [0.96, 1.63] | – |
| ISIC16, V100 (5 seeds) | Final | 0.46 [0.45, 0.50] | 0.48 [0.47, 0.52] | 0.48 [0.48, 0.49] |
| ISIC16, A6000 (15 seeds) | Final | 0.47 [0.43, 0.53] | 0.49 [0.43, 0.58] | – |
| Workload | R | Rg | Mg | F | E |
|---|---|---|---|---|---|
| U-Net, batch 8, forward | 33.77 / 0.963 | 23.97 / 0.596 | 17.59 / 0.686 | 19.81 / 0.619 | 3.48 / 0.619 |
| U-Net, batch 8, update | 114.74 / 4.687 | 104.57 / 4.352 | 85.81 / 3.443 | 68.87 / 2.386 | 11.96 / 0.639 |
| ResNet-20, batch 128, update | 35.40 / 1.537 | 43.94 / 1.485 | 29.48 / 1.150 | 20.74 / 0.817 | 4.32 / 0.221 |
| Rg | F | |||
|---|---|---|---|---|
| Category | 0.4.25 | 0.11.2 | 0.4.25 | 0.11.2 |
| Convolution | – | – | 5.5 | 5.3 |
| Matrix multiplication | 10.0 | 6.5 | 0.3 | 0.3 |
| Reduction | 51.2 | 67.8 | 32.1 | 48.1 |
| Transpose | – | – | 2.3 | 2.5 |
| Other | 26.8 | 5.3 | 6.8 | 9.5 |
| Model | Quantity | Rg | R repeated |
|---|---|---|---|
| U-Net | Gradients | / | 0 / 0 |
| Parameters after 20 updates | 0.046 / | 0 / 0 | |
| ResNet-20 | Stem weight gradient | 0.027 / 0.27 | / 0.032 |
| Other gradients | 0.033 / | 0 / 0 | |
| Parameters after 20 updates | 0.089 / | / |
Convolutional Neural Networks
Convolutional neural networks (CNNs) learn spatial and temporal patterns using shared filters, with applications from image recognition to scientific prediction.
See all 439 papers