pub enum PagedDecodePlan {
Replan,
PlanOnce,
}Expand description
Runtime policy for the paged persistent decode path
(LlamaModel::forward_paged_step_persistent):
whether to build the plan
ONCE and reuse it across tokens, or re-plan every token (the pre-plan-once
behavior). The paged driver holds this per config and passes it each step;
the driver default is PlanOnce (set by
PagedSessionScheduler::new), with Replan available as an
explicit opt-out.
The A/B rollout this flag was built for is DONE, and the default moved with
the result. Measured (nsys, Lightbulb, 2026-08-01; 16 tokens, same binary and
model, only the plan mode differing): Replan → PlanOnce is 29.7× on
ms/token (8,192.0 → 275.8) and cuts host-ward DtoH 61% (101,691 → 40,088 MB)
at IDENTICAL kernel-launch count (17,802 in both arms — same compute, less
data movement). Shipping Replan as the default meant every consumer who did
not know to opt in paid that 29.7×.
It remains a real runtime flag — not a test hook — because toggling it in ONE
process is what lets the correctness gate run both arms off a single setup,
and because Replan is the parity reference the plan-once path is checked
against. On Replan the persistent forward drops any held
session (so nothing stale lingers) and delegates to the re-planning
LlamaModel::forward_paged_step;
on PlanOnce it
builds-once / rebinds.
Variants§
Replan
Re-plan (build + optimize the graph) every token — the pre-plan-once
path. Drops any held PagedDecodeSession and routes to
LlamaModel::forward_paged_step.
PlanOnce
Build + optimize the graph ONCE (into a PagedDecodeSession) and reuse
it (rebinding only the per-token data) for every subsequent token.
Trait Implementations§
Source§impl Clone for PagedDecodePlan
impl Clone for PagedDecodePlan
impl Copy for PagedDecodePlan
Source§impl Debug for PagedDecodePlan
impl Debug for PagedDecodePlan
impl Eq for PagedDecodePlan
Source§impl PartialEq for PagedDecodePlan
impl PartialEq for PagedDecodePlan
impl StructuralPartialEq for PagedDecodePlan
Auto Trait Implementations§
impl Freeze for PagedDecodePlan
impl RefUnwindSafe for PagedDecodePlan
impl Send for PagedDecodePlan
impl Sync for PagedDecodePlan
impl Unpin for PagedDecodePlan
impl UnsafeUnpin for PagedDecodePlan
impl UnwindSafe for PagedDecodePlan
Blanket Implementations§
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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