pub struct AwqWeight {
pub weight: Tensor,
pub zeros: Tensor,
pub scales: Tensor,
pub oc: usize,
pub ic: usize,
pub group_size: usize,
}Expand description
An AWQ-quantized linear weight, materialized as the three Tensor inputs
fuel_graph::NodeHandle::awq_matmul expects (kernel layout), plus the
geometry the matmul builder needs.
Fields§
§weight: Tensor[OC, IC/8] U32, sequential nibble order.
zeros: Tensor[OC, zeros_w] U32.
scales: Tensor[OC, 8 * zeros_w] F16.
oc: usizeOutput features.
ic: usizeInput features.
group_size: usizeQuantization group size (64 or 128).
Implementations§
Source§impl AwqWeight
impl AwqWeight
Sourcepub fn matmul(&self, activations: &Tensor, split_k_iters: i32) -> Result<Tensor>
pub fn matmul(&self, activations: &Tensor, split_k_iters: i32) -> Result<Tensor>
activations @ dequant(weight)ᵀ via the fused AWQ_MATMUL op.
activations must live on the same graph as the weight tensors (build
it from self.weight.graph_tensor()). Output [..., M, OC] in the
activations’ dtype.
split_k_iters is a CUDA launch-tuning parameter (8 is AutoAWQ’s
default); the decompose path ignores it, so it is validated here rather
than left to a kernel launch: it must be positive. The kernel’s own
constraints (ic % (32 * split_k_iters) == 0, oc % 64 == 0, sm_80+)
are baracuda’s can_implement’s to enforce at launch.
Auto Trait Implementations§
impl Freeze for AwqWeight
impl RefUnwindSafe for AwqWeight
impl Send for AwqWeight
impl Sync for AwqWeight
impl Unpin for AwqWeight
impl UnsafeUnpin for AwqWeight
impl UnwindSafe for AwqWeight
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
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