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
1 change: 1 addition & 0 deletions src/llama-arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ static const std::map<llm_kv, const char *> LLM_KV_NAMES = {
{ LLM_KV_CLASSIFIER_OUTPUT_LABELS, "%s.classifier.output_labels" },

{ LLM_KV_TARGET_LAYERS, "%s.target_layers" },
{ LLM_KV_CONFIDENCE_HEAD, "%s.confidence_head" },
{ LLM_KV_LOG_SNR_CONDITIONING, "%s.log_snr_conditioning" },
{ LLM_KV_MIN_LOG_SNR, "%s.min_log_snr" },
{ LLM_KV_MAX_LOG_SNR, "%s.max_log_snr" },
Expand Down
1 change: 1 addition & 0 deletions src/llama-arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ enum llm_kv {
LLM_KV_CLASSIFIER_OUTPUT_LABELS,

LLM_KV_TARGET_LAYERS,
LLM_KV_CONFIDENCE_HEAD,
LLM_KV_LOG_SNR_CONDITIONING,
LLM_KV_MIN_LOG_SNR,
LLM_KV_MAX_LOG_SNR,
Expand Down
10 changes: 10 additions & 0 deletions src/models/dflash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,17 @@ void llama_model_dflash::load_arch_tensors(llama_model_loader &) {
//
// TODO: only Qwen3-style backbones are supported for now; other backbones (e.g. Gemma4)
// need their own conversion path and graph tweaks
// Reject a declared confidence head when its required Markov head is missing.
bool kv_confidence_head = false;
const bool has_kv_confidence_head = ml->get_key(LLM_KV_CONFIDENCE_HEAD, kv_confidence_head, false);

const struct ggml_tensor * markov_meta = ml->get_tensor_meta("markov_w1.weight");

if (has_kv_confidence_head && kv_confidence_head && !markov_meta) {
throw std::runtime_error("dflash: metadata declares a confidence head, but markov_w1.weight is missing. "
"The export is incomplete; it would load as plain DFlash and read drafts one row late");
}

if (markov_meta) {
const int64_t dspark_markov_rank = markov_meta->ne[0];

Expand Down