pub enum DecodePrecision {
Model,
Fp16,
}Expand description
Decoder-wide numeric precision for the session’s decode graph.
This is a generic, model-agnostic knob selected via
SessionBuilder::decode_precision. The default,
DecodePrecision::Model, runs the graph exactly as authored, so default
runtime behaviour is byte-identical to a build with no precision knob at all.
DecodePrecision::Fp16 requests a whole-decoder fp32→fp16 rewrite (see
[fp16_decode]). It only takes effect on a GPU device and only for an
fp32-activation int4/block-32 quantized decoder (fp32-scale MatMulNBits);
for every other model — including native fp16-activation models — it is a
strict no-op, leaving the graph bit-identical.
Variants§
Model
Run the decoder at the precision authored in the model graph (default).
Fp16
Cast an fp32-activation int4/block-32 decoder to a fully fp16 graph so a GPU backend runs it through the fp16-fused decode kernels. No-op unless the session targets a GPU and the graph is fp32-activation quantized.
Trait Implementations§
Source§impl Clone for DecodePrecision
impl Clone for DecodePrecision
Source§fn clone(&self) -> DecodePrecision
fn clone(&self) -> DecodePrecision
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DecodePrecision
Source§impl Debug for DecodePrecision
impl Debug for DecodePrecision
Source§impl Default for DecodePrecision
impl Default for DecodePrecision
Source§fn default() -> DecodePrecision
fn default() -> DecodePrecision
impl Eq for DecodePrecision
Source§impl PartialEq for DecodePrecision
impl PartialEq for DecodePrecision
impl StructuralPartialEq for DecodePrecision
Auto Trait Implementations§
impl Freeze for DecodePrecision
impl RefUnwindSafe for DecodePrecision
impl Send for DecodePrecision
impl Sync for DecodePrecision
impl Unpin for DecodePrecision
impl UnsafeUnpin for DecodePrecision
impl UnwindSafe for DecodePrecision
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
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<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