Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ce16fff
Add TML Inkling architecture
danielhanchen Jul 18, 2026
453c438
Merge remote-tracking branch 'origin/master' into pr-25731-head
danielhanchen Jul 23, 2026
e38da9a
Merge remote-tracking branch 'upstream/master' into add-inkling-fix
shimmyshimmer Jul 26, 2026
d8f8750
inkling : adapt to the renamed thinking_end_tags chat API
shimmyshimmer Jul 26, 2026
79ca732
Fix merge conflicts
danielhanchen Jul 29, 2026
8a67b19
Merge upstream master and fix conflicts
danielhanchen Jul 30, 2026
d69b7e6
Fix mmproj decoder width for Inkling Small
danielhanchen Jul 30, 2026
02142bb
Fix some GitHub Issues
danielhanchen Aug 2, 2026
1e6f9e4
Merge tag 'b10229' into add-inkling
danielhanchen Aug 3, 2026
68b15cf
Fix quantized V cache issue
danielhanchen Aug 6, 2026
3fd7901
Fix merge conflicts
danielhanchen Aug 6, 2026
e2404dd
Fix merge conflicts
danielhanchen Aug 10, 2026
0a9841f
Fix merge conflicts
danielhanchen Aug 10, 2026
368b24c
Fix merge conflicts
danielhanchen Aug 12, 2026
c44c9a1
Fix merge conflicts
danielhanchen Aug 17, 2026
b5baf81
Fix merge conflicts
danielhanchen Aug 26, 2026
4f2eb74
Fix merge conflicts
shimmyshimmer Aug 27, 2026
2e9d6fb
Merge remote-tracking branch 'up/master' into add-inkling
shimmyshimmer Aug 28, 2026
edee0e1
Fix merge conflicts
danielhanchen Aug 28, 2026
44eb88e
Merge remote-tracking branch 'origin/master' into add-inkling
danielhanchen Aug 31, 2026
49c0377
Fix merge conflicts
danielhanchen Sep 4, 2026
fe45c89
mtmd: mark the Inkling preprocessors const to match the base class
danielhanchen Sep 4, 2026
36df1bf
tests: give inkling its arch fixture so test-llama-archs stops skippi…
danielhanchen Sep 4, 2026
1066edc
Fix merge conflicts
danielhanchen Sep 7, 2026
d3a6700
Merge upstream master into add-inkling
danielhanchen Sep 9, 2026
946fc11
inkling: move to ggml_prec_set_acc, teach the backends about GGML_PRE…
danielhanchen Sep 9, 2026
3870aa4
Fix merge conflicts
danielhanchen Sep 22, 2026
3d5bf02
Merge master into add-inkling
danielhanchen Nov 13, 2026
eeac951
inkling : give the conv state, memory filter and rel-pos input their …
danielhanchen Nov 14, 2026
287b4ff
Fix merge conflicts
danielhanchen Nov 19, 2026
e2a5260
CUDA: use ggml_cuda_shfl in the banded FA kernel
danielhanchen Nov 19, 2026
b4c2aab
Fix merge conflicts
danielhanchen Nov 20, 2026
e65c374
Fix merge conflicts
danielhanchen Nov 20, 2026
02b68e6
inkling : banded attention for a quantized K cache
danielhanchen Nov 21, 2026
1da4c93
inkling : share the banded attention mask across layers
danielhanchen Nov 21, 2026
1ac4b1c
kv-cache : banded attention for a sequence stored at a cell offset
danielhanchen Nov 21, 2026
19360e5
Fix merge conflicts
danielhanchen Nov 22, 2026
5442dfa
Merge tag 'b12635' into inkling1-b12533-opcount
danielhanchen Nov 23, 2026
cf37396
ggml : count GGML_OP_FLASH_ATTN_EXT_BANDED on top of GGML_OP_SIGMOID_…
danielhanchen Nov 23, 2026
3764480
ggml : read the banded rel_logits split from src[6] in the meta backend
danielhanchen Nov 23, 2026
1c5c0b1
mtmd : do not require v.patch_embd.weight for the Inkling projector
danielhanchen Nov 23, 2026
7cbffd2
tests : fail test-flash-attn-bias on non-finite outputs
danielhanchen Nov 23, 2026
68df508
CUDA: do not delegate banded attention to MMA when flash attention is…
danielhanchen Nov 23, 2026
2c38e50
rpc : count GGML_OP_FLASH_ATTN_EXT_BANDED in the RPC op count
danielhanchen Nov 23, 2026
6e32059
Fix merge conflicts
danielhanchen Nov 24, 2026
05caeeb
ggml : return the banded attention precision from ggml_prec_get_acc
danielhanchen Nov 24, 2026
82e03c6
tests : register test-flash-attn-bias and test-flash-attn-generic-has…
danielhanchen Nov 24, 2026
d8e01c2
ggml-cuda : tag the banded MMA call with a negative m0 instead of max…
danielhanchen Nov 24, 2026
b8d2bf7
ggml-cuda : write 0 for a fully masked row in the FA MMA kernel
danielhanchen Nov 24, 2026
734e786
convert : reject stacked ModelOpt NVFP4 experts before the pure NVFP4…
danielhanchen Nov 24, 2026
429cfdc
inkling : reserve the dense attention of multi-sequence ubatches and …
danielhanchen Nov 24, 2026
18f8fe1
ggml-cuda : do not delegate banded attention over unaligned F16 K/V rows
danielhanchen Nov 24, 2026
e1b2a33
ggml-cuda : compile banded rel_logits paths out of non-banded FA head…
danielhanchen Nov 24, 2026
ba3ad42
Fix merge conflicts
danielhanchen Nov 24, 2026
eb8e7c6
Fix merge conflicts
danielhanchen Nov 26, 2026
d9d3315
Fix merge conflicts
danielhanchen Nov 26, 2026
57e6ec4
Fix merge conflicts
danielhanchen Nov 27, 2026
17826c8
ggml : accept the banded flash attention in the indexed-bias check, s…
danielhanchen Nov 27, 2026
7defeb2
Fix merge conflicts
danielhanchen Nov 28, 2026
13b53cf
Fix merge conflicts
danielhanchen Dec 1, 2026
eacd17d
inkling : keep the dense relative bias in F32 on the non-FA attention…
danielhanchen Dec 1, 2026
874f2ae
inkling : keep the 8-wide MoE router soft_max on the CUDA block kernel
danielhanchen Dec 1, 2026
9dd84c2
inkling : also keep the router soft_max off the short-row kernel on R…
danielhanchen Dec 2, 2026
4a8e8b9
inkling : keep the router soft_max on the Metal kernel it used before…
danielhanchen Dec 2, 2026
4f4442d
Fix merge conflicts
danielhanchen Dec 3, 2026
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: 2 additions & 0 deletions conversion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"HYV4ForCausalLM": "hy_v4",
"HYV4FlashForCausalLM": "hy_v4_flash",
"IQuestCoderForCausalLM": "llama",
"InklingForConditionalGeneration": "inkling",
"Inkling2ForCausalLM": "inkling2",
"Inkling2LoopForCausalLM": "inkling2",
"Inkling2ForConditionalGeneration": "inkling2",
Expand Down Expand Up @@ -401,6 +402,7 @@
"HYV4FlashForCausalLM": "hy_v4_flash",
"HYV4FlashForConditionalGeneration": "hy_v4_flash",
"Idefics3ForConditionalGeneration": "smolvlm",
"InklingForConditionalGeneration": "inkling",
"Inkling2ForConditionalGeneration": "inkling2",
"Inkling2LoopForConditionalGeneration": "inkling2",
"InternVisionModel": "internvl",
Expand Down
31 changes: 31 additions & 0 deletions conversion/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,19 @@
data_gen = lambda data=data_torch: LazyTorchTensor.from_eager(data) # noqa: E731
else:
data_gen = lambda data=data_torch: data # noqa: E731
# the index maps each tensor to one shard; a duplicate would silently overwrite it
if weight_map and name in weight_map and weight_map[name] != part_name:
raise ValueError(
f"tensor '{name}' found in '{part_name}' but the index assigns "
f"it to '{weight_map[name]}'; refusing to load a wrong-shard copy")
titem = self.filter_tensors((name, data_gen))
self._source_tensor_names[name] = titem[0] if titem else None
if titem:
tname, tgen = titem
if tname in tensors:
raise ValueError(
f"duplicate tensor '{tname}' found in multiple model parts; "
f"refusing to silently overwrite")
tensors[tname] = tgen

# verify tensor name presence and identify potentially missing files
Expand Down Expand Up @@ -375,6 +384,20 @@
self.gguf_writer.add_tensor(new_name, scale.flatten().numpy())

def dequant_model(self):
# stacked-expert NVFP4 (w13_weight/w2_weight) is silently skipped by the NVFP4 repack and the dequant below
quant_config = self.hparams.get("quantization_config")
if isinstance(quant_config, dict) and quant_config.get("quant_method") in ("modelopt", "modelopt_mixed"):
stacked_expert_aux = [
n for n in self.model_tensors
if n.endswith((".scale2", ".input_amax", ".original_shape"))
]
if stacked_expert_aux:
raise NotImplementedError(
"This checkpoint stores quantized experts in the stacked ModelOpt NVFP4 layout "
f"({len(stacked_expert_aux)} auxiliary tensors like {stacked_expert_aux[0]!r}), "
"which is not supported yet. Convert from the unquantized (BF16) checkpoint instead."
)

# If all quantized tensors were already handled (e.g. pure NVFP4), skip
if self._is_nvfp4 and not any(k.endswith((".weight_scale", ".weight_scale_inv", ".input_scale", ".activation_scale", "_activation_scale", ".k_scale", ".v_scale")) for k in self.model_tensors):
return
Expand Down Expand Up @@ -1803,6 +1826,14 @@
self.prepare_tensors()
if (self.ple_only or self.no_ple) and not self._has_ple:
raise ValueError("model has no per-layer embedding table to export separately")
# zero tensors means the shards were never discovered, yet a metadata-only GGUF logs success
n_written = sum(len(shard) for shard in self.gguf_writer.tensors)
if n_written == 0:
raise ValueError(
"no tensors were written: the model shards could not be found. "
"Check that the safetensors filenames are discoverable (they must "
"start with 'model') or that model.safetensors exists."
)
self.prepare_metadata(vocab_only=False)
self.gguf_writer.write_header_to_file(path=self.fname_out)
self.gguf_writer.write_kv_data_to_file()
Expand Down Expand Up @@ -2194,7 +2225,7 @@
# To avoid unexpected issues - we make sure to normalize non-normalized tokens
if not added_tokens_decoder[i].normalized:
previous_token = token
token = tokenizer.decode(tokenizer.encode(token, add_special_tokens=False)) # ty: ignore[invalid-assignment]

Check warning on line 2228 in conversion/base.py

View workflow job for this annotation

GitHub Actions / python type-check

ty (unused-ignore-comment)

conversion/base.py:2228:102: unused-ignore-comment: Unused `ty: ignore` directive help: Remove the unused suppression comment

Check warning on line 2228 in conversion/base.py

View workflow job for this annotation

GitHub Actions / python type-check

ty (unused-ignore-comment)

conversion/base.py:2228:102: unused-ignore-comment: Unused `ty: ignore` directive help: Remove the unused suppression comment
if previous_token != token:
logger.info(f"{repr(previous_token)} is encoded and decoded back to {repr(token)} using AutoTokenizer")

Expand Down Expand Up @@ -3056,7 +3087,7 @@
# To avoid unexpected issues - we make sure to normalize non-normalized tokens
if not added_tokens_decoder[i].normalized:
previous_token = token
token = tokenizer.decode(tokenizer.encode(token, add_special_tokens=False)) # ty: ignore[invalid-assignment]

Check warning on line 3090 in conversion/base.py

View workflow job for this annotation

GitHub Actions / python type-check

ty (unused-ignore-comment)

conversion/base.py:3090:102: unused-ignore-comment: Unused `ty: ignore` directive help: Remove the unused suppression comment

Check warning on line 3090 in conversion/base.py

View workflow job for this annotation

GitHub Actions / python type-check

ty (unused-ignore-comment)

conversion/base.py:3090:102: unused-ignore-comment: Unused `ty: ignore` directive help: Remove the unused suppression comment
if previous_token != token:
logger.info(f"{repr(previous_token)} is encoded and decoded back to {repr(token)} using AutoTokenizer")

Expand Down
Loading
Loading