CANN: Uses yarn_ramp cache in ROPE (#17725)

This commit is contained in:
TianHao324
2025-12-24 14:55:33 +08:00
committed by GitHub
parent 10355dc7d0
commit cf2ffc02bc
2 changed files with 12 additions and 6 deletions
+4
View File
@@ -318,6 +318,9 @@ struct ggml_cann_rope_cache {
if (position_select_index_host) {
free(position_select_index_host);
}
if (yarn_ramp_cache) {
ACL_CHECK(aclrtFree(yarn_ramp_cache));
}
}
bool equal(int64_t theta_scale_length,
@@ -370,6 +373,7 @@ struct ggml_cann_rope_cache {
float * theta_scale_exp_host = nullptr;
int * position_select_index_host = nullptr;
void * position_select_index = nullptr;
void * yarn_ramp_cache = nullptr;
// sin/cos cache, used only to accelerate first layer on each device
void * sin_cache = nullptr;
void * cos_cache = nullptr;