|
| 1 | +# Inkling |
| 2 | + |
| 3 | +The Inkling bridge converts the text backbone of the unquantized |
| 4 | +[`thinkingmachines/Inkling-Small`](https://huggingface.co/thinkingmachines/Inkling-Small) |
| 5 | +checkpoint (276B total / 12B active parameters). It uses native Megatron tensor |
| 6 | +and expert parallel projections, Transformer Engine normalization and grouped |
| 7 | +experts, and PyTorch FlexAttention for the learned relative-position bias. |
| 8 | + |
| 9 | +```python |
| 10 | +from megatron.bridge import AutoBridge |
| 11 | + |
| 12 | +bridge = AutoBridge.from_hf_pretrained("/shared/models/Inkling-Small") |
| 13 | +provider = bridge.to_megatron_provider() |
| 14 | +provider.expert_model_parallel_size = 8 |
| 15 | +provider.expert_tensor_parallel_size = 1 |
| 16 | +provider.finalize() |
| 17 | +model = provider.provide_distributed_model(wrap_with_ddp=False) |
| 18 | +``` |
| 19 | + |
| 20 | +Download a fixed checkpoint revision to the shared path before launching all |
| 21 | +ranks. Conversion reads the published `model.llm.*` safetensors layout directly. |
| 22 | +Transformers' materialized model uses different names and is not a conversion |
| 23 | +source. Dense, routed, and shared `w13` weights contain interleaved gate/up rows. |
| 24 | +Full checkpoint export preserves the source audio, vision, and auxiliary MTP |
| 25 | +tensors unchanged; these components are not trained. |
| 26 | + |
| 27 | +For attention-only LoRA, target `linear_qkv`, `linear_r`, and `linear_proj`. |
| 28 | +Native adapter export produces Inkling's published `wq_du`, `wk_dv`, `wv_dv`, |
| 29 | +`wr_du`, and `wo_ud` names. No downstream adapter-name translation is required. |
| 30 | + |
| 31 | +Supported execution is unpacked text training and full-sequence scoring with |
| 32 | +zero dropout and context parallel size 1. Packed sequences, cached generation, |
| 33 | +CUDA graphs, quantized checkpoint import, and multimodal/MTP training are not |
| 34 | +implemented. FlexAttention backward through the relative bias is tested on |
| 35 | +PyTorch 2.13; older releases are not qualified. Use a serving engine for cached |
| 36 | +generation. |
| 37 | + |
| 38 | +The two-layer FP32 functional suite passes at TP1/EP1, TP2/EP1, and TP1/EP2 |
| 39 | +on H200 with full-layer recomputation. It checks all 42 checkpoint tensors, |
| 40 | +forward/backward parity against Transformers, nonzero LoRA export (20 tensors), |
| 41 | +merged export, and native base/adapter checkpoint restore. Operator tests also |
| 42 | +compare relative-attention and convolution gradients against Transformers. |
| 43 | +FP32 internal router/convolution weights retain the imported BF16 values but |
| 44 | +export in FP32 unless an export dtype is requested. |
| 45 | + |
| 46 | +Full Inkling-Small training, serving parity, and capacity qualification remain |
| 47 | +pending; the tiny-model checks do not qualify the 276B checkpoint. |
0 commit comments