Repository navigation
feat(xla): add sparse DeepStack prefill - #893
Conversation
|
Addressed the acceptance-coverage gap in
No CSV files were added or changed. |
|
Addressed the selected-capacity validation ordering gap in
Validation:
|
12bf0b6 to
09f1aba
Compare
|
Rebased PR #893 onto
Validation:
Issue #867's six acceptance criteria were checked against this evidence. The branch was updated with |
Add a distinct embeddings-prefill entry that injects compact per-layer multimodal residuals immediately after configured language layers. Validate payload shape, positions, target layers, and static bounds in Rust and the C ABI. Wire optional compilation, single and ragged execution, cancellation ownership, and a real IREE local-task fixture. Refs #867
Expose post-hook residuals from a diagnostic-only graph that reuses the production prefill layer loop. Port the fixed MLX Qwen3-VL DeepStack fixture and compare every first, middle, and last residual row, final logits, and all K/V elements in real IREE local-task execution. Refs #867
Separate context-independent DeepStack schema checks from the static visual-bound check so parsing does not assume the historical 256-token default. Apply the bound only after RuntimeConfig selects the actual context capacity, with 512/300 acceptance and selected-capacity rejection coverage. Refs #867
Rebasing DeepStack prefill over the multimodal RoPE runtime exposed that its prepared batch variant was not carrying the signed decode delta into a slot, which would make later ragged decode coordinates diverge from the prepared prompt. Forward the embedded prepared-position delta for DeepStack requests and exercise that variant in the mixed text/M-RoPE cancellation and slot-reuse regression. Box both internal runtime config variants so their combined M-RoPE and DeepStack schemas keep the IREE feature build within Clippy's enum-size contract. Validation: focused DeepStack and M-RoPE suites, full mlxcel-xla library suite, default and IREE-feature Clippy, and the production/diagnostic DeepStack local-task oracle. Refs #867
09f1aba to
14a039f
Compare
|
Rebased the DeepStack branch onto Integration review:
Validation after the rebase:
The branch head is now |
Prepare DeepStack requests against the loaded runtime position mode and carry that explicit contract through the Rust/C ABI so M-RoPE [3,S] payloads are validated and uploaded without collapsing to 1D. Commit signed decode deltas only after native prefill succeeds and reject incompatible single or ragged requests before scheduler mutation. Replace the internal scheduler mutation regression with public single and batch real-IREE fixtures covering negative and positive deltas, first-decode parity, failure-state retention, cancellation, slot reuse, and wrong-mode rejection. Extend the fixed Qwen3-VL production/diagnostic oracle to run both 1D and M-RoPE positions with exact hooks, logits, and K/V. Refs #867
|
Implemented the final HIGH-severity DeepStack/M-RoPE corrections in Key changes:
Validation:
The PR remains open and unmerged for CI/review. |
Route sequential prefill completion and M-RoPE coordinate calculation through one private transactional state so a failed native prefill cannot replace the last successful signed delta. Exercise that state from public DeepStack requests and assert the exact first decode coordinate before and after a failed replacement. Share the production DeepStack admission conversion with scheduler tests, then carry public negative, positive, and zero deltas through pending ownership and slot admission. Assert row-specific coordinates and verify cancellation plus same-slot text reuse restores a zero delta without mutating internal prepared positions. Refs #867
|
Closed the final mutation-sensitivity evidence gap in The production public API remains unchanged. Sequential prefill completion and decode-coordinate calculation now share a private transactional Batch admission now shares one private conversion helper between the production Validation:
PR #893 remains open and unmerged. |
* feat(xla): add sparse DeepStack prefill Add a distinct embeddings-prefill entry that injects compact per-layer multimodal residuals immediately after configured language layers. Validate payload shape, positions, target layers, and static bounds in Rust and the C ABI. Wire optional compilation, single and ragged execution, cancellation ownership, and a real IREE local-task fixture. Refs lablup#867 * test(xla): verify DeepStack hooked states Expose post-hook residuals from a diagnostic-only graph that reuses the production prefill layer loop. Port the fixed MLX Qwen3-VL DeepStack fixture and compare every first, middle, and last residual row, final logits, and all K/V elements in real IREE local-task execution. Refs lablup#867 * fix(xla): validate DeepStack against selected capacity Separate context-independent DeepStack schema checks from the static visual-bound check so parsing does not assume the historical 256-token default. Apply the bound only after RuntimeConfig selects the actual context capacity, with 512/300 acceptance and selected-capacity rejection coverage. Refs lablup#867 * fix(xla): preserve M-RoPE state in DeepStack batches Rebasing DeepStack prefill over the multimodal RoPE runtime exposed that its prepared batch variant was not carrying the signed decode delta into a slot, which would make later ragged decode coordinates diverge from the prepared prompt. Forward the embedded prepared-position delta for DeepStack requests and exercise that variant in the mixed text/M-RoPE cancellation and slot-reuse regression. Box both internal runtime config variants so their combined M-RoPE and DeepStack schemas keep the IREE feature build within Clippy's enum-size contract. Validation: focused DeepStack and M-RoPE suites, full mlxcel-xla library suite, default and IREE-feature Clippy, and the production/diagnostic DeepStack local-task oracle. Refs lablup#867 * fix(xla): preserve DeepStack M-RoPE positions Prepare DeepStack requests against the loaded runtime position mode and carry that explicit contract through the Rust/C ABI so M-RoPE [3,S] payloads are validated and uploaded without collapsing to 1D. Commit signed decode deltas only after native prefill succeeds and reject incompatible single or ragged requests before scheduler mutation. Replace the internal scheduler mutation regression with public single and batch real-IREE fixtures covering negative and positive deltas, first-decode parity, failure-state retention, cancellation, slot reuse, and wrong-mode rejection. Extend the fixed Qwen3-VL production/diagnostic oracle to run both 1D and M-RoPE positions with exact hooks, logits, and K/V. Refs lablup#867 * test(xla): pin DeepStack signed decode state Route sequential prefill completion and M-RoPE coordinate calculation through one private transactional state so a failed native prefill cannot replace the last successful signed delta. Exercise that state from public DeepStack requests and assert the exact first decode coordinate before and after a failed replacement. Share the production DeepStack admission conversion with scheduler tests, then carry public negative, positive, and zero deltas through pending ownership and slot admission. Assert row-specific coordinates and verify cancellation plus same-slot text reuse restores a zero delta without mutating internal prepared positions. Refs lablup#867
Summary
prefill_embeddings_deepstack.mainentry with compact[Nv],[K, Nv, hidden], and[K]side tensors and post-language-layer sparse residual injection.Validation
cargo fmt --all -- --checkcargo test -p mlxcel-xla --lib(193 passed, 6 opt-in ignored, 0 failed)cargo test -p mlxcel-xla --lib deepstack(9 passed)cargo clippy -p mlxcel-xla --lib --tests -- -D warningsIREE_CUDA_HOME=... IREE_CUDA_COMPILE=... cargo clippy -p mlxcel-xla --lib --features iree -- -D warningsCARGO_TARGET_DIR=... python3 spike/openxla/deepstack_prefill_check.pycompiled and ran both production and diagnostic Qwen3-shaped VMFBs on IREE local-task. The fixture portsQwen3VLModel::deepstack_processsemantics and exactly checks the full first/middle/last[3, 256, 4]post-hook residual tensor against visual-row values 11/21/31, final logits, and every K/V element for both graphs.Closes #867