# Qwen2

Dense Qwen2 semantic lowering and its present execution boundary.

[View canonical HTML](https://pllm.run/sdk/build/models/qwen2/)

Document ID: `pllm.docs.models.qwen2`  
Release: `0.1.0`

`pllm.qwen2.v1` lowers bounded prefill and decode graphs for dense `qwen2` configurations. It records grouped-query attention, rotary positions, QKV bias, bias-free output and MLP projections, gated SiLU, KV-cache transitions, last-token output-head evaluation, greedy selection, and feedback.

This adapter is structurally validated rather than bound to one repository revision. Checkpoint loading and complete compiler coverage remain separate. Qwen2.5-0.5B-Instruct is the current runtime and loopback benchmark target, not evidence that every Qwen2 semantic plan is executable.

## Python SDK example

```python
from pllm import lower_model

config = {
    "model_type": "qwen2",
    "hidden_size": 896,
    "intermediate_size": 4864,
    "num_hidden_layers": 1,
    "num_attention_heads": 14,
    "num_key_value_heads": 2,
    "vocab_size": 151936,
    "max_position_embeddings": 32768,
    "hidden_act": "silu",
    "rms_norm_eps": 1e-6,
    "rope_theta": 1000000.0,
    "tie_word_embeddings": True,
}
plan = lower_model(config, batch=1, max_input_tokens=16, max_new_tokens=4)
operations = {operation["id"]: operation for operation in plan.prefill["operations"]}
assert operations["layer.0.k_linear"]["output_shape"] == (1, 16, 128)
assert operations["layer.0.silu"]["operator"] == "silu"
```

API: [Python SDK objects and signatures](/sdk/reference/python/pllm/#objects-and-signatures)

This self-contained configuration exercises the structural Qwen2 contract without
requiring a source-checkout fixture. It creates a semantic plan only.
