Skip to content
Other

Qwen3-8B-5layer-Dense-FFN49152

5-слойная draft-модель для ускорения Qwen3-8B

2 min readupdated

Эта модель представляет собой компактный 5-слойный черновик (draft-модель) для спекулятивного декодирования (метод ускорения генерации, когда маленькая модель быстро накидывает токены, а основная их проверяет) на базе Qwen3-8B. Она создана автором yushengsu как плотный (dense) аналог версии на базе MoE (Mixture-of-Experts — архитектуры с маршрутизацией по экспертам) Qwen3-8B-5layer-MoE-8E4A-v1: вместо 8 экспертов с активацией 4 здесь используется один плотный блок SwiGLU FFN шириной 49152. За счёт этого модель сохраняет ту же вычислительную нагрузку на токен (FLOPs), но требует вдвое меньше параметров в FFN-слоях — около 3.3 B всего против 6.4 B у MoE-версии. Пригодится разработчикам, запускающим Qwen3-8B в SGLang и ищущим баланс между скоростью черновика и расходом памяти.

Ключевые особенности

  • Архитектура: 5 слоёв с механизмом внимания GQA (32 головы, 8 KV-голов по 128), привязанных к слоям 1, 9, 17, 25 и 33 базовой модели, с rank 256 для markov head.
  • Плотный FFN вместо MoE: промежуточная размерность SwiGLU FFN равна 49152 (4 × 12288), что даёт 0.60 B параметров на слой вместо 1.21 B у 8E4A при идентичных активных FLOPs.
  • Рецепт обучения DSpark: обучена на датасете PerfectBlend, перегенерированном через Qwen3-8B (температура 0, режим non-thinking), с контекстом 8192 токена и шаблоном qwen3-instruct.
  • Чекпоинты по эпохам: в репозитории выгружаются сохранения по эпохам от 1ep/ до 5ep/ в формате Hugging Face для запуска через Qwen3DSparkModel.

Что можно сделать

  • Ускорить инференс Qwen3-8B: подключить модель как DSpark draft в движке SGLang через класс Qwen3DSparkModel для снижения задержки генерации.
  • Сравнить dense и MoE черновики: протестировать FFN49152 против Qwen3-8B-5layer-MoE-8E4A-v1 и более узкой FFN24576 на своих задачах, оценив скорость принятия токенов и потребление VRAM.

Пример

Сценарий использования из карточки: модель предназначена для работы в связке с базовой Qwen/Qwen3-8B в среде SGLang в качестве плотного DSpark-черновика (класс Qwen3DSparkModel) с длиной контекста до 8192 токенов и шаблоном qwen3-instruct. Выбирать нужную стадию обучения можно через директории чекпоинтов от 1ep/ до 5ep/.

ПодробнееОбъём параметров: ~3.3 B всего (0.60 B на слой в FFN вместо 1.21 B у 8E4A).
Обучение: 5 эпох (53 822 шага, глобальный батч 132), cosine lr от 6e-4 с warmup 4 %, DSpark CE 0.1 / L1 0.9, 512 якорей, decay gamma 7, seed 42.
Железо и код: два сервера по 4× GB300 в одном домене NVLink, код из ветки exp/qwen3-8b-5layer-dense49152-dspark (SpecForge) с use_liger_kernel: true.
Discuss Telegram 0

Will it run?

Runs in BF16

Fits without quantisation.

  • BF16weights 6.3 GB · ready files7.4 GB
  • FP8 / INT8recommendedweights 3.2 GB4.0 GB
  • 4-bitweights 1.8 GB2.5 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · BF16 — from RTX 5060 Ti 8GB

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # yushengsu/Qwen3-8B-5layer-Dense-FFN49152
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download yushengsu/Qwen3-8B-5layer-Dense-FFN49152 --local-dir ~/models/Qwen3-8B-5layer-Dense-FFN49152
    # The model is in ~/models. How to run it is in the model card (link above).
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

  1. Qwen3-8B-Basefamily root
  2. Qwen3-8B
  3. Qwen3-8B-5layer-Dense-FFN49152

New posts about versions of Qwen3-8B-Base (quants, finetunes, LoRAs) will show up under the bell.

Quantised versions 12All on Hugging Face
Fine-tunes 12All on Hugging Face
LoRAs and adapters 4All on Hugging Face

About the model

yushengsu/Qwen3-8B-5layer-Dense-FFN49152
Author
yushengsu
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments