numr 0.3.0#2
Merged
Merged
Conversation
Introduce dedicated Shape and Strides types with SmallVec backing to reduce heap allocations for common tensor ranks (≤4 dimensions). This improves type safety, reduces Layout complexity, and provides a clearer separation of concerns between shape metadata and memory layout. Changes: - Add Shape type with stack allocation for common cases - Add Strides type with signed offsets for negative strides - Update Layout to use new types - Expose Shape/Strides in public API - Make TensorId crate-internal visibility
Split large monolithic files into focused modules following the target architecture pattern of one operation per file. FFT changes: - Split fft.rs (single file) → fft/ directory with mod, real, shift - Add configurable parallelism via min_batch_len parameter - Improve parallel batching efficiency with par_chunks_mut Reduce changes: - Split reduce.rs → reduce/ with common, single_dim, multi_dim, precision - Expose ParallelismConfig in public API for tuning This reduces file sizes and improves code organization without changing functionality.
Implement unfold and repeat_interleave as composite operations built from primitive shape ops (narrow, stack, cat, permute). All backends delegate to impl_generic implementations to guarantee numerical parity and consistent behavior across CPU, CUDA, and WebGPU. This follows the architecture pattern where composite operations share a single algorithm while primitives have backend-specific kernels.
Introduce configurable chunk_size parameter across CPU kernels to allow tuning parallelism granularity. This enables better performance on diverse workloads and hardware configurations. Changes: - Add chunk_size parameter to complex, FFT, and other parallel kernels - Feature-gate half_convert module for x86_64 only - Update indexing operations for consistency across backends - Add ParallelismConfig tests to verify chunking behavior - Update backend parity tests for new configurations No functional changes to existing default behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete foundational tensor API, close backend parity gaps, and prepare public API for 1.0 stability.
New Operations
unfold— sliding window extraction (im2col generalization), critical for boostr conv implementationsrepeat_interleave— per-element repetition along dimension (upsampling, embedding expansion)take/put— flat indexing operations, both functional (&Tensor -> Result<Tensor>)Backend Parity
Unimplementederrors for core ops used by solvr/boostrPublic API (Pre-1.0)
Shape/Stridesin opaque newtypes (currently leaksSmallVec)isizevsusize), index dtype contractsPerformance
Design Rules
Not in Scope (belongs in solvr)
Optimization, ODE/PDE solvers, interpolation, advanced statistics, signal processing, spatial algorithms
CI Checks
cargo clippy --all-targets --features f16,sparse -- -D warningscargo test --features f16,sparsecargo fmt --all --check