#pragma once #include #include #include namespace ling3 { struct DynamicQuantization { float scale = 1.0F; std::size_t clipped = 0; }; DynamicQuantization QuantizeSymmetricInt8( std::span input, std::span output) noexcept; DynamicQuantization QuantizeSymmetricInt4( std::span input, std::span output) noexcept; std::int8_t DecodeInt4LowFirst( std::span packed, std::size_t index); void SplitInt8ForInt4Matmul( std::span input, std::span high, std::span low); void ReferenceW4Linear( std::span input, std::span packed_weights, std::size_t output_channels, std::span output); void DequantizePerChannel( std::span input, float input_scale, std::span weight_scales, std::span output) noexcept; } // namespace ling3