Skip to content

llama : fix build + fix fabs compile warnings #8683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/llama-grammar.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ struct llama_grammar {
llama_partial_utf8 partial_utf8;
};

struct llama_grammar * llama_get_grammar(struct llama_context * ctx);

//
// internal API
//
Expand Down
10 changes: 2 additions & 8 deletions src/llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2657,7 +2657,6 @@ struct llama_context {
llama_context(const llama_model & model)
: model(model)
, sampling(llama_n_vocab(&model))
, grammar()
, t_start_us(model.t_start_us)
, t_load_us(model.t_load_us) {}

Expand All @@ -2675,7 +2674,6 @@ struct llama_context {

struct llama_cparams cparams;
struct llama_sampling sampling;
struct llama_grammar grammar;
struct llama_kv_cache kv_self;
struct llama_control_vector cvec;

Expand Down Expand Up @@ -14048,7 +14046,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
f = -INFINITY;
} else {
if (hparams.use_alibi) {
f = -fabs(lctx.kv_self.cells[i].pos - pos);
f = -std::abs(lctx.kv_self.cells[i].pos - pos);
} else {
f = 0.0f;
}
Expand Down Expand Up @@ -14102,7 +14100,7 @@ static void llama_set_inputs(llama_context & lctx, const llama_batch & batch) {
for (int s = 0; s < batch.n_seq_id[i]; ++s) {
if (batch.seq_id[i][s] == seq_id) {
if (hparams.use_alibi) {
f = -fabs(batch.pos[i] - batch.pos[j]);
f = -std::abs(batch.pos[i] - batch.pos[j]);
} else {
f = 0.0f;
}
Expand Down Expand Up @@ -16835,10 +16833,6 @@ const struct llama_vocab * llama_get_vocab(const struct llama_context * ctx) {
return &ctx->model.vocab;
}

struct llama_grammar * llama_get_grammar(struct llama_context * ctx) {
return &ctx->grammar;
}

uint32_t llama_n_ctx(const struct llama_context * ctx) {
return ctx->cparams.n_ctx;
}
Expand Down
Loading