Namespaces | |
| namespace | phase |
Classes | |
| struct | PureRead |
| A pure re-indexed read: the source tensor, the access map into it (over the read's output coordinates), and the source's element type/rank/shape. More... | |
Enumerations | |
%tensor.generate | |
| enum class | generate : flags_t |
%tensor.splat | |
| enum class | splat : flags_t |
%tensor.id | |
| enum class | id : flags_t |
%tensor.map_reduce_post | |
| enum class | map_reduce_post : flags_t |
%tensor.map_reduce | |
| enum class | map_reduce : flags_t |
%tensor.transpose | |
| enum class | transpose : flags_t |
%tensor.transpose_2d | |
| enum class | transpose_2d : flags_t |
%tensor.binary | |
| enum class | binary : flags_t |
%tensor.map | |
| enum class | map : flags_t |
%tensor.select | |
| enum class | select : flags_t |
%tensor.unary | |
| enum class | unary : flags_t |
%tensor.bmm | |
| enum class | bmm : flags_t |
%tensor.conv | |
| enum class | conv : flags_t |
%tensor.dot_product | |
| enum class | dot_product : flags_t |
%tensor.pool | |
| enum class | pool : flags_t |
%tensor.product_2d | |
| enum class | product_2d : flags_t |
%tensor.gather | |
| enum class | gather : flags_t |
%tensor.scatter | |
| enum class | scatter : flags_t |
%tensor.interchange | |
| enum class | interchange : flags_t |
%tensor.materialize | |
| enum class | materialize : flags_t |
%tensor.mr_tileable | |
| enum class | mr_tileable : flags_t |
%tensor.strip_mine_par | |
| enum class | strip_mine_par : flags_t |
%tensor.strip_mine_red | |
| enum class | strip_mine_red : flags_t |
%tensor.broadcast_in_dim_impl | |
| enum class | broadcast_in_dim_impl : flags_t |
%tensor.flip_impl | |
| enum class | flip_impl : flags_t |
%tensor.gather_pointwise_elem_impl | |
| enum class | gather_pointwise_elem_impl : flags_t |
%tensor.map_impl | |
| enum class | map_impl : flags_t |
%tensor.pool_impl | |
| enum class | pool_impl : flags_t |
%tensor.repeat_impl | |
| enum class | repeat_impl : flags_t |
%tensor.reshape_map | |
| enum class | reshape_map : flags_t |
%tensor.reshape_impl | |
| enum class | reshape_impl : flags_t |
%tensor.conv_impl | |
| enum class | conv_impl : flags_t |
%tensor.dot_product_impl | |
| enum class | dot_product_impl : flags_t |
%tensor.bmm_impl | |
| enum class | bmm_impl : flags_t |
%tensor.product_2d_impl | |
| enum class | product_2d_impl : flags_t |
%tensor.scatter_step_impl | |
| enum class | scatter_step_impl : flags_t |
%tensor.slice_impl | |
| enum class | slice_impl : flags_t |
%tensor.transpose_impl | |
| enum class | transpose_impl : flags_t |
%tensor.transpose_2d_impl | |
| enum class | transpose_2d_impl : flags_t |
%tensor.binary_impl | |
| enum class | binary_impl : flags_t |
%tensor.select_impl | |
| enum class | select_impl : flags_t |
%tensor.unary_impl | |
| enum class | unary_impl : flags_t |
%tensor.reassoc | |
| enum class | reassoc : flags_t |
%tensor.lower_tensor | |
| enum class | lower_tensor : flags_t |
%tensor.lower_map_reduce | |
| enum class | lower_map_reduce : flags_t |
%tensor.lower_get_set | |
| enum class | lower_get_set : flags_t |
%tensor.fuse_tensor | |
| enum class | fuse_tensor : flags_t |
%tensor.lower_to_mem | |
| enum class | lower_to_mem : flags_t |
Functions | |
| bool | is_copy_comb (const Def *comb) |
| Recognizes the (rebuilt) tensor_copy combiner (acc, ys) ↦ ys#0: the result is exactly the single input element, so a map_reduce built on it is a pure re-indexed read of that input. | |
| bool | is_identity_post (const Def *post) |
| Is post the (rebuilt) CPS identity tensor.id, i.e. | |
| std::optional< PureRead > | is_pure_read (const Def *value) |
| If value is a pure re-indexed read — a copy-combiner map_reduce without reduction loops that writes its full loop domain through the identity output map (reshape/transpose/slice/flip/repeat lower to these) — returns its single access map and source. | |
| const Def * | op_get (const Def *T, const Def *r, const Def *s, const Def *arr, const Def *index) |
| const Def * | op_set (const Def *T, const Def *r, const Def *s, const Def *arr, const Def *index, const Def *x) |
| template<class Pred> | |
| DefMap< u64 > | count_consumers (const World &world, Pred pred) |
Counts the consumers of every def of world matched by pred. | |
| std::tuple< u64, const Def *, const Def * > | fold_shape_and_index (const Def *shapeshape, const Def *index) |
| void | reg_phases (Flags2Phases &phases) |
| void | register_normalizers (Normalizers &normalizers) |
Variables | |
| static constexpr plugin_t | Plugin_Id = 0x5463d44130000000 |
%tensor.get | |
| enum class | get : flags_t |
| const Def * | normalize_get (const Def *, const Def *c, const Def *arg) |
%tensor.set | |
| enum class | set : flags_t |
| const Def * | normalize_set (const Def *, const Def *c, const Def *arg) |
%tensor.shape | |
| enum class | shape : flags_t |
| const Def * | normalize_shape (const Def *, const Def *c, const Def *arg) |
%tensor.broadcast | |
| enum class | broadcast : flags_t |
| const Def * | normalize_broadcast (const Def *, const Def *c, const Def *arg) |
%tensor.broadcast_in_dim | |
| enum class | broadcast_in_dim : flags_t |
| const Def * | normalize_broadcast_in_dim (const Def *, const Def *, const Def *) |
%tensor.concat | |
| enum class | concat : flags_t |
| const Def * | normalize_concat (const Def *, const Def *, const Def *) |
%tensor.flip | |
| enum class | flip : flags_t |
| const Def * | normalize_flip (const Def *, const Def *, const Def *) |
%tensor.pad | |
| enum class | pad : flags_t |
| const Def * | normalize_pad (const Def *, const Def *c, const Def *arg) |
%tensor.repeat | |
| enum class | repeat : flags_t |
| const Def * | normalize_repeat (const Def *, const Def *c, const Def *arg) |
%tensor.reshape | |
| enum class | reshape : flags_t |
| const Def * | normalize_reshape (const Def *, const Def *c, const Def *arg) |
%tensor.slice | |
| enum class | slice : flags_t |
| const Def * | normalize_slice (const Def *, const Def *c, const Def *arg) |
%tensor.fastest_axis | |
| enum class | fastest_axis : flags_t |
| const Def * | normalize_fastest_axis (const Def *, const Def *, const Def *arg) |
%tensor.if_static | |
| enum class | if_static : flags_t |
| const Def * | normalize_if_static (const Def *, const Def *, const Def *arg) |
| struct mim::plug::tensor::PureRead |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
| DefMap< u64 > mim::plug::tensor::count_consumers | ( | const World & | world, |
| Pred | pred ) |
Counts the consumers of every def of world matched by pred.
Tuples and packs are transparent argument wrappers, so a wrapped def is charged to the enclosing non-tuple consumer - a shared argument tuple charges each of its users, and a def used twice in one argument list counts twice. A phase whose world does not track uses needs this up front.
Definition at line 81 of file tensor.h.
References count_consumers(), and mim::World::roots().
Referenced by count_consumers(), mim::plug::tensor::phase::Fuse::start(), and mim::plug::tensor::phase::Reassoc::start().
| std::tuple< u64, const Def *, const Def * > mim::plug::tensor::fold_shape_and_index | ( | const Def * | shape, |
| const Def * | index ) |
Definition at line 18 of file normalizers.cpp.
References fold_shape_and_index(), mim::Lit::isa(), and mim::Def::proj().
Referenced by fold_shape_and_index(), normalize_get(), and normalize_set().
|
inline |
Recognizes the (rebuilt) tensor_copy combiner (acc, ys) ↦ ys#0: the result is exactly the single input element, so a map_reduce built on it is a pure re-indexed read of that input.
Definition at line 17 of file tensor.h.
References mim::Def::as_mut(), is_copy_comb(), mim::Lam::isa_ret_arg(), and mim::Def::proj().
Referenced by is_copy_comb(), and is_pure_read().
|
inline |
Is post the (rebuilt) CPS identity tensor.id, i.e.
a lam (x, extras) ↦ x that returns its first argument (and hence has no epilogue inputs)?
Definition at line 24 of file tensor.h.
References mim::Def::as_mut(), is_identity_post(), mim::Lam::isa_ret_arg(), and mim::Def::proj().
Referenced by is_identity_post(), and is_pure_read().
If value is a pure re-indexed read — a copy-combiner map_reduce without reduction loops that writes its full loop domain through the identity output map (reshape/transpose/slice/flip/repeat lower to these) — returns its single access map and source.
fuse_tensor's read-through absorbs exactly these into the consuming op's access maps.
Definition at line 43 of file tensor.h.
References is_copy_comb(), is_identity_post(), is_pure_read(), mim::Axm::isa(), mim::Lit::isa(), and mim::Def::projs().
Referenced by is_pure_read(), normalize_fastest_axis(), mim::plug::tensor::phase::read_through(), and mim::plug::tensor::phase::Fuse::rewrite_imm_App().
Definition at line 181 of file normalizers.cpp.
References mim::Lit::isa(), normalize_broadcast(), and mim::Def::projs().
Referenced by normalize_broadcast().
| const Def * mim::plug::tensor::normalize_broadcast_in_dim | ( | const Def * | , |
| const Def * | , | ||
| const Def * | ) |
Definition at line 199 of file normalizers.cpp.
References normalize_broadcast_in_dim().
Referenced by normalize_broadcast_in_dim().
Definition at line 246 of file normalizers.cpp.
References normalize_concat().
Referenced by normalize_concat().
| const Def * mim::plug::tensor::normalize_fastest_axis | ( | const Def * | , |
| const Def * | , | ||
| const Def * | arg ) |
Definition at line 257 of file normalizers.cpp.
References mim::Def::arity(), mim::Pi::codom(), mim::Pi::dom(), is_pure_read(), mim::Axm::isa(), mim::Lit::isa(), normalize_fastest_axis(), mim::Def::projs(), and mim::Def::world().
Referenced by normalize_fastest_axis().
Definition at line 230 of file normalizers.cpp.
References normalize_flip().
Referenced by normalize_flip().
Definition at line 37 of file normalizers.cpp.
References mim::plug::core::add, fold_shape_and_index(), mim::Axm::isa(), mim::Lit::isa(), normalize_get(), op_get(), mim::Def::proj(), and mim::Def::projs().
Referenced by normalize_get().
Definition at line 248 of file normalizers.cpp.
References mim::Lit::isa(), normalize_if_static(), and mim::Def::projs().
Referenced by normalize_if_static().
Definition at line 232 of file normalizers.cpp.
References mim::Lit::isa(), normalize_pad(), and mim::Def::proj().
Referenced by normalize_pad().
Definition at line 201 of file normalizers.cpp.
References normalize_repeat().
Referenced by normalize_repeat().
Definition at line 208 of file normalizers.cpp.
References normalize_reshape().
Referenced by normalize_reshape().
Definition at line 130 of file normalizers.cpp.
References mim::plug::core::add, mim::App::callee(), fold_shape_and_index(), mim::Axm::isa(), normalize_set(), op_set(), mim::Def::projs(), and mim::Def::type().
Referenced by normalize_set().
Definition at line 287 of file normalizers.cpp.
References mim::App::arg(), mim::Lit::isa(), normalize_shape(), and mim::Def::type().
Referenced by normalize_shape().
Definition at line 215 of file normalizers.cpp.
References mim::Lit::isa(), and normalize_slice().
Referenced by normalize_slice().
|
inline |
Definition at line 64 of file tensor.h.
References op_get(), and mim::Def::world().
Referenced by normalize_get(), and op_get().
|
inline |
Definition at line 70 of file tensor.h.
References op_set(), and mim::Def::world().
Referenced by normalize_set(), and op_set().
| void mim::plug::tensor::reg_phases | ( | Flags2Phases & | phases | ) |
Definition at line 16 of file tensor.cpp.
References mim::Phase::hook(), and reg_phases().
Referenced by mim_get_plugin(), and reg_phases().
| void mim::plug::tensor::register_normalizers | ( | Normalizers & | normalizers | ) |
References register_normalizers().
Referenced by mim_get_plugin(), and register_normalizers().