Namespaces | |
| namespace | phase |
Classes | |
| struct | MapRedPost |
| The curried meta arguments of a tensor.map_reduce_post or btensor.map_reduce_post callee (same layout). More... | |
| struct | Ring_field |
| The fields of btensor.Ring, by index. More... | |
| struct | Sched_field |
| The fields of btensor.Sched, by index. More... | |
Enumerations | |
<tt>btensor.Ring</tt> | |
| enum class | Ring : flags_t |
<tt>btensor.id</tt> | |
| enum class | id : flags_t |
<tt>btensor.map_reduce_post</tt> | |
| enum class | map_reduce_post : flags_t |
<tt>btensor.Sched</tt> | |
| enum class | Sched : flags_t |
<tt>btensor.SchedT</tt> | |
| enum class | SchedT : flags_t |
<tt>btensor.mk_sched</tt> | |
| enum class | mk_sched : flags_t |
<tt>btensor.proj_map</tt> | |
| enum class | proj_map : flags_t |
<tt>btensor.broadcast</tt> | |
| enum class | broadcast : flags_t |
<tt>btensor.concat</tt> | |
| enum class | concat : flags_t |
<tt>btensor.pad</tt> | |
| enum class | pad : flags_t |
<tt>btensor.gather</tt> | |
| enum class | gather : flags_t |
<tt>btensor.scatter</tt> | |
| enum class | scatter : flags_t |
<tt>btensor.NestT</tt> | |
| enum class | NestT : flags_t |
<tt>btensor.mr_nest</tt> | |
| enum class | mr_nest : flags_t |
<tt>btensor.map_reduce_post_impl</tt> | |
| enum class | map_reduce_post_impl : flags_t |
<tt>btensor.lower_map_reduce</tt> | |
| enum class | lower_map_reduce : flags_t |
Functions | |
| const Def * | op_affine_map (const Def *f, const Def *m, const Def *n, const Def *s_in, const Def *s_out, const Def *idxs, const Def *mem) |
affine.map @(m, n) @(s_in, s_out) f idxs as mem with the address space as of mem ↦ [mem', coords]. | |
| void | app_cps (Lam *caller, const Def *f, DefVec args, const Def *ret) |
Calls the combiner/epilogue f from caller with args and the continuation ret. | |
| std::pair< Lam *, const Def * > | ds_splice (const Def *arg, const Def *codom, std::string name) |
A fresh fun: Fn arg->type() → codom named name, spliced into direct style as cps.cps2ds_dep fun arg. | |
| DefVec | to_idxs (World &w, Defs extents, Defs iters) |
Converts the raw i64 loop counters iters into indices Idx extents[d]. | |
| const Def * | folded_idx (const Def *shape, Defs iters) |
The raw i64 loop counters iters as a buffer index into shape, with its literal size-1 axes folded away. | |
| const Def * | clamp (const Def *x, const Def *hi) |
Clamps the i64 x into [0, hi]. | |
| std::pair< DefVec, const Def * > | pad_coords (Defs iters, const Def *lo, const Def *s_in, bool replicate) |
The read coordinates o#d − lo#d of a pad into Idx s_in#d - clamped to the nearest edge if replicate, or else zeroed out of range - together with the all-axes in-range flag (nullptr if replicate). | |
| std::optional< fe::Vector< u64 > > | concat_extents (const Def *Sis, u64 nis, u64 r, u64 ax) |
The literal extents of the nis input shapes Sis along the concat axis ax; std::nullopt if one is not literal. | |
| const Def * | concat_select (const Def *o_ax, const fe::Vector< u64 > &exts, auto read) |
The concat cell at the i64 axis coordinate o_ax: read(i, loc) of the input i owning it - the highest one whose prefix offset is ≤ o_ax - at the axis coordinate loc clamped into that input. | |
| const Def * | build_pointwise (const Def *result_ty, const Def *mem, const Def *dst, const Def *ins, const Def *s_out, u64 rn, const std::string &name, auto compute) |
A [mem, dst, ins] → [mem, Buf] fun spliced via cps.cps2ds_dep that loops over s_out carrying [mem, dst] and writes compute's element at the loop's (identity) output coordinates. | |
| void | register_normalizers (Normalizers &normalizers) |
Variables | |
| static constexpr plugin_t | Plugin_Id = 0xd518f5104c00000 |
<tt>btensor.map_reduce</tt> | |
| enum class | map_reduce : flags_t |
| const Def * | normalize_map_reduce (const Def *, const Def *c, const Def *arg) |
| btensor.map_reduce is btensor.map_reduce_post without the epilogue and with the neutral schedule: delegate with post = btensor.id (so Tp = To), no epilogue inputs (nps = 0), no vector dim (vdim = Rn, the out-of-range sentinel), and no unrolling. | |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
inline |
Calls the combiner/epilogue f from caller with args and the continuation ret.
Scalarize may have flattened f's domain Cn [[args], Cn ret] to Cn [args…, Cn ret]; the call matches either.
Definition at line 73 of file btensor.h.
References mim::Lam::app(), app_cps(), mim::Pi::dom(), mim::Def::num_projs(), and mim::Def::world().
Referenced by app_cps().
|
inline |
A [mem, dst, ins] → [mem, Buf] fun spliced via cps.cps2ds_dep that loops over s_out carrying [mem, dst] and writes compute's element at the loop's (identity) output coordinates.
compute(iters, ins, mem) receives the raw i64 loop counters, the fun's inputs var, and the current mem; it returns {mem', elem}.
Definition at line 172 of file btensor.h.
References build_pointwise(), mim::plug::affine::counting_nest(), ds_splice(), folded_idx(), mim::plug::buffer::op_write(), mim::Def::proj(), mim::Def::projs(), and mim::Def::var().
Referenced by build_pointwise().
Clamps the i64 x into [0, hi].
Definition at line 104 of file btensor.h.
References clamp(), mim::plug::core::smax, mim::plug::core::smin, and mim::Def::world().
Referenced by clamp(), concat_select(), and pad_coords().
|
inline |
The literal extents of the nis input shapes Sis along the concat axis ax; std::nullopt if one is not literal.
Definition at line 140 of file btensor.h.
References concat_extents(), mim::Lit::isa(), and mim::Def::proj().
Referenced by concat_extents().
|
inline |
The concat cell at the i64 axis coordinate o_ax: read(i, loc) of the input i owning it - the highest one whose prefix offset is ≤ o_ax - at the axis coordinate loc clamped into that input.
Definition at line 152 of file btensor.h.
References clamp(), concat_select(), mim::plug::core::none, mim::plug::core::sub, mim::plug::core::uge, and mim::Def::world().
Referenced by concat_select().
|
inline |
A fresh fun: Fn arg->type() → codom named name, spliced into direct style as cps.cps2ds_dep fun arg.
Definition at line 85 of file btensor.h.
References ds_splice(), mim::plug::cps::op_cps2ds_dep(), mim::Def::type(), and mim::Def::world().
Referenced by build_pointwise(), and ds_splice().
The raw i64 loop counters iters as a buffer index into shape, with its literal size-1 axes folded away.
Definition at line 98 of file btensor.h.
References folded_idx(), mim::Shape::Shape(), and to_idxs().
Referenced by build_pointwise(), and folded_idx().
| const Def * mim::plug::btensor::normalize_map_reduce | ( | const Def * | , |
| const Def * | c, | ||
| const Def * | arg ) |
btensor.map_reduce is btensor.map_reduce_post without the epilogue and with the neutral schedule: delegate with post = btensor.id (so Tp = To), no epilogue inputs (nps = 0), no vector dim (vdim = Rn, the out-of-range sentinel), and no unrolling.
The delegation lives in a normalizer (rather than a wrapping lam) so that call sites keep axm-style implicit inference: the stuck axm application lets the checker solve the {Tis, Ris, Sis} holes from the operands, whereas applying a lam would eagerly β-reduce buffer.Buf over still-unsolved holes.
Definition at line 14 of file normalizers.cpp.
References normalize_map_reduce(), and mim::Def::projs().
Referenced by normalize_map_reduce().
|
inline |
affine.map @(m, n) @(s_in, s_out) f idxs as mem with the address space as of mem ↦ [mem', coords].
Definition at line 55 of file btensor.h.
References mim::App::arg(), and op_affine_map().
Referenced by op_affine_map().
|
inline |
The read coordinates o#d − lo#d of a pad into Idx s_in#d - clamped to the nearest edge if replicate, or else zeroed out of range - together with the all-axes in-range flag (nullptr if replicate).
Definition at line 111 of file btensor.h.
References mim::plug::core::and_, clamp(), mim::plug::core::none, pad_coords(), mim::Def::proj(), mim::plug::core::sub, mim::plug::core::u, mim::plug::core::ul, and mim::Def::world().
Referenced by pad_coords().
| void mim::plug::btensor::register_normalizers | ( | Normalizers & | normalizers | ) |
References register_normalizers().
Referenced by MIM_PLUGIN_ENTRY(), and register_normalizers().