Skip to content

Commit b6c84af

Browse files
committed
Fix ROPE accuracy when freq_scale != 1
1 parent a079242 commit b6c84af

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

ggml/src/ggml-openvino/ggml-openvino.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,8 @@ static bool is_op_unsupported_case(const ggml_tensor* op) {
319319
return true;
320320
}
321321
float freq_scale;
322-
memcpy(&freq_scale, op_params + 6, sizeof(float));
323-
if (freq_scale != 0.0f && freq_scale != 1.0f) {
324-
GGML_LOG_WARN("OpenVINO backend does not support ROPE with freq_scale %f != 1.0f\n", freq_scale);
325-
return true;
326-
}
327322
float ext_factor;
323+
memcpy(&freq_scale, op_params + 6, sizeof(float));
328324
memcpy(&ext_factor, op_params + 7, sizeof(float));
329325
if (ext_factor != 0.0f) {
330326
GGML_LOG_WARN("OpenVINO backend does not support ROPE with ext_factor %f != 0.0f\n", ext_factor);

ggml/src/ggml-openvino/openvino/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ std::pair<ov::Output<Node>, ov::Output<Node>> make_sin_cos(int32_t* rope_params,
140140
ggml_rope_yarn_corr_dims(n_dims, n_ctx_orig, freq_base, beta_fast, beta_slow, corr_dims);
141141

142142
std::vector<float> factor(n_dims / 2);
143-
factor[0] = freq_scale;
143+
factor[0] = 1.0f;
144144
for (size_t i = 1; i < factor.size(); i++) {
145145
factor[i] = theta_scale * factor[i - 1];
146146
}

0 commit comments

Comments
 (0)