pub enum OpNode {
Show 16 variants
Elementwise {
f: EwKind,
},
MatMul {
m: u32,
n: u32,
k: u32,
tc: bool,
trans_b: bool,
},
Gemv {
m: u32,
n: u32,
tc: bool,
},
Fft {
len: u32,
inverse: bool,
},
Reduce {
op: RedKind,
axis: Axis,
},
GatherDequant {
scheme: DType,
block: u32,
},
Broadcast {
shape: Shape,
},
Softmax {
axis: Axis,
},
Stencil {
kind: StencilKind,
halo: u32,
axis: Axis,
},
ScatterAccum {
op: AccumKind,
},
Neighbor {
kind: NbKind,
k_or_r: f32,
dims: u8,
enc: NeighborEnc,
},
Slice {
offset: u32,
len: u32,
},
Rope {
head_dim: u32,
pos: u32,
mode: u32,
base_bits: u32,
},
Pool2d {
c: u32,
h: u32,
w: u32,
kh: u32,
kw: u32,
stride_h: u32,
stride_w: u32,
},
Resize2d {
c: u32,
h_in: u32,
w_in: u32,
h_out: u32,
w_out: u32,
},
Conv2d {
c_in: u32,
c_out: u32,
h: u32,
w: u32,
kh: u32,
kw: u32,
stride_h: u32,
stride_w: u32,
pad_h: u32,
pad_w: u32,
},
}Expand description
An op-CLASS and its compile-time payload — the node label of the compute DAG (plan §2;
Slice/Rope added for the real decode layer). Seed arms (Elementwise/MatMul/Gemv/
Fft) have a real lowering today; the rest are declared so the vocabulary is fixed, and lower
to an explicit Err until their phase builds them.
Variants§
Elementwise
MatMul
Gemv
Fields
Fft
Reduce
GatherDequant
Broadcast
Softmax
Stencil
ScatterAccum
Neighbor
Slice
Extract a contiguous sub-range input[offset .. offset+len] (1 input → [len]). The
composable primitive for per-head slicing of projected q/K/V in multi-head attention.
Rope
Rotary position embedding over a flat [.., head_dim] vector (1 input). pos is carried so
the executor writes it into the kernel’s params buffer — the kernel source is independent
of pos, so the pipeline cache stays warm across tokens. mode is 0=interleaved / 1=NeoX;
base_bits is the f32 θ-base bit pattern. See graph_ops::stencil::{rope_wgsl, rope_cpu}.
Pool2d
NCHW max-pool 2D (vision). Inputs: feature map only; params packed in op.
Resize2d
NCHW nearest resize 2D (vision).
Conv2d
NCHW Conv2D f32 (vision). Inputs: activation, weight, bias (bias may be zeros).
Trait Implementations§
impl Copy for OpNode
impl StructuralPartialEq for OpNode
Auto Trait Implementations§
impl Freeze for OpNode
impl RefUnwindSafe for OpNode
impl Send for OpNode
impl Sync for OpNode
impl Unpin for OpNode
impl UnsafeUnpin for OpNode
impl UnwindSafe for OpNode
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more