ignis-numerics 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +15 -0
- data/lib/ignis-numerics.rb +62 -0
- data/lib/nvruby/array.rb +646 -0
- data/lib/nvruby/fft/cufft_bindings.rb +134 -0
- data/lib/nvruby/fft/fft_plan.rb +288 -0
- data/lib/nvruby/fft/operations.rb +364 -0
- data/lib/nvruby/linalg/cutensor_bindings.rb +107 -0
- data/lib/nvruby/mathdx/fft_kernel.rb +258 -0
- data/lib/nvruby/mathdx/gemm_kernel.rb +293 -0
- data/lib/nvruby/mathdx.rb +73 -0
- data/lib/nvruby/random/curand_bindings.rb +115 -0
- data/lib/nvruby/random/generator.rb +305 -0
- data/lib/nvruby/solver/amgx_bindings.rb +172 -0
- data/lib/nvruby/solver/amgx_config.rb +142 -0
- data/lib/nvruby/solver/amgx_solver.rb +251 -0
- data/lib/nvruby/solver/cudss_bindings.rb +115 -0
- data/lib/nvruby/solver/cusolver_bindings.rb +358 -0
- data/lib/nvruby/solver/eigen.rb +226 -0
- data/lib/nvruby/solver/lu.rb +265 -0
- data/lib/nvruby/solver/sparse_solver.rb +429 -0
- data/lib/nvruby/solver/svd.rb +266 -0
- data/lib/nvruby/solver.rb +122 -0
- data/lib/nvruby/sparse/cusparse_bindings.rb +231 -0
- data/lib/nvruby/sparse/sparse_matrix.rb +456 -0
- data/lib/nvruby/tensor/contraction.rb +218 -0
- data/lib/nvruby/tensor.rb +42 -0
- metadata +85 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: cb5424db880779427450a67cf0467f1fdccff7cdf1e60bf9e51d25f946502983
|
|
4
|
+
data.tar.gz: 61d09d1019ce4d4113901bc2abf5605260dcf34f5ceda5b7481cd3eb57a5f928
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: f58e78ef1d9b2d401585717a301b184fba8252143060330e1f9bb33eb7f1035c959fbe1ec044c89551a153e4b7a1f2c8fe4573ed2b4019f1f499fbfb5be63c85
|
|
7
|
+
data.tar.gz: 9b9565f1ef0404fc2dcd7feb5c31c77b36b9e81827daf28e1f91badf23eb1e00ff5ab8190802c862465f63eb90c54f00d7baae8d18b08b6f1904fc8862461403
|
data/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# ignis-numerics
|
|
2
|
+
|
|
3
|
+
GPU numerical computing for Ruby (nvmath-style), on the [`ignis`](https://rubygems.org/gems/ignis) foundation. The lineage this project began from — an nvmath-python port — revived as a standalone gem.
|
|
4
|
+
|
|
5
|
+
Dense/sparse linear algebra, FFT (cuFFT), RNG (cuRAND), solvers & decompositions (cuSOLVER), and Einstein-notation tensor contraction (cuTENSOR).
|
|
6
|
+
|
|
7
|
+
```ruby
|
|
8
|
+
require "ignis-numerics"
|
|
9
|
+
a = Ignis::NvArray.from_array([[1.0, 2.0], [3.0, 4.0]], device: 0)
|
|
10
|
+
Ignis.matmul(a, a).to_a # GPU GEMM
|
|
11
|
+
Ignis.fft(signal) # cuFFT
|
|
12
|
+
Ignis.solve(matrix, rhs) # cuSOLVER
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires an NVIDIA GPU + CUDA runtime (cuFFT/cuRAND/cuSOLVER/cuSPARSE/cuTENSOR). MIT.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# ignis-numerics — nvmath-for-Ruby: GPU dense/sparse linear algebra, FFT, RNG, and
|
|
4
|
+
# tensor contraction (cuBLAS/cuFFT/cuRAND/cuSOLVER/cuSPARSE/cuTENSOR), built on the
|
|
5
|
+
# Ignis GPU foundation. This is the lineage NvRuby started from (an nvmath-python
|
|
6
|
+
# port), revived as a standalone gem. Provides the numerics array Ignis::NvArray and
|
|
7
|
+
# an nvmath-style module API (Ignis.fft, Ignis.solve, Ignis.zeros, …).
|
|
8
|
+
|
|
9
|
+
require "ignis"
|
|
10
|
+
|
|
11
|
+
# Numerics GPU array + creation helpers
|
|
12
|
+
require_relative "nvruby/array"
|
|
13
|
+
|
|
14
|
+
# cuFFT
|
|
15
|
+
require_relative "nvruby/fft/cufft_bindings"
|
|
16
|
+
require_relative "nvruby/fft/operations"
|
|
17
|
+
require_relative "nvruby/fft/fft_plan"
|
|
18
|
+
|
|
19
|
+
# cuRAND
|
|
20
|
+
require_relative "nvruby/random/curand_bindings"
|
|
21
|
+
require_relative "nvruby/random/generator"
|
|
22
|
+
|
|
23
|
+
# cuSPARSE
|
|
24
|
+
require_relative "nvruby/sparse/cusparse_bindings"
|
|
25
|
+
require_relative "nvruby/sparse/sparse_matrix"
|
|
26
|
+
|
|
27
|
+
# cuSOLVER
|
|
28
|
+
require_relative "nvruby/solver"
|
|
29
|
+
|
|
30
|
+
# cuTENSOR
|
|
31
|
+
require_relative "nvruby/linalg/cutensor_bindings"
|
|
32
|
+
require_relative "nvruby/tensor"
|
|
33
|
+
|
|
34
|
+
# MathDx (device extensions)
|
|
35
|
+
require_relative "nvruby/mathdx"
|
|
36
|
+
|
|
37
|
+
module Ignis
|
|
38
|
+
class << self
|
|
39
|
+
# --- Array creation (nvmath-style) ---
|
|
40
|
+
def zeros(shape, dtype: :float32, device: nil); NvArray.zeros(shape, dtype: dtype, device: device); end
|
|
41
|
+
def ones(shape, dtype: :float32, device: nil); NvArray.ones(shape, dtype: dtype, device: device); end
|
|
42
|
+
def eye(size, dtype: :float32, device: nil); NvArray.eye(size, dtype: dtype, device: device); end
|
|
43
|
+
def array(data, dtype: :float32, device: nil); NvArray.from_array(data, dtype: dtype, device: device); end
|
|
44
|
+
def linspace(a, b, num, dtype: :float32, device: nil); NvArray.linspace(a, b, num, dtype: dtype, device: device); end
|
|
45
|
+
|
|
46
|
+
# --- FFT (cuFFT) ---
|
|
47
|
+
def fft(x, axis: -1, norm: :backward); FFT::Operations.fft(x, axis: axis, norm: norm); end
|
|
48
|
+
def ifft(x, axis: -1, norm: :backward); FFT::Operations.ifft(x, axis: axis, norm: norm); end
|
|
49
|
+
def rfft(x, n: nil, axis: -1, norm: :backward); FFT::Operations.rfft(x, n: n, axis: axis, norm: norm); end
|
|
50
|
+
def irfft(x, n: nil, axis: -1, norm: :backward); FFT::Operations.irfft(x, n: n, axis: axis, norm: norm); end
|
|
51
|
+
|
|
52
|
+
# --- Linear solvers / decompositions (cuSOLVER) ---
|
|
53
|
+
def solve(a, b); Solver.solve(a, b); end
|
|
54
|
+
def lu(m); Solver.lu(m); end
|
|
55
|
+
def svd(m, full_matrices: false); Solver.svd(m, full_matrices: full_matrices); end
|
|
56
|
+
def eigh(m, eigenvectors: true); Solver.eigh(m, eigenvectors: eigenvectors); end
|
|
57
|
+
def eig(m); Solver.eig(m); end
|
|
58
|
+
|
|
59
|
+
# --- Tensor contraction (cuTENSOR) ---
|
|
60
|
+
def contract(expr, a, b, alpha: 1.0); Tensor.contract(expr, a, b, alpha: alpha); end
|
|
61
|
+
end
|
|
62
|
+
end
|