Skip to content

Commit

Permalink
ggml: remove calculate_n_rot function
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Bevenius <[email protected]>
  • Loading branch information
danbev committed Aug 2, 2024
1 parent df52f92 commit ad8f82a
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions fundamentals/ggml/src/rope.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@
#include "ggml-alloc.h"
#include "ggml-backend.h"

double calculate_n_rot(double x, double base, int max_pos_emb, int n_dims) {
const double pi = M_PI;
// Calculate the exponent
double exponent = (2.0 * max_pos_emb) / n_dims;
// Calculate base raised to the power of the exponent
double base_to_power = pow(base, exponent);
// Calculate the final result
double n_rot = 2 * pi * x * base_to_power;
return n_rot;
}

int main(int argc, char **argv) {
printf("GGML RoPE example\n");

Expand Down Expand Up @@ -56,7 +45,7 @@ int main(int argc, char **argv) {
for (int k = 0; k < a->ne[0]; k++) {
// TODO: make the value a random value.
//float value = 1.0f + k;
float value = 8.3f + k;
float value = 0.0f + k;
ggml_set_f32_nd(a, k, j, i, 0, value);
}
}
Expand Down

0 comments on commit ad8f82a

Please sign in to comment.