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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Ignis Tensor Module
|
|
4
|
+
# High-level tensor operations using cuTENSOR
|
|
5
|
+
|
|
6
|
+
require_relative "tensor/contraction"
|
|
7
|
+
|
|
8
|
+
module Ignis
|
|
9
|
+
# Tensor operations module
|
|
10
|
+
# Provides high-level API for tensor contractions and reductions using cuTENSOR
|
|
11
|
+
module Tensor
|
|
12
|
+
class << self
|
|
13
|
+
# Perform tensor contraction using Einstein notation
|
|
14
|
+
# @param expression [String] Einstein notation expression (e.g., "ij,jk->ik")
|
|
15
|
+
# @param a [NvArray] First input tensor
|
|
16
|
+
# @param b [NvArray] Second input tensor
|
|
17
|
+
# @param alpha [Float] Scaling factor
|
|
18
|
+
# @return [NvArray] Result tensor
|
|
19
|
+
# @example Basic matrix multiplication
|
|
20
|
+
# Ignis::Tensor.contract("ij,jk->ik", a, b)
|
|
21
|
+
# @example Tensor contraction
|
|
22
|
+
# Ignis::Tensor.contract("ijk,jkl->il", tensor_a, tensor_b)
|
|
23
|
+
def contract(expression, a, b, alpha: 1.0)
|
|
24
|
+
contraction = Contraction.new(expression, a, b, alpha: alpha)
|
|
25
|
+
contraction.execute
|
|
26
|
+
ensure
|
|
27
|
+
contraction&.destroy!
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Perform batched tensor contraction
|
|
31
|
+
# @param expression [String] Einstein notation expression
|
|
32
|
+
# @param a [NvArray] First input tensor (with batch dimension)
|
|
33
|
+
# @param b [NvArray] Second input tensor (with batch dimension)
|
|
34
|
+
# @param alpha [Float] Scaling factor
|
|
35
|
+
# @return [NvArray] Result tensor
|
|
36
|
+
def batched_contract(expression, a, b, alpha: 1.0)
|
|
37
|
+
# Prepend batch dimension to expression if not present
|
|
38
|
+
contract(expression, a, b, alpha: alpha)
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: ignis-numerics
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- NNW / Ignis contributors
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: ignis
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - '='
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: 0.0.1
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - '='
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: 0.0.1
|
|
26
|
+
description: |
|
|
27
|
+
ignis-numerics is GPU numerical computing for Ruby on the Ignis foundation:
|
|
28
|
+
dense/sparse linear algebra, FFT (cuFFT), random number generation (cuRAND),
|
|
29
|
+
linear solvers & decompositions (cuSOLVER), and Einstein-notation tensor
|
|
30
|
+
contraction (cuTENSOR), with an nvmath-style API (Ignis.fft, Ignis.solve,
|
|
31
|
+
Ignis.zeros, …). The lineage NvRuby began from, revived as a standalone gem.
|
|
32
|
+
executables: []
|
|
33
|
+
extensions: []
|
|
34
|
+
extra_rdoc_files: []
|
|
35
|
+
files:
|
|
36
|
+
- README.md
|
|
37
|
+
- lib/ignis-numerics.rb
|
|
38
|
+
- lib/nvruby/array.rb
|
|
39
|
+
- lib/nvruby/fft/cufft_bindings.rb
|
|
40
|
+
- lib/nvruby/fft/fft_plan.rb
|
|
41
|
+
- lib/nvruby/fft/operations.rb
|
|
42
|
+
- lib/nvruby/linalg/cutensor_bindings.rb
|
|
43
|
+
- lib/nvruby/mathdx.rb
|
|
44
|
+
- lib/nvruby/mathdx/fft_kernel.rb
|
|
45
|
+
- lib/nvruby/mathdx/gemm_kernel.rb
|
|
46
|
+
- lib/nvruby/random/curand_bindings.rb
|
|
47
|
+
- lib/nvruby/random/generator.rb
|
|
48
|
+
- lib/nvruby/solver.rb
|
|
49
|
+
- lib/nvruby/solver/amgx_bindings.rb
|
|
50
|
+
- lib/nvruby/solver/amgx_config.rb
|
|
51
|
+
- lib/nvruby/solver/amgx_solver.rb
|
|
52
|
+
- lib/nvruby/solver/cudss_bindings.rb
|
|
53
|
+
- lib/nvruby/solver/cusolver_bindings.rb
|
|
54
|
+
- lib/nvruby/solver/eigen.rb
|
|
55
|
+
- lib/nvruby/solver/lu.rb
|
|
56
|
+
- lib/nvruby/solver/sparse_solver.rb
|
|
57
|
+
- lib/nvruby/solver/svd.rb
|
|
58
|
+
- lib/nvruby/sparse/cusparse_bindings.rb
|
|
59
|
+
- lib/nvruby/sparse/sparse_matrix.rb
|
|
60
|
+
- lib/nvruby/tensor.rb
|
|
61
|
+
- lib/nvruby/tensor/contraction.rb
|
|
62
|
+
homepage: https://github.com/tigel-agm/Ignis
|
|
63
|
+
licenses:
|
|
64
|
+
- MIT
|
|
65
|
+
metadata:
|
|
66
|
+
source_code_uri: https://github.com/tigel-agm/Ignis
|
|
67
|
+
rubygems_mfa_required: 'true'
|
|
68
|
+
rdoc_options: []
|
|
69
|
+
require_paths:
|
|
70
|
+
- lib
|
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '3.1'
|
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
|
+
requirements:
|
|
78
|
+
- - ">="
|
|
79
|
+
- !ruby/object:Gem::Version
|
|
80
|
+
version: '0'
|
|
81
|
+
requirements: []
|
|
82
|
+
rubygems_version: 3.6.9
|
|
83
|
+
specification_version: 4
|
|
84
|
+
summary: GPU numerics for Ruby — BLAS, FFT, RNG, solvers, tensor contraction (nvmath-style)
|
|
85
|
+
test_files: []
|