Skip to content

Pin unslothai#269 (server-side preemption and exact concurrency) at 18365c117 - #211

Open
danielhanchen wants to merge 46 commits into
masterfrom
pin/server-side-preemption-197
Open

danielhanchen wants to merge 46 commits into
masterfrom
pin/server-side-preemption-197

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Update (2026-10-23): #269 at c732f0f

scripts/unsloth/pr-set.json now pins #269 at c732f0f, its head after 21 review rounds since 18365c1 (the last ones approved 4/4), refreshed onto upstream b11838 (4231b23), the base the prebuilt now picks. The pin moved one line; the other pins are master's, unchanged here.

Pin-set simulation of this branch's set on b11838: #269 merges additively and its pin contract holds. Four of master's other pins are refused there: ggml-org#25731 (Inkling), #243, #266 and #314 (Flint). #318 repins or drops ggml-org#25731, #243 and #314; they are outside this PR, which only moves the #269 pin.

Update (2026-10-21, later): master merged in, #269 at 18365c1

Master is merged in (#312: Inkling at e1b89cf, #304 IQ1_M MMQ, #311 Beam, #314 Flint), so the set is master's 23 pins plus #269, which now pins 18365c1 (#269 merged b11793: upstream ggml-org#30679 changed the gguf_kv_to_str declaration in src/llama-impl.h beside #269's lines; #269's own diff is unchanged per file).

ok   b11786 (aged): 24 pins; ggml-org#25731 additive; unslothai#70 additive; unslothai#298 additive; unslothai#314 additive; unslothai#269 additive
ok   b11796 (newest): the same, all 24 pins intact, merge_checks clean

verify --cuda on b11786 (B200): CPU gate build ok, feature matrix 15 of 15 on CPU, full CUDA build ok, test-chat pass, test-backend-ops MUL_MAT 2606/2606, MUL_MAT_ID 1077/1077, PAD 37/37, GET_ROWS 349/349, feature matrix 15 of 15 on GPU.

#269's CUDA preemption suites at 18365c1 on a Colab L4: 88 passed, 0 failed, 10 skipped, the same per test as at 15b4e3b.

Update (2026-10-21): #269 at 15b4e3b, ggml-org#25731 at e1b89cf

scripts/unsloth/pr-set.json now pins #269 at 15b4e3b, which merges upstream b11780 and b11782 and never picks a TTS or realtime transcription slot to park. It also repins ggml-org#25731 (Inkling) to e1b89cf, the same repin as #310, because 534c321 no longer merges on any base from b11760 on.

ok   b11782: 21 pins; ggml-org#25731 additive; unslothai#70 additive; unslothai#298 additive; unslothai#269 additive
ok   b11785 (aged), b11786, b11788, b11790, b11792: the same, all 21 pins intact, merge_checks clean
FAIL b11793, b11795, b11796: unslothai#269 REFUSED (src/llama-context.cpp src/llama-graph.cpp src/llama-impl.h tests/CMakeLists.txt)

The b11793 refusal comes from upstream ggml-org#30679 (824eaec, vocabulary loading), the only commit in b11792..b11793 touching those files. #269 will take b11793 before the aged base reaches it.

verify --cuda on b11785 (B200): CPU gate build ok, feature matrix 13 of 13 on CPU, full CUDA build ok, test-chat pass, test-backend-ops MUL_MAT 2508/2508, MUL_MAT_ID 1043/1043, PAD 37/37, GET_ROWS 349/349, feature matrix 13 of 13 on GPU.

Pins server-side preemption from #269 at f57ea1b. The old #260 pin sat on upstream b11540, was refused on the current nightly tags and is no longer in the set. #269 carries the same change set; its base branch is now base/upstream-2639a3b4e (b11642), so its diff (+8.6k/-0.2k, 81 files) is exactly what gets pinned, and it composes with the other pins additively.

The prebuilt is upstream's aged b#### tag plus the pins in scripts/unsloth/pr-set.json, merged in order (git diff3, then additive_merge.py for pure additions only). #269 had to take b11612 itself: upstream ggml-org#30023 (first in b11596) folded tests/test-state-restore-fragmented.cpp, which #269 extends, into test-llama-context, so #269 at f032338 was refused on every tag the nightly can now pick. #269 merged b11612 and moved its check into upstream's new frag case. It then took b11641 as well: upstream ggml-org#30506 (LiliCorr drafting) edits the DFlash block size on the line where #269 bounds it by the caller's remaining context, so #269 at ce0965c was refused on b11641; and ggml-org#30498 in b11642 sits beside its options in common/common.h and its README rows, so it took b11642 too.

What #269 adds over #260, besides the port:

  • Victim policy: --preempt-policy fcfs|cost (LLAMA_ARG_PREEMPT_POLICY), default fcfs: the newest running request is parked and parked requests resume oldest first, the order vLLM's scheduler uses. cost keeps the smallest-covering-victim choice.
  • Scheduler fixes from review: no time-slicing of residents that end by themselves (117 parks down to 2 on four 2000 + 512 chats at -c 8192 -np 4), a rotated-out slot queues behind the request it made room for, re-prefills keep their reservation, n_cmpl > 1 overflows no longer error every slot, in-flight restores land before a last-resort park.
  • Decode speed: libllama is built with branches kept off 32-byte boundaries on x86, which removes a 1.0 to 1.2% server decode loss that came from code layout on JCC-erratum hosts (see server: preemption notices, asynchronous parks and exact concurrency (pin branch on b11577) #269 for the L4 A/A/B).
  • Review round 3: an n_cmpl > 1 prompt is no longer held behind the request it parked (fcfs deadlock), the rotation margin is charged only on what stays resident, the transfer fence is recorded when a transfer is issued rather than after every decode, and caches whose sequences do not share cells (DeepSeek V4, recurrent) are never parked (llama_memory_shares_cells()).
  • Upstream behaviour without --preempt-ram is restored where it had drifted: the non-causal decision check, the context shift left to the decode, and no preempt record in responses.
  • CUDA supports_op refuses paged FLASH_ATTN_EXT shapes the paged kernel does not run.
  • The RPC server refuses a page-table FLASH_ATTN_EXT; the event query is published through get_proc_address, so ggml_backend_device_i stays upstream's.

Every preemption path is still off by default: --preempt-ram defaults to 0, so a server launched without it behaves like upstream, and exact concurrency is an environment opt-in. Studio passes --preempt-ram when it wants the server to park.

Also merges master (the #276 repin onto b11609), and records #269 under unchecked in feature-checks.json in place of #260.

Composes with master (2ca675f, 2026-10-16)

Master merged again (#282: model arch fix pins, ggml-org#30670 for Beam, and the now-upstream ggml-org#30520 dropped). #269 at f57ea1b needed no change. The 19 pins compose on every tag from b11681 (aged) to b11696:

ok   b11681: 19 pins; ggml-org#25731 additive; unslothai#70 additive; ggml-org#30670 additive; unslothai#269 additive
     pin_contract rc=0: all 19 pins are intact in the merged tree
ok   b11683, b11684, b11685, b11687, b11688, b11690, b11693, b11695, b11696: the same

CPU verify on b11681 and b11696: gate build ok, feature matrix 11 of 11 on CPU. The b11681 merged tree, rebuilt on a Kaggle T4x2 with the nightly's merge steps (tree hash feb3976bc equal to the local sim), CUDA sm_75:

ok   full CUDA build
ok   test-chat: All tests passed
     test-backend-ops (CUDA) MUL_MAT 2508/2508, MUL_MAT_ID 1043/1043, PAD 37/37, GET_ROWS 340/340
ok   feature_matrix (GPU): all 10 features demonstrated on GPU
ok   #269 test_preempt.py on the merged server: 71 passed, 8 skipped under fcfs and under cost
ok   test_preempt_notify.py + test_preempt_models.py: 17 passed

Composes with master (706f461)

Master merged in (#273's #243 repin, #278's ggml-org#25731 repin and ggml-org#30520, #280's ggml-org#30616, #264, #266); #269 is appended last. ggml-org#30520 rewrites the LiliCorr walk's loop header, right above a line #269 adds, so #269 at 3ef8b53 was refused on every tag; #269 at 3a68a5c moves that line clear of the header. ggml-org#30580 (b11669) also added a single-string override_kv to the server test helper beside #269's list of the same name; #269 at f57ea1b renames its list. With it, the 20 pins (master's 19 plus #269) compose on every tag the nightly can pick, b11669 included:

ok   b11658: 20 pins; ggml-org#25731 additive; unslothai#70 additive; ggml-org#30616 additive; unslothai#269 additive
     pin_contract rc=0: all 20 pins are intact in the merged tree
     merge_checks rc=0: merge_checks: clean
ok   b11662: the same
ok   b11669: the same (pin_contract: 1 can be retired, ggml-org#30520, now upstream)

Verify on b11658 (aged) and b11669 (newest), CUDA on a B200 (run with #269 at 3a68a5c; f57ea1b changes only a test helper, and the sim above was rerun on it):

ok   CPU gate build (llama test-llama-archs test-backend-ops test-mtmd-impl)
ok   feature_matrix (CPU): all 10 features demonstrated on CPU
ok   full CUDA build
ok   test-chat: All tests passed
     test-backend-ops (CUDA) MUL_MAT 2512/2512, MUL_MAT_ID 1043/1043, PAD 37/37, GET_ROWS 340/340
ok   feature_matrix (GPU): all 10 features demonstrated on GPU

#269's preemption suites on the merged b11669 server (CUDA build, B200): 85 passed, 8 skipped; the non-causal model test passes after f57ea1b, and the one CPU-only parked-head test passes in 42 s on the merged tree's CPU build with the suite's thread cap (it timed out uncapped at load 500).

Earlier runs, on older heads of #269:

Verify on b11642 (newest), CPU:

ok   CPU gate build (llama test-llama-archs test-backend-ops test-mtmd-impl)
ok   feature_matrix (CPU): all 7 features demonstrated on CPU, 6 check(s) need a GPU and were not run

The same set on b11641 with #269 at 49b2552, rebuilt on a Kaggle T4 with the nightly's merge steps (tree hash equal to the local sim), CUDA sm_75:

ok   full CUDA build
ok   test-chat: All tests passed
     test-backend-ops (CUDA) MUL_MAT     2512/2512 passed
     test-backend-ops (CUDA) MUL_MAT_ID   990/990 passed
     test-backend-ops (CUDA) PAD           37/37 passed
     test-backend-ops (CUDA) GET_ROWS     216/216 passed
ok   feature_matrix (GPU): all 7 features demonstrated on GPU
ok   #269 test_preempt.py on the merged server: 70 passed, 8 skipped under fcfs and under cost

#269's own suites on d1766cc, CPU: test_preempt.py 65 passed, 14 skipped under fcfs and under cost, test_preempt_models.py + test_preempt_notify.py 17, test-llama-context 130 of 130. On a Kaggle T4 (sm_75) at d1766cc, CUDA: test_preempt.py 71 passed, 8 skipped under each policy with the async park path running, test_preempt_models.py + test_preempt_notify.py 17, test-event-query and test-state-seq-copy pass. On AMD gfx1151 (ROCm/HIP) at 37254a7, four chats that overflow the shared pool finish with parks where b11612 fails all four with context errors.

Known, not from this pin

On b11617 a B200 failed 5 MUL_MAT_ID cases that also failed with no pins; on b11658 and b11669 all 1043 pass.

Not run

Vulkan, Metal, Windows and ARM legs of the merged prebuilt run only in the nightly; the ROCm run above is #269 alone, not the merged set. The verify above is on a B200 (sm_100); the older-GPU runs (T4, L4, A100) are on earlier heads of #269.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T16:35:27.817351Z abb23f2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

#210's branch carries an old ggml-org#25731 and is refused on newer tags, so
the change set is pinned from #260, a branch on upstream b11540 (1e6f04a)
that composes with the Inkling and DiffusionGemma pins additively. Adds the
scheduling fixes (an aged head is served, any resident rotates, the cheapest
covering victim parks) and the /props preempt report.
@danielhanchen danielhanchen changed the title Pin unslothai/llama.cpp#210 (server-side preemption and exact concurrency) at afd3248b82 Pin unslothai/llama.cpp#260 (server-side preemption and exact concurrency) at 7a011aacf Oct 11, 2026
# Conflicts:
#	scripts/unsloth/pr-set.json
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 13, 2026
…(b11540)

#260 on b11540 no longer merges into the nightly tags (b11577 onward conflict in common/common.cpp, src/llama-kv-cache.cpp and tests/CMakeLists.txt). #269 carries the same change set on b11577 plus fixes for the RPC page-table refusal, the event query ABI and exact-mode restore validation.
# Conflicts:
#	scripts/unsloth/feature-checks.json
#	scripts/unsloth/pr-set.json
@danielhanchen danielhanchen changed the title Pin unslothai/llama.cpp#260 (server-side preemption and exact concurrency) at 7a011aacf Pin unslothai/llama.cpp#269 (server-side preemption and exact concurrency) at b8f7b90d7 Oct 13, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: a0003f9cf3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Adds the review fixes since b8f7b90: exact mode refuses every host-placed weight outside the input layer, ty-clean preemption tests, the HIP VGPR ignore entry for the paged vec kernel, steadier timing tests, and documentation of the page table and the parking RAM gauge.
@danielhanchen danielhanchen changed the title Pin unslothai/llama.cpp#269 (server-side preemption and exact concurrency) at b8f7b90d7 Pin unslothai/llama.cpp#269 (server-side preemption and exact concurrency) at 24bec0460 Oct 13, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: bca4d7e861

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 059c30bf3b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 706f461fae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…emption-197

# Conflicts:
#	scripts/unsloth/pr-set.json
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 5e7799c446

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: afbf9a4152

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

3 similar comments
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: abb23f276c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…pin/server-side-preemption-197

# Conflicts:
#	scripts/unsloth/feature-checks.json
#	scripts/unsloth/pr-set.json
@danielhanchen danielhanchen changed the title Pin unslothai#269 (server-side preemption and exact concurrency) at 37254a781 Pin unslothai#269 (server-side preemption and exact concurrency) at 18365c117 Oct 22, 2026

This branch has not been deployed

No deployments
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.

1 participant