Skip to content

fix(cuda): preserve first-token handoff through native host - #1031

Closed
jrb-ai wants to merge 1 commit into
ashhart:mainfrom
jrb-ai:fix/cuda-first-token-forwarding
Closed

jrb-ai wants to merge 1 commit into
ashhart:mainfrom
jrb-ai:fix/cuda-first-token-forwarding

Conversation

@jrb-ai

@jrb-ai jrb-ai commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

What this changes

Qwen CUDA already sets first_before_draft = true, and the lane core can deliver the first token before preparing the initial drafts. However, Host.backend() rebuilds the backend without copying that flag, resetting it to the default false. Normal native CUDA serving therefore misses the opted-in first-token handoff integrated from #932.

Forward h.inner.first_before_draft through the native CUDA host. Extend the existing host-wrapper test to check both disabled and enabled values while retaining its prefill_step check. The change is confined to zig/src/native/cuda.zig.

This follows the source-level finding on #932. Thank you for integrating the handoff into the shared lane core; this restores the missing connection to that implementation.

Receipt

  • Base: current main at 76aafcf274e60a5e31a59ce145b2f71f7b366e9d; Zig 0.17.0, ARM64 macOS, CPU-only CUDA host tests.
  • Regression: with only the runtime forwarding removed, CUDA host preserves prefill_step and first-before-draft capability fails at the enabled-value assertion. With forwarding restored, it passes. The disabled-value check also prevents enabling the capability unconditionally.
  • zig build test-cuda-host -j2 --summary all: 80/80 build steps succeeded. The final run reports 109 passed, 1 skipped and 0 failed; unchanged test artifacts were cached from the preceding runs. The affected native CUDA test artifact reports 52 passed, 1 skipped and 0 failed (versus 51 passed, 1 skipped and the expected regression failure without the fix). The native skip is the Linux-only /proc/meminfo test on macOS.
  • zig fmt --check zig/src/native/cuda.zig and git diff --check: pass.
  • Lean check: 503 inherited findings on the base and candidate; zero new findings. The changed file remains 600 lines.
  • CUDA device/model exactness, TTFT, prompt throughput and decode throughput were not rerun for this follow-up. This receipt establishes the host-wrapper regression and correction; it does not claim new performance measurements or replace the CUDA release gate.

Authored by Jonathan Regan-Beasley in a private capacity. This contribution does not represent the views or positions of any organisation.

@ashhart

ashhart commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Thanks @jrb-ai. Your enabled-value regression fails when the forwarding is removed, and your fixed run reports 109 passed, one skipped and no failures.

The change correctly preserves the family's first-token opt-in through the CUDA host, so the existing handoff can happen before initial drafting. The lane recorder's wrapper drops the same flag, and we'll fix that alongside. We're planning this for 1.1.1 through our host checks plus a check on NVIDIA GB10 that complete token sequences stay the same. Your current receipt covers the host regression; device timing and throughput were not rerun.

Posted by Ash's AI Assistant Synthena

ashhart pushed a commit that referenced this pull request Oct 19, 2026
Carry #1031 by @jrb-ai onto the release track, preserving its original GitHub noreply identity and regression. Original commit c3181d1. Three blank lines are removed to keep the composed native file under 600 lines.
ashhart pushed a commit that referenced this pull request Oct 19, 2026
Carry #1036 by @jrb-ai immediately after #1031. Preserve the original author identity and exact three handle substitutions from b97ad67.
ashhart added a commit that referenced this pull request Oct 19, 2026
Forward the inner backend instance flag and cover false and true through Recorded.init. Keep unsupported-feature refusals intact. Follow up #1031 separately from its credited author change and account-link update.
@ashhart ashhart mentioned this pull request Oct 19, 2026
@ashhart

ashhart commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Thanks @jrb-ai for #1031 and the regression coverage. 1.1.1 forwards the family's first-token handoff flag through the native CUDA host. An enabled family can deliver that token before initial drafting. The recording wrapper also preserves the flag, so recording keeps the same handoff behavior.

Posted by Ash's AI Assistant Synthena

@ashhart ashhart closed this Oct 19, 2026
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
Carry ashhart#1031 by @jrb-ai onto the release track, preserving its original GitHub noreply identity and regression. Original commit c3181d1. Three blank lines are removed to keep the composed native file under 600 lines.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
Carry ashhart#1036 by @jrb-ai immediately after ashhart#1031. Preserve the original author identity and exact three handle substitutions from b97ad67.
BlivionIaG pushed a commit to BlivionIaG/TensorFold that referenced this pull request Oct 20, 2026
Forward the inner backend instance flag and cover false and true through Recorded.init. Keep unsupported-feature refusals intact. Follow up ashhart#1031 separately from its credited author change and account-link update.
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