pub struct Q4KWeight<R: Runtime> { /* private fields */ }Expand description
A weight matrix resident in VRAM in packed Q4_K form ([n_out, k],
k % 256 == 0, superblocks along k).
Implementations§
Source§impl<R: Runtime> Q4KWeight<R>
impl<R: Runtime> Q4KWeight<R>
Sourcepub fn from_gguf_bytes(
client: &ComputeClient<R>,
data: &[u8],
n_out: usize,
k: usize,
) -> Result<Self>
pub fn from_gguf_bytes( client: &ComputeClient<R>, data: &[u8], n_out: usize, k: usize, ) -> Result<Self>
Repacks a GGUF Q4_K tensor onto the device.
Sourcepub fn vram_bytes(&self) -> usize
pub fn vram_bytes(&self) -> usize
Bytes in VRAM: 148 per 256 weights (4.63 bits/weight).
Sourcepub fn matmul_device(
&self,
client: &ComputeClient<R>,
x: Handle,
m: usize,
) -> Handle
pub fn matmul_device( &self, client: &ComputeClient<R>, x: Handle, m: usize, ) -> Handle
Device path: launch only, output handle returned. Decode (m == 1)
keeps the untiled kernel; prefill (m > 1) takes the shared-memory
tiled kernel unless COMBS_NO_TILED_MATMUL=1.
Sourcepub fn matmul_host(
&self,
client: &ComputeClient<R>,
x: &[f32],
m: usize,
) -> Result<Vec<f32>>
pub fn matmul_host( &self, client: &ComputeClient<R>, x: &[f32], m: usize, ) -> Result<Vec<f32>>
y = x @ W^T for host-side x: [m, k], returning [m, n_out].
Auto Trait Implementations§
impl<R> !RefUnwindSafe for Q4KWeight<R>
impl<R> !UnwindSafe for Q4KWeight<R>
impl<R> Freeze for Q4KWeight<R>
impl<R> Send for Q4KWeight<R>
impl<R> Sync for Q4KWeight<R>
impl<R> Unpin for Q4KWeight<R>where
R: Unpin,
impl<R> UnsafeUnpin for Q4KWeight<R>
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