Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions docs/receipts/gfx1151-cancel-76aafcf2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# gfx1151 cancellation follow-up

Measured on 2026-10-18, following the unresolved 27B case in [#994](https://github.com/ashhart/TensorFold/pull/994).
This is a fresh A/B run on public source `76aafcf274e60a5e31a59ce145b2f71f7b366e9d` and the runtime patch
in `5429554e708fdf7a9e0017301a00eb87a4182acd`. It is not a full release qualification.
Subsequent source changes shorten comments/docstrings for the lean rule; runtime and gate execution logic are unchanged.

The single GPU is a BOSGAME M5's Radeon 8060S (`gfx1151`). The checkpoint is
`TensorFold/Qwen3.8-27B-MLX-4bit` at `70ae7fac63274ff2eac54152031433374cb80f2f`.
All 17 checkpoint files match their previously pinned public Git-blob/LFS digests; see `checkpoint.json`.

## Cancellation result

The same gate runs three trials per build. Each trial separately measures the time from closing a long request's
socket until the engine's `requests_running` metric reaches zero, then the next short request sent 50 ms behind
another cancellation. Every long request uses a fresh nonce first, preventing long-prefix reuse.
The client closes 0.4 seconds after sending it. All twelve cancelled prompts fit within the 16,384-token window
and end with `reason=client-left`, zero emitted tokens. Actual prompt lengths are in `audit.json`.

| Measurement | Unmodified base | Fixed |
| --- | ---: | ---: |
| Idle short baseline, best of three | 1.899 s | 1.913 s |
| Disconnect to idle metric, three trials | 4.720–4.744 s | 0.032–0.042 s |
| Next short request, three trials | 6.532–6.548 s | 1.902–1.907 s |
| Cancelled request lifetime, arrival to end | 5.08–5.14 s | 0.43–0.44 s |
| Gate: release <=0.5 s and short <=idle+0.5 s | **3/3 failed** | **3/3 passed** |

All fourteen short replies across the two builds have the same complete native token SHA-256:
`ad11ca37c7fcabaf13c8fc1142956890438c4ca49c58d6f579c3eef5485b77d5`.
`*-http.jsonl` retains each short request/response and each cancelled request's exact body.
`*-server.log` independently retains six client-left completions per build.
Arrival-to-end lifetime is not used as disconnect-to-release time.

The harness's optional `--baseline-27b` also prints the historical v1.0.12 receipt for comparison.
Those historical numbers are labelled separately; the table above is the fresh unmodified-versus-fixed comparison.

## Correctness and timing controls

An identical uncancelled 14,975-token prompt produces the same full native token SHA-256 on both builds:
`677caeac8d5e87f26c67e37ff1551667fc3217c4690d7a276204d22c2504f0a1`.
Prefill takes 79.021 s before and 78.867 s after. This is one timing control, not a broad performance claim.
The complete requests and replies are in `*-uncancelled.json`.

The unmodified `serve_check.py` then passes its 13 exercised comparisons on the fixed server, including
concurrent/solo and resumed/fresh checks. It prints 15 successes, but two drafting comparisons are unexercised:
this checkpoint has no draft head. The raw output retains all fifteen lines without inflating exercised coverage.

The host build passes 292/292 steps; cached results are reused. It reports 126 new passes and two skips, and the
HIP Qwen family reports 32 passes/one skip. Before the implementation, retaining the old 2,048-row threshold and
the null cancellation hook makes both new CPU regressions fail. Remaining work in that deliberately failing build
was stopped once those two failures were captured; it is not a completed full-suite run. See `cpu-*.log`.

## Reproduction and scope

`state.json` retains exact build/server/test commands and both binary SHA-256 values. Use Zig 0.17.0,
HIP 7.1 and clang 21; the HIP build targets `gfx1151` with explicit compiler/include/device-bitcode paths.
The server uses `--context 16384 --parallel 4 --prompt-cache-gib 1 --no-thinking --metrics-open` on loopback.
Run from each source version, using the same pinned checkpoint:

```sh
python3 zig/tests/qwen35/serve_cancel_release.py http://127.0.0.1:8092 amd-cancel-27b \
--runs 3 --server-log SERVER_LOG --record HTTP_JSONL --baseline-27b
python3 zig/tests/qwen35/serve_check.py http://127.0.0.1:8092 amd-cancel-27b 64
```

Only single-rank HIP Qwen prompt passes of at least 512 rows now poll cancellation at layer boundaries.
Shorter passes still finish their current chunk; tensor-parallel groups retain between-chunk cancellation so
ranks do not diverge at a collective. This run does not qualify every prompt cut, other models, multi-GPU,
drafting, or all release gates. It does not implement DFlash2 or resolve the separate benchmark-publication work.

This directory is a separate sanitized publication copy. Machine-local paths/hostname are replaced with
placeholders and trailing whitespace normalized. Request/response values and native hashes are unchanged.
`publication.json` records source/published hashes; `SHA256SUMS` covers every published file except itself.
Original raw evidence and service-control state remain private and unchanged.
21 changes: 21 additions & 0 deletions docs/receipts/gfx1151-cancel-76aafcf2/SHA256SUMS
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
4dfa053b09d0f5584088538097e0094a19bda027f59f0363bc8c747aa0f50e82 README.md
d4f77f3605d3ede0aeef5757c360bba26823b1baa46c592ba7de3c1fb5f34392 apply-fix.log
4ba097ef30465f860f9d123ba3cae1281f3cef8f71658522cd9c806c357e8a3c audit.json
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b base-build.log
5127ed813d5e1490682f5859fef40327aae50cdc7ac44add58d65afe292d11b4 base-cancel.log
694402e41dc987834b2314fa71be2ed4386496730f72a60bbb7d2702e21e33cc base-http.jsonl
376990664a4a2514fd468950e949c221b209d2c26e15e2636c7b1c3aa7da4ce4 base-server.log
2a8f77d9ca5990ecbf3b54812af25bcde7a35123e4e67473e97e570054e56561 base-uncancelled.json
4c3cd0481e429da05b394a479be92ecc3017143d7aaa9224348b55db3896626e checkpoint.json
24adf478be7254d6d16f95925dd4215dd2858170193713ad4108e0811dc11221 cpu-fixed.log
307573b7894c6f340ec371e4b088f20e8bec07a5056aa3cea83d6fcdfc024d19 cpu-negative.log
2381a774b0b278f6ffc478ebf0d21592d466a1211b0c839221aa5c6cf40390a7 environment.json
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b fixed-build.log
dc3344269ef666913603f710f9491e3f047bdd4b02c4025ecbd2f46ecd4d446e fixed-cancel.log
e64d7c189bc2aee370b1369dfa652e164585439b9acafa9529f512e05726ff2c fixed-http.jsonl
075c7d1ef54c7124576d094fc0badccc58565fbdce83bde2c3de9ad2ed961eb8 fixed-serve-check.log
22aea9113e62618196f70101b230999c897ad11b7b408aa64b506a24fcf43f31 fixed-server.log
45516e70ae391ccfb654e02b0a94ae741b89c0095df733936d41b33129750bb8 fixed-uncancelled.json
3ccf8f9783270c302f6709bd7e1418afa9685be26c7c6ed23120f631f6f1d49c provenance.json
78281c6f127f352d593298fe89b1e759e16432f4e89eb940f27eec9355289499 publication.json
984fa52ed6f27a7b79ef034691cd986e2b1ad7986ca2584a9f49a84a793fb0df state.json
4 changes: 4 additions & 0 deletions docs/receipts/gfx1151-cancel-76aafcf2/apply-fix.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
patching file zig/src/families/qwen3_5/backend/hip/engine/engine.zig
patching file zig/src/families/qwen3_5/backend/hip/engine/hip_lanes.zig
patching file zig/src/families/qwen3_5/backend/hip/engine/prefix.zig
patching file zig/src/families/qwen3_5/hip.zig
24 changes: 24 additions & 0 deletions docs/receipts/gfx1151-cancel-76aafcf2/audit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"cancelled_prompt_tokens": {
"base": [
14994,
14994,
14994,
14994,
14994,
14994
],
"fixed": [
14994,
14994,
14994,
14994,
14994,
14994
]
},
"cancelled_prompts_fit_context": true,
"short_http_responses": 14,
"identical_short_native_hashes": true,
"identical_long_native_hashes": true
}
1 change: 1 addition & 0 deletions docs/receipts/gfx1151-cancel-76aafcf2/base-build.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

8 changes: 8 additions & 0 deletions docs/receipts/gfx1151-cancel-76aafcf2/base-cancel.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FAIL cancel 0: released 4.73 s after the disconnect (max 0.50); the next short request took 6.55 s (alone 1.90 s, slack 0.50)
FAIL cancel 1: released 4.74 s after the disconnect (max 0.50); the next short request took 6.53 s (alone 1.90 s, slack 0.50)
FAIL cancel 2: released 4.72 s after the disconnect (max 0.50); the next short request took 6.54 s (alone 1.90 s, slack 0.50)
server: 6 cancelled requests ended 5.08 to 5.14 s after they arrived (arrival to end, not disconnect to release)
1.0.12 receipt 27B: next short 6.49 to 6.51 s, alone 1.90 s, cancelled requests ended 5.04 to 5.07 s after arrival
this run: next short at most 6.55 s, alone 1.90 s: -0.06 s against the receipt's best
summary {"model": "amd-cancel-27b", "words": 2200, "drop_after_s": 0.4, "alone_s": 1.899, "slack_s": 0.5, "release_max_s": 0.5, "trials": [{"release_s": 4.73, "after_short_s": 6.548, "running_at_drop": true, "same_text": true, "same_native_tokens": true, "ok": false}, {"release_s": 4.744, "after_short_s": 6.532, "running_at_drop": true, "same_text": true, "same_native_tokens": true, "ok": false}, {"release_s": 4.72, "after_short_s": 6.543, "running_at_drop": true, "same_text": true, "same_native_tokens": true, "ok": false}], "baseline_native_token_sha256": "ad11ca37c7fcabaf13c8fc1142956890438c4ca49c58d6f579c3eef5485b77d5", "lifetime_s": [5.13, 5.1, 5.14, 5.08, 5.12, 5.08], "failed": 3, "receipt_27b": {"after_short_s": [6.49, 6.51], "alone_s": 1.9, "lifetime_s": [5.04, 5.07]}}
failed 3
13 changes: 13 additions & 0 deletions docs/receipts/gfx1151-cancel-76aafcf2/base-http.jsonl

Large diffs are not rendered by default.

Loading
Loading