pub struct PsaPackQkvOp<D: Float + Send + Sync + 'static> { /* private fields */ }Expand description
CustomOp for PsaPackQkvRuntimeOp.
Graph node: [B, qkv_h, H, W] → [4, BH, N, KEY_DIM]
Implementations§
Trait Implementations§
Source§impl<D: Float + Send + Sync + 'static> CustomOp for PsaPackQkvOp<D>
impl<D: Float + Send + Sync + 'static> CustomOp for PsaPackQkvOp<D>
Source§fn infer_output_shape(&self, input_shapes: &[&Shape]) -> Shape
fn infer_output_shape(&self, input_shapes: &[&Shape]) -> Shape
Output shape: [B, 4, num_heads, N, KEY_DIM]
B is kept as the leading (potentially-None) dimension so that
resolve_shape(…, batch_size) sets it to batch_size directly.
Placing B first avoids the prior bug where BH = B * num_heads was
stored as None and resolved to batch_size instead of
batch_size * num_heads.
Source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Expose
self as &dyn Any so the custom lowering can downcast to the
concrete op type. Implement as fn as_any(&self) -> &dyn Any { self }.Source§fn lower(&self) -> Option<(String, String, String, Arc<dyn RuntimeOp>)>
fn lower(&self) -> Option<(String, String, String, Arc<dyn RuntimeOp>)>
Return kernel lowering info so
TritonLowering can compile this op
without a project-specific middleware. Return None to keep the
existing middleware / error behaviour. Read moreSource§fn lower_backward_source(&self) -> String
fn lower_backward_source(&self) -> String
Return the backward kernel source for this op (used in training mode).
Return an empty string if this op has no backward pass.
Auto Trait Implementations§
impl<D> Freeze for PsaPackQkvOp<D>
impl<D> RefUnwindSafe for PsaPackQkvOp<D>where
D: RefUnwindSafe,
impl<D> Send for PsaPackQkvOp<D>
impl<D> Sync for PsaPackQkvOp<D>
impl<D> Unpin for PsaPackQkvOp<D>
impl<D> UnsafeUnpin for PsaPackQkvOp<D>
impl<D> UnwindSafe for PsaPackQkvOp<D>where
D: RefUnwindSafe,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more