[package]
edition = "2024"
rust-version = "1.89"
name = "numr"
version = "0.9.0"
build = "build.rs"
exclude = [
".github/",
"scripts/ci/",
"flux.toml",
".gitignore",
"examples/cuda_*_profile.rs",
]
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "High-performance numerical computing with multi-backend GPU acceleration (CPU/CUDA/WebGPU)"
documentation = "https://docs.rs/numr"
readme = "README.md"
keywords = [
"tensor",
"ndarray",
"linear-algebra",
"gpu",
"fft",
]
categories = [
"science",
"mathematics",
"data-structures",
]
license = "Apache-2.0"
repository = "https://github.com/ml-rust/numr"
[package.metadata.docs.rs]
features = [
"f16",
"sparse",
"fp8",
"wgpu",
]
[features]
cuda = ["dep:cudarc"]
default = ["rayon"]
distributed = [
"dep:nexar",
"dep:tokio",
]
distributed-gpu = [
"distributed",
"nccl",
"dep:nexar-nccl",
]
f16 = [
"dep:half",
"cudarc?/f16",
]
fp8 = []
nccl = [
"cuda",
"cudarc?/nccl",
]
rayon = ["dep:rayon"]
sparse = []
wgpu = [
"dep:wgpu",
"dep:pollster",
]
[lib]
name = "numr"
path = "src/lib.rs"
[[example]]
name = "autograd_linear_regression"
path = "examples/autograd_linear_regression.rs"
[[example]]
name = "backend_switch_cpu_wgpu"
path = "examples/backend_switch_cpu_wgpu.rs"
[[example]]
name = "basic_tensor_ops"
path = "examples/basic_tensor_ops.rs"
[[example]]
name = "conv_unfold_im2col"
path = "examples/conv_unfold_im2col.rs"
[[example]]
name = "f64_accuracy_survey"
path = "examples/f64_accuracy_survey.rs"
[[example]]
name = "fft_roundtrip"
path = "examples/fft_roundtrip.rs"
[[example]]
name = "sparse_coo_csr_workflow"
path = "examples/sparse_coo_csr_workflow.rs"
[[example]]
name = "wgpu_global_sort_bench"
path = "examples/wgpu_global_sort_bench.rs"
[[test]]
name = "algorithm_fft_bluestein"
path = "tests/algorithm_fft_bluestein.rs"
[[test]]
name = "algorithm_special_scalar"
path = "tests/algorithm_special_scalar.rs"
[[test]]
name = "autograd_conv1d_op"
path = "tests/autograd_conv1d_op.rs"
[[test]]
name = "autograd_conv2d_op"
path = "tests/autograd_conv2d_op.rs"
[[test]]
name = "autograd_fused_activation_mul"
path = "tests/autograd_fused_activation_mul.rs"
[[test]]
name = "autograd_normalization"
path = "tests/autograd_normalization.rs"
[[test]]
name = "autograd_unary_cast_traversal"
path = "tests/autograd_unary_cast_traversal.rs"
[[test]]
name = "backend_parity_all"
path = "tests/backend_parity_all.rs"
[[test]]
name = "bincount_degenerate"
path = "tests/bincount_degenerate.rs"
[[test]]
name = "bool_parity"
path = "tests/bool_parity.rs"
[[test]]
name = "cpu_empty_extents"
path = "tests/cpu_empty_extents.rs"
[[test]]
name = "cpu_runtime"
path = "tests/cpu_runtime.rs"
[[test]]
name = "cuda_arena_capture"
path = "tests/cuda_arena_capture.rs"
[[test]]
name = "cuda_binary_dtype_coverage"
path = "tests/cuda_binary_dtype_coverage.rs"
[[test]]
name = "cuda_cast_dtype_coverage"
path = "tests/cuda_cast_dtype_coverage.rs"
[[test]]
name = "cuda_conv_batch_invariance"
path = "tests/cuda_conv_batch_invariance.rs"
[[test]]
name = "cuda_indexing_dtype_coverage"
path = "tests/cuda_indexing_dtype_coverage.rs"
[[test]]
name = "cuda_indexing_int_coverage"
path = "tests/cuda_indexing_int_coverage.rs"
[[test]]
name = "cuda_integer_dtype_coverage"
path = "tests/cuda_integer_dtype_coverage.rs"
[[test]]
name = "cuda_matmul_batch_invariance"
path = "tests/cuda_matmul_batch_invariance.rs"
[[test]]
name = "cuda_matmul_smallm_bt_parity"
path = "tests/cuda_matmul_smallm_bt_parity.rs"
[[test]]
name = "cuda_rms_norm_invariance"
path = "tests/cuda_rms_norm_invariance.rs"
[[test]]
name = "cuda_scalar_ternary_fused_dtype_coverage"
path = "tests/cuda_scalar_ternary_fused_dtype_coverage.rs"
[[test]]
name = "cuda_tensor_ops"
path = "tests/cuda_tensor_ops.rs"
[[test]]
name = "cuda_tune_capture"
path = "tests/cuda_tune_capture.rs"
[[test]]
name = "cuda_tune_timing"
path = "tests/cuda_tune_timing.rs"
[[test]]
name = "cuda_unary_int_coverage"
path = "tests/cuda_unary_int_coverage.rs"
[[test]]
name = "dispatch_dtype_macro_external"
path = "tests/dispatch_dtype_macro_external.rs"
[[test]]
name = "external_backend_api"
path = "tests/external_backend_api.rs"
[[test]]
name = "int_rounding_identity"
path = "tests/int_rounding_identity.rs"
[[test]]
name = "matmul_column_determinism"
path = "tests/matmul_column_determinism.rs"
[[test]]
name = "matmul_perf"
path = "tests/matmul_perf.rs"
[[test]]
name = "matmul_transposed_b"
path = "tests/matmul_transposed_b.rs"
[[test]]
name = "ml_dtype_audit"
path = "tests/ml_dtype_audit.rs"
[[test]]
name = "parity_comparison_nonfinite"
path = "tests/parity_comparison_nonfinite.rs"
[[test]]
name = "parity_comparison_result_dtype"
path = "tests/parity_comparison_result_dtype.rs"
[[test]]
name = "wgpu_buffer_lifetime"
path = "tests/wgpu_buffer_lifetime.rs"
[[test]]
name = "wgpu_integer_ops_all"
path = "tests/wgpu_integer_ops_all.rs"
[[test]]
name = "wgpu_tensor_ops"
path = "tests/wgpu_tensor_ops.rs"
[[test]]
name = "wide_accumulator"
path = "tests/wide_accumulator.rs"
[[test]]
name = "wmma_determinism"
path = "tests/wmma_determinism.rs"
[[test]]
name = "wmma_throughput"
path = "tests/wmma_throughput.rs"
[[bench]]
name = "ci_regression"
path = "benches/ci_regression.rs"
harness = false
[[bench]]
name = "conv"
path = "benches/conv.rs"
harness = false
[[bench]]
name = "fft"
path = "benches/fft.rs"
harness = false
[[bench]]
name = "gemm_epilogue"
path = "benches/gemm_epilogue.rs"
harness = false
[[bench]]
name = "indexing"
path = "benches/indexing.rs"
harness = false
[[bench]]
name = "matmul"
path = "benches/matmul.rs"
harness = false
[[bench]]
name = "matmul_int"
path = "benches/matmul_int.rs"
harness = false
[[bench]]
name = "norm"
path = "benches/norm.rs"
harness = false
[[bench]]
name = "parallelism"
path = "benches/parallelism.rs"
harness = false
[[bench]]
name = "reduce"
path = "benches/reduce.rs"
harness = false
[[bench]]
name = "shape_ops"
path = "benches/shape_ops.rs"
harness = false
[[bench]]
name = "softmax"
path = "benches/softmax.rs"
harness = false
[dependencies.bytemuck]
version = "1.25"
features = ["derive"]
[dependencies.cudarc]
version = "0.19"
features = ["cuda-version-from-build-system"]
optional = true
[dependencies.half]
version = "2.7"
features = [
"bytemuck",
"num-traits",
]
optional = true
[dependencies.nexar]
version = "0.1"
optional = true
[dependencies.nexar-nccl]
version = "0.1"
optional = true
[dependencies.num-traits]
version = "0.2"
[dependencies.parking_lot]
version = "0.12"
[dependencies.paste]
version = "0.2"
package = "pastey"
[dependencies.pollster]
version = "1.0"
optional = true
[dependencies.rayon]
version = "1.12"
optional = true
[dependencies.rkyv]
version = "0.8"
[dependencies.smallvec]
version = "1"
[dependencies.thiserror]
version = "2.0"
[dependencies.tokio]
version = "1"
features = ["rt"]
optional = true
[dependencies.wgpu]
version = "30.0"
optional = true
[dev-dependencies.approx]
version = "0.5"
[dev-dependencies.fluxbench]
version = "0.2"
[dev-dependencies.nalgebra]
version = "0.35"
[dev-dependencies.ndarray]
version = "0.17"
[dev-dependencies.rand]
version = "0.10"
[profile.bench]
lto = "thin"
codegen-units = 1
[profile.release]
lto = "thin"
codegen-units = 1