Skip to content
Computer vision

Qwen3.8-27B QSA

разреженное внимание поверх 27B мультимодальной модели

2 min read

Исследовательская BF16-версия Qwen3.8-27B от higa2515: к 16 слоям full-attention добавлены обученные индексоры Qwen Sparse Attention (QSA), а остальные 48 слоёв декодера сохранили исходную архитектуру Gated DeltaNet. Backbone, vision encoder, projector и MTP-веса оставлены без изменений — оригинальные шарды побайтово совпадают с апстримом.

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

  • QSA использует сжатый обученный индексор, который выбирает контекст блоками по 4 токена: фиксированный K=2 048 плюс текущий блок.
  • Добавлено 52 434 944 FP32-параметра индексоров; индексоры обучены 300 шагов при длине 16 384 с 50% мультимодальной смеси.
  • Все исходные KV-записи сохраняются — это не сжатие KV-cache, а 12,5% описывают K на 16k, а не постоянное соотношение.
  • Два пути исполнения: Transformers-обёртка как референс корректности и GGUF + форк llama.cpp с нативной поддержкой текста, изображений и видео, M-RoPE и MTP.
  • Stock llama.cpp файлы QSA не поддерживает — нужен отдельный движок и runtime guide.
  • Скрипт restore_original.py собирает обратно исходный dense-снапшот с проверкой LFS-хэшей.

Пример

from transformers import AutoModelForImageTextToText, AutoProcessor

path = "higa2515/Qwen3.8-27B-QSA-BF16"
processor = AutoProcessor.from_pretrained(path, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
    path, trust_remote_code=True, dtype="auto", device_map="auto",
    attn_implementation="sdpa",
)
ПодробнееText PPL на 32 766 токенах: 7,071384 у QSA против 7,072960 у dense (отношение 0,99978).
Сконструированный DocVQA-пробник на 50 вопросов: 50/50 у обеих версий.
На 261 120 входных токенах QSA быстрее в 2,921x по cold prefill и в 1,793x по decode (GGUF Q8_0, FP16 KV, MTP draft2, две sm70 32GB).
Мультимодальное качество на 128k/262k не проверено; пробы прошли лишь до 64k.
Примеры
Discuss Telegram 7 5

Will it run?

Working out the memory needs

The bot is still collecting this model's weight sizes; the estimate will appear here in a few minutes. Meanwhile you can rent a GPU with headroom.

Massed ComputeOpen Massed Compute

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.

    # higa2515/Qwen3.8-27B-QSA-BF16
    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 higa2515/Qwen3.8-27B-QSA-BF16 --local-dir ~/models/Qwen3.8-27B-QSA-BF16
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to Qwen3.8-27B-QSA-BF16
  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

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

No known relatives of this model yet. All derivatives on Hugging Face

About the model

higa2515/Qwen3.8-27B-QSA-BF16
Author
higa2515
Category
Computer vision
Released
Posted

On NeyroLearn

Hugging Face

57

Ask AI about this model

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

Comments