cont : naming

This commit is contained in:
Georgi Gerganov
2026-08-12 16:18:29 +03:00
parent 8e9ed92b7f
commit d493bc8922
3 changed files with 16 additions and 13 deletions
+6 -6
View File
@@ -2393,11 +2393,11 @@ llm_graph_result * llama_context::get_gf_res_reserve() const {
}
// pack sampler outputs into as few sequences as possible before using sequences without samplers
static void ubatch_prepare_reserve(
llama_ubatch & ubatch,
uint32_t n_outputs,
const std::map<llama_seq_id, llama_sampler *> & samplers,
uint32_t n_outputs_max_per_seq) {
static void graph_reserve_prepare_ubatch(
llama_ubatch & ubatch,
const llama_samplers & samplers,
uint32_t n_outputs,
uint32_t n_outputs_max_per_seq) {
const uint32_t n_seqs = ubatch.n_seqs;
const uint32_t n_seq_tokens = ubatch.n_seq_tokens;
@@ -2474,7 +2474,7 @@ llama_context::graph_reserve_result llama_context::graph_reserve(graph_reserve_p
llama_batch_allocr balloc(model.hparams.n_pos_per_embd());
llama_ubatch ubatch = balloc.ubatch_reserve(params.n_tokens/params.n_seqs, params.n_seqs);
ubatch_prepare_reserve(ubatch, params.n_outputs, sampling.samplers, cparams.n_outputs_max_per_seq);
graph_reserve_prepare_ubatch(ubatch, sampling.samplers, params.n_outputs, cparams.n_outputs_max_per_seq);
auto * res = gf_res_reserve.get();
+1 -1
View File
@@ -320,7 +320,7 @@ private:
struct sampling_info {
// !samplers.empty() to check if any samplers are active
std::map<llama_seq_id, llama_sampler *> samplers;
llama_samplers samplers;
buffer_view<float> logits = {nullptr, 0};
buffer_view<llama_token> sampled = {nullptr, 0};
+9 -6
View File
@@ -31,6 +31,9 @@ class llama_memory_recurrent_context;
class llama_memory_hybrid_context;
class llama_memory_hybrid_iswa_context;
// shorthands
using llama_samplers = std::map<llama_seq_id, struct llama_sampler *>;
// certain models (typically multi-modal) can produce different types of graphs
enum llm_graph_type {
LLM_GRAPH_TYPE_DEFAULT,
@@ -709,14 +712,14 @@ public:
class llm_graph_input_sampling : public llm_graph_input_i {
public:
llm_graph_input_sampling(std::map<llama_seq_id, llama_sampler *> samplers) :
llm_graph_input_sampling(llama_samplers samplers) :
samplers(std::move(samplers)) { }
virtual ~llm_graph_input_sampling() = default;
void set_input(const llama_ubatch * ubatch) override;
bool can_reuse(const llm_graph_params & params) override;
std::map<llama_seq_id, llama_sampler *> samplers;
llama_samplers samplers;
};
//
@@ -752,11 +755,11 @@ struct llm_graph_params {
const llama_memory_context_i * mctx;
const llama_cross * cross;
std::map<llama_seq_id, llama_sampler *> samplers;
llama_samplers samplers;
static bool samplers_equal(
const std::map<llama_seq_id, llama_sampler *> & lhs,
const std::map<llama_seq_id, llama_sampler *> & rhs) {
const llama_samplers & lhs,
const llama_samplers & rhs) {
if (lhs.size() != rhs.size()) {
return false;
}
@@ -992,7 +995,7 @@ struct llm_graph_context {
const llama_memory_context_i * mctx;
const llama_cross * cross;
std::map<llama_seq_id, llama_sampler *> samplers;
llama_samplers samplers;
const llm_graph_cb & cb_func;