Skip to content
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
6 changes: 6 additions & 0 deletions src/llama-graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ void llm_graph_input_dspark_logsnr::set_input(const llama_ubatch * ubatch) {
}
}

bool llm_graph_input_dspark_logsnr::can_reuse(const llm_graph_params & params) {
// v_feat is a function of n_tokens and n_seqs_unq, both already checked by
// llm_graph_params::allow_reuse, and of min/max_log_snr, fixed per model
return feat && feat->ne[1] == params.ubatch.n_tokens;
}

void llm_graph_input_embd::set_input(const llama_ubatch * ubatch) {
if (ubatch->token) {
const int64_t n_tokens = ubatch->n_tokens;
Expand Down
2 changes: 2 additions & 0 deletions src/llama-graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ class llm_graph_input_dspark_logsnr : public llm_graph_input_i {

void set_input(const llama_ubatch * ubatch) override;

bool can_reuse(const llm_graph_params & params) override;

ggml_tensor * feat = nullptr; // F32 [128, n_tokens]

std::vector<float> v_feat;
Expand Down