Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ inline ggml_type common_mul_mat_format_type(CommonMulMatWeightFormat format) {
return GGML_TYPE_IQ3_S;
case CommonMulMatWeightFormat::IQ4_NL:
return GGML_TYPE_IQ4_NL;
case CommonMulMatWeightFormat::MXFP4:
return GGML_TYPE_MXFP4;
case CommonMulMatWeightFormat::IQ4_XS:
return GGML_TYPE_IQ4_XS;
case CommonMulMatWeightFormat::Q8_0:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ inline bool common_mul_mat_id_same_shape(const Value & lhs, const Value & rhs) {
}

inline bool common_mul_mat_id_supported_dense_input_size(CommonMulMatWeightFormat format, int64_t input_size) {
return common_mul_mat_supported_dense_input_size(format, input_size);
// the MUL_MAT_ID kernels declare input_size mul(256), also for the 32-value block formats
return common_mul_mat_supported_dense_input_size(format, input_size) && input_size % 256 == 0;
}

inline bool common_mul_mat_id_supported_dense_output_size(int64_t output_size) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum class CommonMulMatWeightFormat {
IQ2_S,
IQ3_S,
IQ4_NL,
MXFP4,
IQ4_XS,
Q8_0,
Q8_1,
Expand Down Expand Up @@ -99,6 +100,9 @@ inline bool common_mul_mat_format_for_type(ggml_type type, CommonMulMatWeightFor
case GGML_TYPE_IQ4_NL:
format = CommonMulMatWeightFormat::IQ4_NL;
return true;
case GGML_TYPE_MXFP4:
format = CommonMulMatWeightFormat::MXFP4;
return true;
case GGML_TYPE_IQ4_XS:
format = CommonMulMatWeightFormat::IQ4_XS;
return true;
Expand Down Expand Up @@ -168,6 +172,8 @@ inline int64_t common_mul_mat_format_config_value(CommonMulMatWeightFormat forma
return 21;
case CommonMulMatWeightFormat::IQ4_NL:
return 20;
case CommonMulMatWeightFormat::MXFP4:
return 39;
case CommonMulMatWeightFormat::IQ4_XS:
return 23;
case CommonMulMatWeightFormat::Q8_0:
Expand Down Expand Up @@ -200,6 +206,7 @@ inline bool common_mul_mat_supported_dense_input_size(CommonMulMatWeightFormat f
case CommonMulMatWeightFormat::Q5_0:
case CommonMulMatWeightFormat::Q5_1:
case CommonMulMatWeightFormat::IQ4_NL:
case CommonMulMatWeightFormat::MXFP4:
case CommonMulMatWeightFormat::Q8_0:
case CommonMulMatWeightFormat::Q8_1:
return input_size >= 256 && input_size <= 32768 && input_size % 32 == 0;
Expand Down
Loading
Loading