Skip to content

spark-model: remove shared prefill stalls and redundant copies - #448

Open
maplepaladin73 wants to merge 3 commits into
Atlas-Inf:mainfrom
maplepaladin73:devin/1796337176-prefill-quick-wins
Open

maplepaladin73 wants to merge 3 commits into
Atlas-Inf:mainfrom
maplepaladin73:devin/1796337176-prefill-quick-wins

Conversation

@maplepaladin73

Copy link
Copy Markdown
Contributor

Summary

Cache hot-path prefill environment flags, remove diagnostic prefill stream synchronizations, avoid redundant prefill copies where projection kernels already write their destinations, and warn when the inert qwen4exp W4A4 prefill flag is set.

Closes #

Test plan

  • cargo fmt --all -- --check
  • ATLAS_SKIP_BUILD=1 CUDARC_CUDA_VERSION=13000 cargo clippy --workspace --tests
  • bash scripts/check-license-headers.sh
  • Tested against a real model / hardware if the change affects runtime behaviour
  • Added or updated tests where applicable

Notes for reviewers

This is a performance-sensitive runtime path. Host-side validation passes, but it still needs GPU A/B validation before merge. The local test binary cannot link on a CUDA-less host because the CUDA stub lacks cuCtxGetStreamPriorityRange and cuStreamCreateWithPriority.

CLA

maplepaladin73 and others added 3 commits December 3, 2026 22:44
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>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@AzeezIsh

AzeezIsh commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

AMD A/B (DevLab strix-hip gfx1151, this PR merged onto main 585c8fa, Qwen3.8-27B-NVFP4, C=1, 64K, thinking off; control = main on the same day):

  • output: greedy hashes byte-identical to main for MTP and DFlash2 (8/8 prompts each)
  • MTP decode 22.4 (prose 18.9, code 25.9), prefill 450/458/428 vs main 22.3 (18.7/25.9), 452/460/429
  • DFlash2 decode 23.9 (18.7/29.2), prefill 446/454/424 vs main 23.6 (18.0/29.1), 445/451/423

Neutral on AMD and safe there. Prefill 2K/8K/16K exercises multi-chunk prefill, but only the short greedy prompts are hashed. Still needs the GB10 A/B the PR description asks for before merge.

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.

2 participants