pub struct Q8SectionSink<'a, W> { /* private fields */ }Expand description
A bounded bridge from canonical Q8 matrix rows into one streaming .fttsq section.
.fttsq keeps the Q8 tensor contiguous, followed by the contiguous F32 scale tensor that its
directory names. The sink therefore streams every Q8 row immediately, retaining only the scale
tail (at most one MiB for the pinned inventory) until the values have completed. It also keeps
one byte-per-row scratch buffer for the signed-to-wire byte conversion, so the total working
set remains bounded by the row adapter’s 320 KiB plus at most 64 KiB of value bytes and one MiB
of scales — never by the full matrix size.
Implementations§
Source§impl<'a, W: Write + Seek> Q8SectionSink<'a, W>
impl<'a, W: Write + Seek> Q8SectionSink<'a, W>
Sourcepub fn new(
writer: &'a mut FttsqStreamingWriter<W>,
section: impl Into<String>,
expected_rows: usize,
) -> Result<Self, Q8SectionSinkError>
pub fn new( writer: &'a mut FttsqStreamingWriter<W>, section: impl Into<String>, expected_rows: usize, ) -> Result<Self, Q8SectionSinkError>
Starts writing one Q8 matrix section with a fixed number of output channels.
§Errors
Returns Q8SectionSinkError::OutputChannelCountTooLarge before allocating when the
planned F32 scale tail exceeds this adapter’s one-MiB memory ceiling.