Repository navigation
v0.7.0
strided-rs v0.7.0
Breaking: placement is an explicit Exec token
Every entry that can fan out takes a strided_exec::Exec as its last parameter, by value.
The token carries the pool and a budget of slots; the callee splits it (fork, for_ranges,
limit) and never starts a task by any other route. No thread-local placement state exists
any more, so work that runs on a waiting thread cannot inherit another operation's pool or
budget. All workspace crates are released at 0.7.0.
strided-exec(new crate).PoolandPoolBuilder(the only place a thread pool is
started),Exec(serial,new(&pool, budget),budget,is_serial,reborrow,limit,
fork,for_ranges,broadcast,external), and theErrorandRefusedtypes. A token is
neitherClonenorCopy; slots are conserved across nesting; a serial token, a budget of
one, or a single task runs inline and never starts the process-global Rayon pool. Without the
parallelfeature the same types exist and every entry runs inline. No Rayon type appears in
the public API (scripts/check-no-public-rayon.sh).Exec::external. Enters the pool once and hands the budget to an outside library (a BLAS,
a linear-algebra backend) as a plain width.- One function per operation. The
*_parpermutation copies are merged intocopy_into,
copy_into_uninitandcopy_into_col_major.strided-permuses the budget it is given and
never chooses a width, and oneMINTHREADLENGTHdecides when a loop is worth splitting. strided-basic,strided-fused,strided-kernel,strided-nntakeExec;
strided-basicre-exportsExec,PoolandPoolBuilder, andstrided-kernelre-exports
them fromstrided-basic.strided-fusedandstrided-nnuse the token through
strided-basic.- Rayon is a dependency of
strided-execonly.strided-permandstrided-basicno longer
depend on it.cargo deny check bansrejects a directrayondependency (normal, dev or
build) anywhere else in the workspace, and bansfaer,t4a-faerandspindle. strided-nn0.7.0 (previously 0.1.1): the fused axis-0 softmax takes caller-provided
scratch sized by executable tasks (scratch_len) and anExec.
Migration
| 0.6 | 0.7 |
|---|---|
ExecContext::serial() |
Exec::serial() |
ExecContext::max_threads(n) |
Exec::new(&pool, n)? with a strided_exec::Pool |
ExecContext::run_on(pool, ..) |
build a Pool once, mint Exec::new(&pool, n)? per call |
plan.execute(&ctx, ..) (context first) |
plan.execute(.., exec) (token last) |
with_execution_policy, ExecutionPolicy |
removed; pass an Exec |
with_execution_pool |
removed; pass an Exec |
rayon_threads() |
exec.budget() |
copy_into_par, copy_into_uninit_par, copy_into_col_major_par |
copy_into, copy_into_uninit, copy_into_col_major with an Exec |
| ambient (global Rayon pool) placement | none; use Exec::serial() or a pool you own |
StridedError::InvalidThreadBudget |
strided_exec::Error::ZeroBudget from Exec::new |
MaybeSend, MaybeSync bounds |
Send + Sync |
a direct rayon dependency for placement |
strided-exec (feature parallel, default) |
A phase sequence reuses one token with exec.reborrow(), because every parallel entry consumes
its token. Plans never store an Exec; replay takes it per call.
Design record: docs/design/cpu-exec-placement.md.
Full comparison: v0.5.0...v0.7.0