pub struct DeviceRouteScratch<'a, B: Backend> {
pub selected_ids: &'a mut B::Buffer,
pub pair_weights: &'a mut B::Buffer,
pub pairs_by_token: &'a mut B::Buffer,
pub packed_token_idx: &'a mut B::Buffer,
pub expert_offsets: &'a mut B::Buffer,
pub sorted_tokens: &'a mut B::Buffer,
pub block_ids: &'a mut B::Buffer,
pub total_post_pad: &'a mut B::Buffer,
}Expand description
Bundle of pre-allocated device buffers for the graph-capturable
device-routing path in moe_forward_bucketed. Pass Some to
take the device path (under FERRUM_MOE_DEVICE_ROUTE=1); pass
None for the legacy host-mediated path (used by tests + the
non-vLLM CUDA bucketed path).
Pre-allocated on Qwen3MoeScratch (route_pairs_dev etc.) so the
per-layer call doesn’t alloc inside a captured stream.
Fields§
§selected_ids: &'a mut B::Buffer§pair_weights: &'a mut B::Buffer§pairs_by_token: &'a mut B::Buffer§packed_token_idx: &'a mut B::Buffer§expert_offsets: &'a mut B::Buffer§sorted_tokens: &'a mut B::Buffer§block_ids: &'a mut B::Buffer§total_post_pad: &'a mut B::BufferAuto Trait Implementations§
impl<'a, B> !UnwindSafe for DeviceRouteScratch<'a, B>
impl<'a, B> Freeze for DeviceRouteScratch<'a, B>
impl<'a, B> RefUnwindSafe for DeviceRouteScratch<'a, B>
impl<'a, B> Send for DeviceRouteScratch<'a, B>
impl<'a, B> Sync for DeviceRouteScratch<'a, B>
impl<'a, B> Unpin for DeviceRouteScratch<'a, B>
impl<'a, B> UnsafeUnpin for DeviceRouteScratch<'a, B>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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