mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-11-08 10:07:01 +00:00
ggml-zdnn: fix sequencing of transforms
Signed-off-by: Aaron Teo <aaron.teo1@ibm.com>
This commit is contained in:
@@ -55,9 +55,9 @@ static bool ggml_zdnn_op_mul_mat(struct ggml_backend_zdnn_context * ctx, const g
|
||||
&weights_extra->pre_tfm_desc,
|
||||
weights->ne[1], weights->ne[0]
|
||||
);
|
||||
ZDNN_CHECK(zdnn_transform_ztensor(&weights_extra->ztensor, weights->data));
|
||||
ZDNN_CHECK(zdnn_generate_transformed_desc(&weights_extra->pre_tfm_desc, &weights_extra->tfm_desc));
|
||||
ZDNN_CHECK(zdnn_init_ztensor_with_malloc(&weights_extra->pre_tfm_desc, &weights_extra->tfm_desc, &weights_extra->ztensor));
|
||||
ZDNN_CHECK(zdnn_transform_ztensor(&weights_extra->ztensor, weights->data));
|
||||
|
||||
// have to do this here because although it was transformed, the shape is wrong
|
||||
if (&inputs_extra->ztensor.is_transformed) zdnn_reset_ztensor(&inputs_extra->ztensor);
|
||||
@@ -67,9 +67,9 @@ static bool ggml_zdnn_op_mul_mat(struct ggml_backend_zdnn_context * ctx, const g
|
||||
&inputs_extra->pre_tfm_desc,
|
||||
inputs->ne[1], inputs->ne[0]
|
||||
);
|
||||
ZDNN_CHECK(zdnn_transform_ztensor(&inputs_extra->ztensor, inputs->data));
|
||||
ZDNN_CHECK(zdnn_generate_transformed_desc(&inputs_extra->pre_tfm_desc, &inputs_extra->tfm_desc));
|
||||
ZDNN_CHECK(zdnn_init_ztensor_with_malloc(&inputs_extra->pre_tfm_desc, &inputs_extra->tfm_desc, &inputs_extra->ztensor));
|
||||
ZDNN_CHECK(zdnn_transform_ztensor(&inputs_extra->ztensor, inputs->data));
|
||||
|
||||
// have to transform the bias ztensor here because only GGML_OP_NONE goes through set_tensor
|
||||
ZDNN_CHECK(zdnn_transform_ztensor(&bias_extra->ztensor, bias_extra->data));
|
||||
|
||||
Reference in New Issue
Block a user