Skip to content

qwen4exp: reduce prefill QSA score workspace - #17

Merged
novkien merged 1 commit into
masterfrom
codex/flash9-qsa-memory
Oct 3, 2026
Merged

novkien merged 1 commit into
masterfrom
codex/flash9-qsa-memory

Conversation

@novkien

@novkien novkien commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Addresses #9

Four-head QSA prefill currently keeps the combined head-score product alive across a reshape and ReLU. Build and accumulate one rectified head at a time to reduce the pool-by-token workspace. Keep the original graph for other head counts, queries of eight tokens or fewer, and small reservations. The PP guard leaves enough QSA workspace for the unchanged small-query path.

Add an H4 architecture fixture while retaining H64, a two-sequence eight-token verify/MTP case, and an H4 generated model for the maintained state tests. Public APIs, GGUF data and KV formats are unchanged.

Validation:

  • Focused CPU architecture tests: 5 passed. H4 and H64 generated models pass the maintained save/load-state and recurrent rollback/split-replay tests.
  • Native V100 architecture/reference checks passed, including H4 prefill. A separate score/top-k graph comparison passed on CPU, V100 and the RPC GPU, with bounded floating-point differences at tied CPU cutoffs rather than a claim of universal bitwise equality.
  • Five alternating paired groups through proxy 8082, three frozen cold 8192+512 families, same c=65536, ub=1024/placement and immutable host/RPC identities: paired PP estimates range from 0.9951 to 1.0017 and TG from 0.9935 to 1.0053; every PP/TG 95% interval has a lower bound above 0.977. This is a memory change with neutral measured throughput, not a speedup claim. Proxy queue jitter makes TTFT/wall intervals wide; no latency improvement is claimed.
  • At c=200704, ub=1024, target CUDA0 compute reservation fell from a failing 6573.38 MiB to 4267.63 MiB. All 49 target and 50 draft layers loaded on GPU, two slots and four pipeline copies stayed enabled, and three cold 8192+512 requests passed. Maximum-context and near-full combined acceptance remain tracked in Research: port V100/SM70 kernel and runtime optimizations into llama.cpp-fork #9.
  • Independent source review and git diff --check passed.

Codex implemented and reviewed this change under the owner's approved Flash Next plan.

@novkien

novkien commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

Work report - QSA memory candidate handed off for review

Owner and scope: Codex subagent /root/flash_remaining completed delivery only for the root-reviewed QSA workspace candidate. PR #17 is based on master at 668bee9252d266f45a7b58a2034ad5bc23154638, with reviewed head dc133b6c39a1e2612371e66e15b8b6bf12dc4eb2. Root retains final review and acceptance ownership.

Why: This candidate reduces peak live workspace for four-head QSA prefill and keeps the original graph for unqualified head counts, short queries and small reservations. The reviewed result is a capacity improvement with neutral measured throughput, not a speedup claim.

Done and evidence: The commit changes only src/models/qwen4exp.cpp and tests/test-llama-archs.cpp; both source SHA-256 values match the values root reviewed. The branch was fast-forwarded to the verified current master without changes to either candidate file, staged only those two paths, and passed git diff --cached --check. Root and the independent reviewer reported no blockers. The reviewed evidence includes CPU5 architecture tests, H4/H64 save/load and recurrent rollback/replay, native V100 H4/reference checks, five paired three-family proxy measurements within unchanged-throughput gates, and c200704/ub1024 GPU capacity screens. The PR body is the exact root-approved file; the GitHub read-back adds only a final blank line. The issue backlink is present in the timeline.

Checks: At handoff, editorconfig, labeler and model-naming pass. Platform build checks remain pending; there are no reported failing checks.

Remaining: Root review of this exact head and the repository's remaining PR checks. Issue #9 still tracks the broader context, near-full-pool and combined-runtime acceptance criteria. No merge was performed in this delivery step.

Next: Root reviews PR #17 at dc133b6c39a1e2612371e66e15b8b6bf12dc4eb2 and continues the issue's remaining acceptance work.

@novkien
novkien merged commit a600276 into master Oct 3, 2026
9 of 18 checks passed
@novkien

novkien commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

Work report - QSA candidate merged; runtime acceptance remains with root

Owner and scope: The root-authorized delivery step merged PR #17 at reviewed head dc133b6c39a1e2612371e66e15b8b6bf12dc4eb2. The squash merge is a60027610cffb451909b2ae3e2130f1a19b44d4e on master. The source branch remains published at the reviewed head. Root retains rebuild, deployment and issue acceptance ownership.

Done and evidence: Before merge, issue #9 was OPEN, PR #17 was OPEN/MERGEABLE on the exact reviewed head, the PR contained only the two approved paths, and the merged contents' source hashes matched the reviewed values. The merge used the repository's squash strategy with --match-head-commit; no force operation or branch deletion was used. Read-back confirms PR #17 is MERGED at the SHA above and issue #9 remains OPEN. The issue backlink and work reports are present.

Checks: Root and the independent reviewer found no source blockers. The reported CPU/native/reference/state and proxy-campaign evidence is in the approved PR body and preceding issue reports; this delivery step did not rerun those hardware tests. GitHub's optional Windows test jobs completed with failures after successful builds: test_completion_unified[256-4-n_predict_vals3-expected_success3] returned Failed to restore prompt cache state after failing to restore 92 KV cells, and the Windows x64 OpenBLAS CTest run reported test-thread-safety exit 0xc0000374. Both tests are outside the changed files; no baseline rerun was performed here. The branch is unprotected and those CI jobs were not an enforced merge gate under the owner contract.

Remaining: A build from exact merged source a60027610cffb451909b2ae3e2130f1a19b44d4e, matched native/RPC artifacts, deployment, and active behavior acceptance remain pending under root. The accepted c >= 200000, pipeline-on/full-GPU-offload configuration, near-full-pool generation, and combined-runtime paired campaign are not established by this merge. Issue #9 remains open.

Next: Root rebuilds and deploys the merged revision through the approved lifecycle, runs the outstanding maximum-context/near-full and combined acceptance checks, and updates issue #9 with their results. No runtime action was taken in this delivery step.

@novkien

novkien commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

Work report - CI failure provenance follow-up

Owner and scope: This follow-up records the two optional Windows CI failures observed after PR #17 merged; it does not change the merged candidate or claim either failure is pre-existing.

Windows server test: Job log identifies tools/server/tests/unit/test_completion.py::test_completion_unified[256-4-n_predict_vals3-expected_success3]. It launched ggml-org/test-model-stories260K from stories260K-f32.gguf, and CI metadata shows general.architecture=llama. With n_ctx=256, four unified slots and requested predictions [90, 90, 40, 75], one request returned HTTP 500 Failed to restore prompt cache state; the server log says it could not find 92 available KV cells. The Windows build step passed.

Windows x64 OpenBLAS test: Job log identifies CTest test-thread-safety, using tinyllamas/stories15M-q4_0.gguf, -ngl 99, -c 256, -ub 32, -np 4, -t 2. The test printed All threads finished without errors, then the process exited 0xc0000374. The log does not expose the GGUF general.architecture; its fixture is not Qwen4Exp. The Windows OpenBLAS build step passed.

Scope and limits: The merged change's selector is in Qwen4Exp and is enabled only for four-head QSA prefill. The two failing runs use TinyStories/Llama fixtures and do not exercise that selector. No baseline run was performed, so these failures are not labeled pre-existing. No broad rerun was done. The repository branch was unprotected and these platform checks were not required merge gates; root retains any follow-up triage.

Remaining: Root continues merged-revision rebuild/deployment and the issue's maximum-context, near-full-pool and combined-runtime acceptance. Issue #9 remains open.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants