diff --git a/bindings/cpp/include/svs/runtime/api_defs.h b/bindings/cpp/include/svs/runtime/api_defs.h index 3460dbc7d..f77df9d78 100644 --- a/bindings/cpp/include/svs/runtime/api_defs.h +++ b/bindings/cpp/include/svs/runtime/api_defs.h @@ -100,6 +100,7 @@ enum class StorageKind { FP16, SQI8, LVQ4x0, + LVQ8x0, LVQ4x4, LVQ4x8, LeanVec4x4, diff --git a/bindings/cpp/src/svs_runtime_utils.h b/bindings/cpp/src/svs_runtime_utils.h index 8ab0c2884..e14ce21ca 100644 --- a/bindings/cpp/src/svs_runtime_utils.h +++ b/bindings/cpp/src/svs_runtime_utils.h @@ -99,8 +99,8 @@ namespace storage { // Consolidated storage kind checks using constexpr functions inline constexpr bool is_lvq_storage(StorageKind kind) { - return kind == StorageKind::LVQ4x0 || kind == StorageKind::LVQ4x4 || - kind == StorageKind::LVQ4x8; + return kind == StorageKind::LVQ4x0 || kind == StorageKind::LVQ8x0 || + kind == StorageKind::LVQ4x4 || kind == StorageKind::LVQ4x8; } inline constexpr bool is_leanvec_storage(StorageKind kind) { @@ -129,6 +129,7 @@ SVS_DEFINE_STORAGE_KIND_TAG(FP32); SVS_DEFINE_STORAGE_KIND_TAG(FP16); SVS_DEFINE_STORAGE_KIND_TAG(SQI8); SVS_DEFINE_STORAGE_KIND_TAG(LVQ4x0); +SVS_DEFINE_STORAGE_KIND_TAG(LVQ8x0); SVS_DEFINE_STORAGE_KIND_TAG(LVQ4x4); SVS_DEFINE_STORAGE_KIND_TAG(LVQ4x8); SVS_DEFINE_STORAGE_KIND_TAG(LeanVec4x4); @@ -235,18 +236,22 @@ struct StorageFactory { // LVQ Storage support #ifdef SVS_LVQ_HEADER -template +template using LVQDatasetType = svs::quantization::lvq::LVQDataset< Primary, Residual, svs::Dynamic, - svs::quantization::lvq::Turbo<16, 8>, + Strategy, svs::data::Blocked>>; +using Sequential = svs::quantization::lvq::Sequential; +using Turbo16x8 = svs::quantization::lvq::Turbo<16, 8>; + // clang-format off -template <> struct StorageType { using type = LVQDatasetType<4, 0>; }; -template <> struct StorageType { using type = LVQDatasetType<4, 4>; }; -template <> struct StorageType { using type = LVQDatasetType<4, 8>; }; +template <> struct StorageType { using type = LVQDatasetType<4, 0, Turbo16x8>; }; +template <> struct StorageType { using type = LVQDatasetType<8, 0, Sequential>; }; +template <> struct StorageType { using type = LVQDatasetType<4, 4, Turbo16x8>; }; +template <> struct StorageType { using type = LVQDatasetType<4, 8, Turbo16x8>; }; // clang-format on template @@ -332,6 +337,8 @@ auto dispatch_storage_kind(StorageKind kind, F&& f, Args&&... args) { return f(SQI8Tag{}, std::forward(args)...); case StorageKind::LVQ4x0: return f(LVQ4x0Tag{}, std::forward(args)...); + case StorageKind::LVQ8x0: + return f(LVQ8x0Tag{}, std::forward(args)...); case StorageKind::LVQ4x4: return f(LVQ4x4Tag{}, std::forward(args)...); case StorageKind::LVQ4x8: