inference/research
verifiedhigh · 0.95updated 2026-10-04

SmolLM2-1.7B-Instruct

dense 1.711B

Fields

id
models/smollm2-1-7b-instruct
Family
smollm2
Vendor
Hugging Face
Release year
2024
Architecture
dense
Params (B)
1.711
Active params (B)
1.711
Hidden size
2,048
Layers
24
KV heads
32
Head dim
64
GQA ratio
1
Max context
8,192
Context scaling method
native
Activation
silu
Attention variant
MHA (Llama architecture)
KV cache (bytes/token)
196,608
FLOPs per active token
3,420,000,000
Open weights
yes
License
Apache-2.0
notes
CONTEXT SCALING: null is a VERIFIED value, checked against config rather than left blank. config.json declares rope_scaling null, rope_theta 130000, max_position_embeddings 8192. Included mainly to show the regression SmolLM3 fixed: SmolLM2 is model_type 'llama' with plain MHA (32 query = 32 KV heads) and head_dim only 64. head_dim derived = 2048 / 32 = 64. kv_cache_bytes_per_token = 24 * 32 * 64 * 2 * 2 = 196608 bytes/token at bf16. Read that next to SmolLM3-3B's 73728 bytes/token: SmolLM3 is 1.8x the parameters but uses 2.7x LESS KV per token, because halving head_dim (128 -> 64) while moving to 4 KV heads cuts per-layer KV by 4x. At 8k context SmolLM2-1.7B holds 1.5 GiB of KV — a large fraction of its own 1.7B weights at bf16, and the single biggest reason 8k-context serving of this model is memory-bound rather than compute-bound. tie_word_embeddings true, vocab 49152, intermediate 8192, rope_theta 130000. Official GGUF (HuggingFaceTB/SmolLM2-1.7B-Instruct-GGUF) and ONNX ports exist; Apache-2.0. SERVICEABILITY JOIN (added 2026-10-03; the architecture x engine matrix this record was missing, with a citation per cell in docs/13-model-compatibility.md): FAMILY=dense-mha. REQUIRED KERNEL CLASS: ordinary causal attention plus GEMM/GEMV. This is the baseline every engine in this repo implements, so the join here is a floor rather than a filter: no engine record in data/engines/ states that dense GQA is unsupported. SUPPORTED BY (cited): vLLM LlamaForCausalLM / Qwen2 / Qwen3 / Mistral / Phi3ForCausalLM rows [[mdl2-vllm-supported-models-2026-10]]; TensorRT-LLM LlamaForCausalLM, Qwen2ForCausalLM, Qwen3ForCausalLM, Phi3ForCausalLM rows [[mdl2-trtllm-supported-models]]; SGLang generative table (Llama, Qwen, Mistral families) [[mdl2-sglang-generative-models]]; llama.cpp LLM_ARCH_LLAMA [[pap-arch-llamacpp-arch-registry]]. HARD CONSTRAINTS THAT DO APPLY even to dense GQA, and they are model-shape rather than architecture-class: tensor-parallel size must divide the attention head count or the engine refuses to start [[mgpu-tp-size-must-divide-attention-heads]] (affects vllm and sglang); and a GQA KV cache is the thing paged-attention machinery exists for, so an engine with no paged KV (llama.cpp's slot-based pool [[llama-cpp]], exllamav2 [[exllamav2]]) loses the concurrency lever rather than the ability to run. ONE HARDWARE-DEPENDENT KERNEL GATE THAT IS NOT ABOUT GQA: on RDNA, vLLM's custom paged-attention kernel is gated on head_size == 128 AND block_size == 16, so a dense GQA model with head_dim 256 falls to the Triton 2D fallback and decode falls off a cliff - measured 12.1 tok/s at 518 tokens of context to 4.2 tok/s at 32k, with kernel_paged_attention_2d growing 28.3x [[rdna-triton-paged-attn-decode-cliff]]. Check head_dim before blaming the card. MHA SPECIFIC: gqa_ratio is 1.0, so the KV cache is num_layers x num_kv_heads x head_dim x 2 x 2 with num_kv_heads == num_attention_heads. There is no engine-side special case: MHA is the shape every paged-attention kernel was written for, so the join is strictly easier than for GQA and the only cost is the KV bytes themselves. Tensor parallelism is unchanged - the constraint is on the QUERY head count, so MHA with many heads is the most permissive case for head divisibility [[mgpu-tp-size-must-divide-attention-heads]].

Notes

CONTEXT SCALING: null is a VERIFIED value, checked against config rather than left blank. config.json declares rope_scaling null, rope_theta 130000, max_position_embeddings 8192. Included mainly to show the regression SmolLM3 fixed: SmolLM2 is model_type 'llama' with plain MHA (32 query = 32 KV heads) and head_dim only 64. head_dim derived = 2048 / 32 = 64. kv_cache_bytes_per_token = 24 * 32 * 64 * 2 * 2 = 196608 bytes/token at bf16. Read that next to SmolLM3-3B's 73728 bytes/token: SmolLM3 is 1.8x the parameters but uses 2.7x LESS KV per token, because halving head_dim (128 -> 64) while moving to 4 KV heads cuts per-layer KV by 4x. At 8k context SmolLM2-1.7B holds 1.5 GiB of KV — a large fraction of its own 1.7B weights at bf16, and the single biggest reason 8k-context serving of this model is memory-bound rather than compute-bound. tie_word_embeddings true, vocab 49152, intermediate 8192, rope_theta 130000. Official GGUF (HuggingFaceTB/SmolLM2-1.7B-Instruct-GGUF) and ONNX ports exist; Apache-2.0.

SERVICEABILITY JOIN (added 2026-10-03; the architecture x engine matrix this record was missing, with a citation per cell in docs/13-model-compatibility.md): FAMILY=dense-mha. REQUIRED KERNEL CLASS: ordinary causal attention plus GEMM/GEMV. This is the baseline every engine in this repo implements, so the join here is a floor rather than a filter: no engine record in data/engines/ states that dense GQA is unsupported. SUPPORTED BY (cited): vLLM LlamaForCausalLM / Qwen2 / Qwen3 / Mistral / Phi3ForCausalLM rows [[mdl2-vllm-supported-models-2026-10]]; TensorRT-LLM LlamaForCausalLM, Qwen2ForCausalLM, Qwen3ForCausalLM, Phi3ForCausalLM rows [[mdl2-trtllm-supported-models]]; SGLang generative table (Llama, Qwen, Mistral families) [[mdl2-sglang-generative-models]]; llama.cpp LLM_ARCH_LLAMA [[pap-arch-llamacpp-arch-registry]]. HARD CONSTRAINTS THAT DO APPLY even to dense GQA, and they are model-shape rather than architecture-class: tensor-parallel size must divide the attention head count or the engine refuses to start [[mgpu-tp-size-must-divide-attention-heads]] (affects vllm and sglang); and a GQA KV cache is the thing paged-attention machinery exists for, so an engine with no paged KV (llama.cpp's slot-based pool [[llama-cpp]], exllamav2 [[exllamav2]]) loses the concurrency lever rather than the ability to run. ONE HARDWARE-DEPENDENT KERNEL GATE THAT IS NOT ABOUT GQA: on RDNA, vLLM's custom paged-attention kernel is gated on head_size == 128 AND block_size == 16, so a dense GQA model with head_dim 256 falls to the Triton 2D fallback and decode falls off a cliff - measured 12.1 tok/s at 518 tokens of context to 4.2 tok/s at 32k, with kernel_paged_attention_2d growing 28.3x [[rdna-triton-paged-attn-decode-cliff]]. Check head_dim before blaming the card. MHA SPECIFIC: gqa_ratio is 1.0, so the KV cache is num_layers x num_kv_heads x head_dim x 2 x 2 with num_kv_heads == num_attention_heads. There is no engine-side special case: MHA is the shape every paged-attention kernel was written for, so the join is strictly easier than for GQA and the only cost is the KV bytes themselves. Tensor parallelism is unchanged - the constraint is on the QUERY head count, so MHA with many heads is the most permissive case for head divisibility [[mgpu-tp-size-must-divide-attention-heads]].

Cross-references

This record references no other records — it is a leaf. It is cited by 0.