Files
SRI VILLIAM SAI AandGitHub 7de8e6fe05 fix(cuda): refuse tensors exceeding 2^31 elements (#31)
CUDA kernels index with signed 32-bit integers, so a tensor of more than i32::MAX elements miscomputes with no error. Allocation, host copies, zeros, rand, broadcast_as, reshape and to_device onto CUDA now return CudaError::TooManyElements instead. Shape products use checked multiplication so a wrapping shape cannot pass as empty.

Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk
2026-11-12 18:58:51 -08:00

47 lines
1.5 KiB
TOML

[package]
name = "hanzo-transformers"
version = "0.11.20"
edition = "2021"
description = "Multi-backend tensor & ML framework for Rust — part of the Hanzo ML stack."
repository = "https://github.com/hanzoai/ml"
keywords = ["blas", "tensor", "machine-learning"]
categories = ["science"]
license = "MIT OR Apache-2.0"
readme = "README.md"
[dependencies]
accelerate-src = { version = "0.3.2", optional = true }
byteorder = "1.4.3"
hanzo-ml = { path = "../hanzo-ml", package = "hanzo-ml", version = "0.11.115" }
hanzo-nn = { path = "../hanzo-nn", version = "0.11.50" }
fancy-regex = "0.19.0"
intel-mkl-src = { version = "0.8.1", features = ["mkl-static-lp64-iomp"], optional = true }
num-traits = "0.2.15"
rand = "0.9.0"
rayon = "1.7.0"
serde = { version = "1.0.171", features = ["derive"] }
serde_json = "1.0.99"
serde_plain = "1.0.2"
tracing = "0.1.37"
[features]
default = []
accelerate = ["dep:accelerate-src", "hanzo-ml/accelerate", "hanzo-nn/accelerate"]
cuda = ["hanzo-ml/cuda", "hanzo-nn/cuda"]
cudnn = ["hanzo-ml/cudnn", "hanzo-nn/cudnn"]
flash-attn = ["cuda"]
mkl = ["dep:intel-mkl-src", "hanzo-ml/mkl", "hanzo-nn/mkl"]
metal = ["hanzo-ml/metal", "hanzo-nn/metal"]
rocm = ["hanzo-ml/rocm", "hanzo-nn/rocm"]
vulkan = ["hanzo-ml/vulkan", "hanzo-nn/vulkan"]
metal-debug-labels = ["metal", "hanzo-ml/metal-debug-labels", "hanzo-nn/metal-debug-labels"]
[lints.clippy]
explicit_counter_loop = "allow"
unnecessary_unwrap = "allow"
manual_checked_ops = "allow"
needless_borrow = "allow"
large_const_arrays = "allow"
needless_range_loop = "allow"
too_many_arguments = "allow"