Skip to content

fix(drama3): complete replay poison before resetting streams - #1119

Closed
plotarmordev wants to merge 2 commits into
ashhart:mainfrom
plotarmordev:drama3/replay-stock-fix
Closed

plotarmordev wants to merge 2 commits into
ashhart:mainfrom
plotarmordev:drama3/replay-stock-fix

Conversation

@plotarmordev

Copy link
Copy Markdown
Contributor

What this changes

This fixes a crash: drama3-generate --replay 1 --max-rows 64 on main fails with CUDA_ERROR_ILLEGAL_ADDRESS.

Wait for engine and codec poison fills to complete before reset, prefill or decode can reuse their buffers. Default-stream memset can return before completion, and the non-blocking execution streams do not implicitly wait for it.

Receipt

  • Environment, with the TensorFold commit, MLX or PyTorch version, machine and GPU, checkpoint and revision:
    drama3/replay-stock-fix, 3aa77ad33f0365ae9c2388f063579885bfc87093, based on d1018b31; native CUDA. Framework versions, checkpoint revision and GPU identity are not recorded in the cited replay receipt.
  • Exactness, from tools/bench_concurrent.py --alone --serial or token_sha against "draft": false:
    Synthetic public-text replay: stock with --max-rows 64 crashes with CUDA_ERROR_ILLEGAL_ADDRESS; Compute Sanitizer identifies invalid KV writes in d3_qk_rope. With the fix, the crash is gone and eager/graph frame equality and poisoned/reset single-frame codec equality pass. A separate codec chunk-width ReplayMismatch remains on stock plus only this fix, as well as on batched prefill; codec arithmetic is out of scope. This is not a full replay pass or a clean sanitizer exit: the fixed sanitizer run still reports an optional missing-symbol API probe.
  • Decode speed before and after, from tools/bench_openai.py:
    Not measured; ordinary generation arithmetic is unchanged.
  • Prompt speed before and after: the cold first request's ttft_s from tools/bench_cache.py --require-cold on a long prompt, or "n/a" with the reason when the change cannot reach prompt processing:
    n/a: synchronization is added only to replay poisoning, not ordinary prompt processing.
  • Tests run, with pass, fail and skip counts:
    Fresh fix-branch runs with Zig 0.17.0: zig build test --summary all -j2 succeeded with 2960/2974 tests passed, 14 skipped and no failures; CUDA_VISIBLE_DEVICES= zig build test-cuda-host --summary all -j2 succeeded with 922/924 passed, 2 skipped and no failures. These invocation counts include cache reuse and are not additive. No cortheon/tool_parse failure occurred. zig fmt --check build.zig zig emitted no diagnostics; the privacy scan was clean. The supplied earlier receipt also reports successful kernel-contract/golden checks and generator builds. The regression models pending default-stream fills and checks both poison methods return only after completion. A reverse-patch failure run was not performed. GPU replay still fails at the codec chunk-width comparison; later replay checks are not reached.
  • Not run, and why:
    OpenAI serving benchmarks, concurrent/draft exactness and Metal qualification are not established by this replay-focused receipt.

Checklist

  • Every token still goes through the lane rounds. No serial path, and nothing that needs drafts off.
  • Drafted output equals "draft": false, a resumed prompt equals a fresh one, and concurrent equals solo.
  • No precision traded for speed. If the bits change, the description says which sums change and why.
  • A new or changed GPU kernel is registered with the kernel contract (docs/kernel-contract.md); each backend's SUMMARY line is in the receipt.
  • Prompt processing is no slower than the last release.
  • The description says which platforms I ran, Metal M1 to M5 and CUDA, and which I could not.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths. No AI attribution lines.

@ashhart

ashhart commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Thanks @plotarmordev. Your replay-poison fix is on main (a4c16a5), with its note carried above the released 1.1.3 history. Drama's replay, concurrent and streamed cells qualified on a GB10, and default speech output is byte-identical to main. Closing as landed; it ships in 1.1.4.

- Synthema, Ash's AI Assistant.

@ashhart ashhart closed this Oct 24, 2026
@ashhart

ashhart commented Oct 24, 2026

Copy link
Copy Markdown
Owner

This shipped in TensorFold 1.1.4: https://github.com/ashhart/TensorFold/releases/tag/v1.1.4

Thank you @plotarmordev for the contribution.

- Synthema, Ash's AI Assistant.

@ashhart ashhart added the landed Landed on main by the maintainers; the commits keep the contributor's authorship label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

landed Landed on main by the maintainers; the commits keep the contributor's authorship

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants