Repository navigation
tenferro v0.12.0
main carried the 0.11.0 version string for the 107 commits after cef3746f,
the commit the published 0.11.0 crates were built from, while the public surface
under it changed into the one call grammar of #2552. v0.12.0 renumbers that tree
and collects what those commits change. The version moves one minor because no
compatibility promise exists yet; a Rust caller should still read it as a
breaking release.
Read docs/getting-started/api-migration.md
first. It carries the per-operation migration table, and
docs/spec/generated/api-ops.md is the
generated registry of every operation, its options type, its _into modes and
its declared omissions.
Breaking changes
One call grammar per operation family
Every family (core, linalg, einsum, FFT) now has one spelling per layer, built on
a per-family registry (#2552,
merged as #2580; the eager
EagerSession surface is
#2603):
recv.op(operands…, exec) // concrete, default options
recv.op_with(operands…, &opts, exec) // concrete, explicit XxxOptions
recv.op_into(operands…, [&opts,] exec, dest) // concrete, only where declared
session.op(&x, operands…) // eager: the session is the receiver
traced.op_with(operands…, &opts) // traced: no exec
The engine is always the last concrete argument, and a concrete receiver is any
AsView value (Tensor, TensorRead, TypedTensor<T>, TypedTensorView<T> or
a reference to one), so typed inputs return typed results from the same method.
What is gone, and where the replacement is:
- The per-receiver linalg, einsum, tensordot, FFT and session-ops extension
traits (TensorLinalgExt,TensorReadLinalgExt,TypedTensorLinalgExt,
TracedTensorLinalgExt,TraceContextLinalgExt,EagerSessionLinalgExt,
EagerTensorLinalgExt, the einsum and tensordot extensions, the six FFT
extensions, andTensorSessionOpsExt/TypedTensorSessionOpsExt/
TypedTensorMaskSessionOpsExt).CoreOps(tenferro-runtime),LinalgOps,
TracedLinalgOps,EagerLinalgOps,EinsumOps,TensordotOps,
TracedEinsumOps,TracedTensordotOps,EagerEinsumOps,FftOps,
TracedFftOpsandEagerFftOpsreplace them. - Every
*_readspelling (svd_read,einsum_read_into,fft_read, …): pass
theTensorReadto the plain method. svd_full,*_with_options,pinv_with_rtol,solve_read_into,
dot_general_with_conj, positionaltriangular_solve/normarguments,
einsum_notation/einsum_subscripts, the positionalFftExecutorentries and
the six free*_with_execlinalg functions. Each has a named replacement in
the migration table.- An operation has an
XxxOptionstype and an_withform only when it has
semantic options;add,solve,lstsq,householder_qr,lu,
full_piv_lu,full_piv_lu_solve,eig,eigvals,slogdet,det,inv
andtensordothave none, so their_intoforms take no options either
(#2580).
Backend and provider hooks (Engine::{svd_read,…}, TensorDot,
LinalgBackend, FftBackend) are provider contracts and are unchanged.
Results are structs, and _into writes into a Dest
Svd { u, s, vh }, Qr { q, r }, Lu { p, l, u, parity },
FullPivLu { p, l, u, q, parity }, Eig { values, vectors },
Eigh { values, vectors } and Slogdet { sign, log_abs_det } replace the tuples
and the TypedSvd/TypedLu/TypedFullPivLu/TypedEig aliases; fields keep the
former tuple order, so a caller that took the result apart positionally names
those fields now.
_into writes into tenferro_tensor::Dest (Dest::overwrite,
Dest::accumulate, Dest::scaled(out, alpha, beta)) and exists only where the
registry declares it: add_into, solve_into, einsum_into and
ConcreteEinsumPlan::execute_into. An undeclared mode is Unsupported before
any write.
Axes are isize, and lanes replace the *_with_exec entries
Public axis arguments (CoreOps, TracedTensor, EagerSession, linalg norm,
FFT options, TensorDotAxes::Axes) are isize, and a negative axis counts from
the end; AxisVec, normalize_axis and normalize_axes are public and
AxisOutOfBounds.axis is isize. IR-shaped configurations and
broadcast_in_dim keep usize.
CpuEngine::with_lanes(&shares, &mut pools, |i, lane| ..) splits the engine's
thread budget into lanes, each with a caller-owned BufferPool (re-exported at
the tenferro-cpu root), and replaces the six *_with_exec entries: inside a
lane the ordinary grammar runs (view.svd(lane)). Only svd, svdvals, qr,
eigh, eigvalsh and eigvals run in a lane; every other operation returns
Unsupported.
The vendor BLAS/LAPACK CPU providers are gone
Every build now links one faer-backed tlinalg/cpueinsum/tcontract stack
(#2608, merged as
#2609). The features
native, blas, blas-openblas, blas-mkl, blas-accelerate,
provider-inject, provider-src, cpueinsum-blas and tlinalg-blas no longer
exist on tenferro-cpu, tenferro-linalg, tenferro-runtime, tenferro-ad,
tenferro-einsum, tenferro-fft, tenferro-gpu, tenferro-xla or
docs/tutorial-code; there is no back-compat alias, so a stale dependency line
fails with "feature does not exist". tenferro-cpu and tenferro-runtime no
longer declare a default feature, because default was the provider
selector, and tenferro-runtime declares no features at all.
Migration: delete the feature name and the default-features = false that went
with it. cblas-sys, cblas-inject, blas-src, lapack, lapack-src and
lapack-inject are no longer workspace dependencies, so openblas-src,
openblas-build, intel-mkl-src and accelerate-src leave Cargo.lock.
Smaller removals
TensorBackendCapability::require_capabilityis gone; the descriptor is a
declaration, not a gate, and every backend already refuses a pair it cannot
serve in its own dispatch
(#2477, merged as
#2619). Read a
declaration withcapability()/capability_entry()and let the engine
refuse execution.- Eight unused internal
pubitems are gone
(#2546):
ShapeGuardContextlosesrefresh_global_metadata,
with_extension_ad_dispatcher,set_transpose_primal_outputs,
transpose_primal_outputs,transpose_primal_outputs_were_used,
take_deferred_shape_errorandextend_metadata, andCudaEngineloses
runtime_mut.
Dependency moves
| dependency | 0.11.0 | 0.12.0 |
|---|---|---|
cpueinsum-blas, tlinalg-blas |
0.12.0 / 0.5.1 | removed |
cblas-sys, cblas-inject, blas-src, lapack, lapack-src, lapack-inject |
present | removed |
t4a-cuda-runtime |
=0.1.0 (rev a1fd7ae) |
=0.1.1 (rev 147af9e) |
tlinalg 0.11.0, cpueinsum 0.12.0, tcontract-exec 0.12.0, the strided-*
0.12.0 line, threadteam 0.5.1, t4a-faer 0.33.0 and t4a-cuda-kernels 0.1.2
are unchanged. scripts/check-single-versions.sh is the check that keeps one
identity per crate in the resolved graph.
New
tenferro-mpi and tenferro-hdf5
Two optional adapters moved from ext/ into the root workspace
(#2621), with empty
default features so the root lanes need neither MPI nor HDF5.
tenferro-mpimoves one host tensor between two ranks over MPI
point-to-point messages —send,recvandrecv_intoforTypedTensorand
the dtype-erasedTensor
(#2617). It borrows the
caller's communicator and never initializes or finalizes MPI. AGputensor
does not implementTransport, so a device transfer is a compile error.
Opt in withsystem(needs MPI headers and libclang) orruntime(loads MPI
at run time); the two are mutually exclusive.tenferro-hdf5stores host tensors in HDF5 datasets through caller-supplied
handles, with a versioned schema and no hidden transfer or conversion
(#2611, merged as
#2615). Opt in with
hdf5.
Two engine hooks
CpuEngine::dispatch_costsreturns thethreadteam::DispatchCoststhe
engine's tokens use, so a caller can decide withnum_threadsand
width_for_by/pays_atwhether an operation would fork before taking a
token (#2590).CpuEngine::with_guardiswith_execat width one minus the placement token:
the same refusal of a broken engine, the same unwind handling and the same
workspace retention bound, but no worker is reserved
(#2591).EighOptions::batch_policysays how many cuSOLVER launches a batch may cost.
EighBatchPolicy::RequireBatchedturns the silent per-matrix fallback into a
typedUnsupportederror naming the missing symbol and the fallback it
declined; the default keeps 0.11.0's routing unchanged
(#2622).
Fixes
- A one-input
stack/concatenatecompiles.StdTensorOp::Concatenateread
the output dtype from inputs 0 and 1, so one input failed in shape inference
and inputs past the second were ignored; the dtype now folds over every input
(#2599, merged as
#2600). EinsumOptimize::Falsecontracts left to right again, instead of building
pair intermediates the notation never mentions. On"ij,jk,kl,lm,m->i"
(d=256, f64, serial engine) step 3 was a 256³ outer product, 128 MiB of
intermediate and 186.9 ms, against 3.33 ms for the documented order.- A traced
tensordotaxis ofisize::MINpanicked in overflow-checked
builds instead of reportingAxisOutOfBounds, becausenormalize_axis
computedrank + axisbefore the bound check. The explicit-axis path now
uses the sharedtenferro_tensor::normalize_axis
(#2605, merged as
#2606). - Eager
lstsqrefuses a rank-deficientAinstead of returning a solution
(#2583, merged as
#2584). normdocuments itsord = 0NaN contract on the public surface
(#2626, merged as
#2627).CpuEngine's cache controls cover its extension cache store:
runtime_cache_statsadds the store's entries and retained bytes,
clear_runtime_cachesclears it, andtake_extension_cachesmoves the store
out instead of allocating an empty one
(#2587, merged as
#2588).
Results that can differ in the final bit
- CUDA softplus is one fused launch on
F32/F64
(#2530). It computes the
composite's arithmetic through the same device helpers and picks the same
operand the composite's compare-and-select picks, so a non-NaN input gives the
composite's bits; a NaN input stays NaN, possibly with a different sign or
payload. - The
EinsumOptimize::Falsefix above changes the summation order, so results
can differ in the last bits from 0.11.0 while matching the same order written
as an explicitEinsumOptimize::Path.
Known limitations
- A lane runs six factorizations and returns
Unsupportedfor everything else;
every operation outsidewith_laneskeeps the ordinary grammar. tenferro-hdf5stayspublish = falseuntilhdf5-rtis on crates.io, so it
is a workspace crate, not a crates.io package, in this release.tenferro-mpiis publishable but has never been published; its first
publication needs the release owner's per-package approval.
Full comparison: tenferro-tensor-v0.11.0...main
— the 0.11.0 crates were published from cef3746f under per-crate
tenferro-*-v0.11.0 tags; a v0.12.0 tag narrows this to the release commit.