Skip to content

Commit 33b2960

Browse files
committed
try fix rms_norm
1 parent c2076d8 commit 33b2960

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ggml/src/ggml-qnn/backend-ops.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ constexpr const bool kQnnSupportedOps[] = {
163163
false, // GGML_OP_CONCAT
164164
false, // GGML_OP_SILU_BACK
165165
false, // GGML_OP_NORM
166-
false, // GGML_OP_RMS_NORM
166+
true, // GGML_OP_RMS_NORM
167167
false, // GGML_OP_RMS_NORM_BACK
168168
false, // GGML_OP_GROUP_NORM
169169

ggml/src/ggml-qnn/op-config-caps.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ void generic_get_op_desc(const ggml_tensor * op, bool append_dimensions, std::st
4444
}
4545
}
4646

47+
void rms_norm_get_op_desc(const ggml_tensor * op, bool append_dimensions, std::string & output) {
48+
generic_get_op_desc(op, append_dimensions, output);
49+
50+
// Append the epsilon parameter
51+
output += '_';
52+
float epsilon = 0.0f;
53+
memcpy(&epsilon, op->op_params, sizeof(epsilon));
54+
output += std::to_string(epsilon);
55+
}
56+
4757
struct qnn_op_caps_t {
4858
const char * qnn_op_name = nullptr;
4959
const size_t input_param_count = 0;
@@ -109,7 +119,7 @@ constexpr const qnn_op_caps_t kOpCaps[] = {
109119
// GGML_OP_RMS_NORM
110120
QNN_OP_RMS_NORM, // qnn_op_name
111121
1, // input_param_count
112-
generic_get_op_desc, // get_desc
122+
rms_norm_get_op_desc, // get_desc
113123
QNN_OP_RMS_NORM_PARAM_EPSILON, // qnn_param_name
114124
},
115125
{}, // GGML_OP_RMS_NORM_BACK

0 commit comments

Comments
 (0)