Repository navigation
Module_GPU_Policy
Location: Home / GPU policy
Conclusion (0.9+): The main Vorcyc.Mathematics NuGet package does not include and does not plan to ship built-in GPU / CUDA acceleration. Historical ILGPU dependencies and experimental CudaFFT code have been removed. All numerical computation runs on the CPU, with execution policy provided by ComputingContext (scalar / SIMD / multithreaded parallel).
📒Contents
- 🔖 Removed items
- 🔖 Why the main package drops GPU
- 🔖 Current performance path
- 🔖 If you still need more compute
- 🔖 Possible future direction
- 🔖 Impact on users
| Item | Description |
|---|---|
| NuGet dependencies |
ILGPU and ILGPU.Algorithms removed from dotNET10_Portable
|
| Source code |
CudaFFT, CudaFastFourierTransform, CUDA_FFT deleted (long unmaintained, incorrect results) |
| Public API | Main package no longer provides CudaFFT or other CUDA FFT types |
| Tests |
CuFFT_test deleted |
These capabilities were never released as stable public features; documentation and README wording about “GPU compute (incomplete)” has been retired.
This is an active product and technical roadmap decision, not a temporary deferral.
The core library targets a pure .NET, portable, native-driver-free high-performance math stack. By default, users should be able to:
- Work on machines without NVIDIA GPUs
- Run on servers / CI / edge devices
- Use machines with only the .NET runtime installed
and dotnet add package Vorcyc.Mathematics without friction. Bundling CUDA into the main package would conflict with that goal.
Typical 0.9 scenarios include:
- Tabular machine learning (trees, KNN, Softmax, etc.) — no GPU benefit
- Small-scale custom DL (XOR, small CNN, MFCC classification) — small batches; PCIe transfer often exceeds compute gains
- Signal processing and MFCC — CPU + SIMD / parallel is sufficient
- Examples and tests — correctness and reproducibility first
At this scale, GPU maintenance cost is lower ROI than refining ComputingContext and CPU hot paths.
CudaFFT source once noted “results are wrong; do not use for now.” Keeping ILGPU would:
- Increase package size and transitive dependencies
- Create false expectations that GPU is supported
- Split focus away from CPU path testing and unified documentation
The choice is to remove experimental code and document clearly, rather than keep a “incomplete” label.
Full GPU training on the existing Trainer + hand-written Backward would require:
- A device memory model (
DeviceTensor) - Forward / backward kernels or cuDNN integration
- CPU/GPU numerical alignment tests
That is close to a separate product line. Without clear large-model training demand, it is not a main-package goal.
The main package uses a unified CPU execution strategy:
| Mechanism | Description |
|---|---|
ComputingContext |
Normal / Simd / Parallel / Auto
|
ComputingScope |
Block-level default policy |
| Hot-path coverage | FFT, statistical reductions, matrix multiply, VectorSpan, batch DL forward, parallel MFCC, training entry points, etc. |
Recommended usage:
using (ComputingScope.Enter(ComputingContext.Parallel))
{
// APIs with context:null inside the scope use Parallel
}
values.Sum(ComputingContext.Simd);
MatrixFp32.Multiply(a, b, ComputingContext.Parallel);
trainer.FitBatchSequential(..., computingContext: ComputingContext.Parallel);See the ComputingContext manual and the “Verification and tests” section.
Choose solutions outside the main package rather than expecting built-in CUDA:
| Need | Recommendation |
|---|---|
| Faster FFT (CPU native library) | Optional package Vorcyc.Mathematics.Extensions.FFTW
|
| Large-model / large-batch DL inference | Export to ONNX or similar; use ONNX Runtime (including CUDA EP) |
| Large-batch training | Use mature frameworks such as PyTorch / TensorFlow; this library’s DL module targets teaching and small-scale differentiable experiments |
| NVIDIA acceleration inside this solution | Wait for or implement an optional extension package (see below); do not assume the main package enables GPU by default |
If clear product demand appears later (e.g. large-batch inference, customer-mandated NVIDIA), GPU capability would ship as an optional extension package, following the FFTW extension pattern:
Vorcyc.Mathematics ← main package, CPU only, zero CUDA dependency
Vorcyc.Mathematics.Extensions.FFTW
Vorcyc.Mathematics.Extensions.* ← future: CUDA / other native backends (separate install)
Principles:
- Default main-package installs do not pull CUDA runtime, cufft/cublas DLLs, or driver version issues
- Extension packages are explicit references with explicit APIs or
ComputingContextBackend=Gpu(not implemented yet) - Main-package APIs and tests use CPU as the sole baseline
No GPU extension package exists in the current version; this document states architectural principles only and is not a release commitment.
- Do not reference
CudaFFTor ILGPU-related types; builds will fail. - For FFT, use
FastFourierTransform+ComputingContext, or the FFTW extension. - README “Dependencies” no longer lists ILGPU.
-
ComputingContextdescribes CPU modes only (CpuExecutionMode). - Enums such as
ComputingBackend.GPUremain placeholders; the main library does not use them at runtime. - “GPU / CUDA” in documentation refers to outside the main package; see this document.
If you believe a specific scenario must have GPU support within the Vorcyc ecosystem, include: data scale, batch size, latency targets, and inference-only vs training. That helps evaluate an extension package vs restoring main-package dependencies.
-
- 🔖 ArrayExtension class
- 🔖 BaseConverter class
- 🔖 BitMathExtension class
- 🔖 Combinatorics class
- 🔖 ConstantsFp32 class
- 🔖 NumberMapper class
- 🔖 PinnableArray<T> class
- 🔖 SimpleRNG_Fp32 and SimpleRNG_Fp64 classes
- 🔖 TrigonometryHelper class
- 🔖 VMath class
- 🔖 Pinned buffers (Buffers)
- 🔖 IPinnedBuffer<T> interface
- 🔖 POHBuffer<T> class
- 🔖 NativeBuffer<T> class
-
- 🔖 0.9 classifier walkthrough
- 🔖 KNN<T> class
- 🔖 MultipleLinearRegression<T> class
- 🔖 SimpleLinearRegression<T> class
- 🔖 SupportVectorMachine<TSelf> class
- 🔖 DBSCAN<T> class
- 🔖 ExpectationMaximization<T> class
- 🔖 GMM<T> class
- 🔖 HierarchicalClustering<T> class
- 🔖 KMeansClusterer<T> class
- 🔖 VectorQuantization<T> class
- 🔖 FactorAnalysis<T> class
- 🔖 PCA<TSelf> class
- 🔖 TSNE<T> class
- 🔖 Distance metric classes
-
📒 Examples
-
📒 GPU 策略说明
- 🔖 为何放弃主包 GPU
- 🔖 当前性能路径
- 🔖 若仍需要更强算力
-
📒 计算上下文模块
-
📒 核心模块
-
📒 深度学习模块
-
📒 线性代数模块
-
📒 机器学习模块
- 🔖 0.9 分类器完整示例
- 🔖 KNN<T> 类
- 🔖 MultipleLinearRegression<T> 类
- 🔖 SimpleLinearRegression<T> 类
- 🔖 SupportVectorMachine<TSelf> 类
- 🔖 DBSCAN<T> 类
- 🔖 ExpectationMaximization<T> 类
- 🔖 GMM<T> 类
- 🔖 HierarchicalClustering<T> 类
- 🔖 KMeansClusterer<T> 类
- 🔖 VectorQuantization<T> 类
- 🔖 FactorAnalysis<T> 类
- 🔖 PCA<TSelf> 类
- 🔖 TSNE<T> 类
- 🔖 距离度量类
-
📒 信号处理模块
-
📒 数值模块
-
📒 统计模块
- 🔖 基础统计函数
- 🔖 高级统计函数
- 🔖 稳健统计 / RunningMoments
- 🔖 其它统计函数
- 🔖 分布相关函数
- 🔖 时间序列分析
- 🔖 IComparable 扩展
- 🔖 ExtremeValueFinder
- 🔖 INumber 扩展
-
📒 FFTW 扩展
-
📒 示例