Skip to content

spark-model: optimize dense prefill attention and quantization - #452

Open
maplepaladin73 wants to merge 4 commits into
Atlas-Inf:mainfrom
maplepaladin73:devin/1796352000-dense-prefill
Open

maplepaladin73 wants to merge 4 commits into
Atlas-Inf:mainfrom
maplepaladin73:devin/1796352000-dense-prefill

Conversation

@maplepaladin73

@maplepaladin73 maplepaladin73 commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Wire the rows128 BF16 paged-prefill attention kernel into single-stream attention behind ATLAS_ATTN_ROWS128=1, cache its tensor maps, and share low-precision Q/K/V activation quantization when the producer/consumer chain proves the same input is reused. Also prototype checkpoint-calibrated static input scales for dense W4A4 MLP prefill behind ATLAS_DENSE_PREFILL_STATIC_INPUT_SCALE=1.

Test plan

  • cargo fmt --all -- --check
  • ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests
  • bash scripts/check-license-headers.sh
  • nvcc -std=c++17 -O3 --ptx -arch=sm_121a kernels/gb10/qwen3.6-27b/nvfp4/dense_bf16mma_prefill.cu
  • Tested against a real model / hardware if the change affects runtime behaviour

Notes for reviewers

Activation reuse is limited to the proven Q/K/V chain; row-invariant early-return arms are excluded. Static scales apply only to dense MLP gate/up and down groups and fall back to dynamic quantization when checkpoint scales are missing or invalid. Hardware quality and TTFT gating are still required before merge.

CLA

  • I have read and agree to the Contributor License Agreement.

maplepaladin73 and others added 2 commits December 3, 2026 23:58
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
maplepaladin73 and others added 2 commits December 4, 2026 02:47
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant