Repository navigation
docs: add the six paged-decode v2 variables and correct the NATIVE row - #1119
Merged
Merged
Conversation
`docs/environment-variables.md` claims to be the index for `MLXCEL_*` variables, but six paged-decode v2 variables read from Rust were absent from it, and the one paged-attention row that was present described itself as "not a server knob" even though issue #899 made its force-off values the server's v2 decode kill switch. An operator reading the reference page to find that kill switch was told the variable did not apply to them, while README.md and docs/CONTINUOUS_BATCHING.md told them it did. New "Paged decode v2 variables" section with the three operator-facing knobs, defaults read from the code rather than from the issue: `MLXCEL_PAGED_SLAB_BLOCKS` (derived from per-slot context and batch, floored at the 32-block pool default, `0` pins that default), `MLXCEL_PAGED_V2_MIN_KV_TOKENS` (4096, the lone-request floor) and `MLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST` (512, the per-request floor). The section cross-links docs/CONTINUOUS_BATCHING.md for the dispatch policy and the per-outcome log lines instead of duplicating its prose. Three diagnostics added to "Hardware and kernel diagnostic variables": `MLXCEL_PAGED_ATTENTION_V2` (off; issue #898's library-only comparison gate, not the production path), `MLXCEL_PAGED_DECODE_V2_CHUNK` (unset; pins pages_per_chunk over the plan and the autotuner) and `MLXCEL_PAGED_DECODE_V2_TARGET_CTAS` (unset; derived as gpu_core_count * 8 floored at 64 on Apple and a fixed, CUDA-unvalidated 512 elsewhere). The `MLXCEL_PAGED_ATTENTION_NATIVE` row now states both consumers as `resolve_dispatch_decision` and `resolve_paged_v2_dispatch` in src/lib/mlxcel-core/src/layers.rs document them, and keeps the #710 library-only retirement as history rather than as the current statement. Docs only, no behavior change. Defaults verified against paged_v2/mod.rs, paged_v2/plan.rs, paged_v2/dispatch.rs, autotune/ops/paged_decode_v2_chunk.rs and execution/memory_estimate.rs. Closes #1104
3 tasks done
inureyes
added a commit
that referenced
this pull request
Aug 13, 2026
## Summary Four PRs merged on 2026-08-13. Two of them, #1120 and #1122, got their bilingual technical reports from the chain workflow. #1118, #1119 and #1121 merged without one. This PR closes that gap after the fact so the batch is uniformly documented. Six files, `.en.md` and `.ko.md` per PR, following the naming and section shape of the two reports already in `TECHNICAL_REPORTS/` from this same batch. No source, documentation, or build file is touched. ## What is here | PR | Issue | Squash commit | Report | |---|---|---|---| | #1119 | #1104 | `cf4e22cd` | `1119-paged-decode-v2-env-vars-20260814.{en,ko}.md` | | #1118 | #1108 | `33322d66` | `1118-cli-dry-sequence-breakers-20260814.{en,ko}.md` | | #1121 | #1110 | `f0bf3a2c` | `1121-utils-used-by-annotations-20260814.{en,ko}.md` | Each report was written from the merged diff (`git show <commit>`) and the linked issue body, not from the PR description alone. Each records at least one thing the issue did not contain. ## Findings recorded in the reports **#1121 (issue #1110).** The issue was wrong on a load-bearing point. It recorded `create_causal_mask` as carrying no `Used by:` annotation. It carried one, and that annotation named Llama, Mixtral, Gemma, Cohere, Phi, GLM4, StarCoder2 and OLMo among its users while grep at that commit shows `mixtral.rs`, `phi.rs`, `phi3small.rs`, `starcoder2.rs`, `llama3.rs`, `gemma.rs`, `gemma2.rs`, `cohere.rs`, `glm4.rs`, `olmoe.rs` and `qwen3_moe.rs` each calling it zero times. Those families moved to the implicit-causal fused-SDPA path (`mask: None` when `seq_len > 1`). The PR therefore replaced a misleading roster rather than adding a missing one, which is a stronger defect than the issue described: a missing annotation sends a contributor to look, a wrong one tells them not to. Measured counts at that commit: 44 non-test callers under `src/models` (the issue's 46 counted `diffusion_gemma/tests.rs` and `phi3small_tests.rs`), 55 across all of `src`. **#1119 (issue #1104).** All six variable defaults were traced to their definition sites rather than to the issue text. Two out-of-scope defects are recorded rather than fixed: `docs/turbo-kv-cache.md` around lines 298 to 312 still carries the same pre-#899 "not a server knob" framing this PR corrected in `environment-variables.md`, and in `src/execution/memory_estimate.rs` the `Err(_)` arm of `resolve_paged_slab_blocks` warns "using the derived slab size" and then returns `None`, which keeps the 32-block pool default instead, so the warning describes behavior that does not happen. **#1118 (issue #1108).** The issue was reframed away from a flag-parity feature request into a docs fix after investigation showed the CLI omits nine server sampling knobs, not one. The change is comment-and-help-text only, 13 added lines all matching `^\s*(///|//)`. The second `dry_multiplier` field in `src/main.rs` belongs to `ServeArgs`, which already exposes `--dry-sequence-breakers` sixteen lines below, so it was deliberately left alone. ## Notes `TECHNICAL_REPORTS/` is listed in `.gitignore` but is tracked through the `TECHNICAL_REPORTS/.keep-reports` marker, so the six files were staged with `git add -f`. ## Test plan - [x] `git status --porcelain` shows exactly the six intended files staged and nothing else - [x] Every claim in each report checked against the merged commit: caller counts re-run with `git grep` at `f0bf3a2c`, variable defaults re-read at their definition sites, diffstats taken from `git show --stat` - [x] No build, test, lint, or format surface involved: the diff is six new Markdown files under `TECHNICAL_REPORTS/`
This was referenced Aug 13, 2026
3 tasks done
inureyes
added a commit
that referenced
this pull request
Sep 2, 2026
## Summary `docs/turbo-kv-cache.md` still described `MLXCEL_PAGED_ATTENTION_NATIVE` as a library/bench-only control, "not a server knob." That claim went stale when issue #899 made the fused v2 kernel the production decode path and turned this variable's force-off values into the server's kill switch, and the same claim was already corrected in `docs/environment-variables.md` by PR #1119. ## What changed - Rewrote the tail of the `### Measured payoff` paragraph in `docs/turbo-kv-cache.md` to name both current consumers of `MLXCEL_PAGED_ATTENTION_NATIVE`: the library-only pooled entry point retired by #710, and the server's pool-backed batched paged decode (`resolve_dispatch_decision` and `resolve_paged_v2_dispatch` in `src/lib/mlxcel-core/src/layers.rs`). - Stated the server-side behavior concretely: force-off values are the #899 kill switch, and a force-on value pins v2 for every servable shape, bypassing the measured token floors. - Kept the #710 retirement as history rather than a current statement, matching the framing `docs/environment-variables.md` uses after PR #1119. - Cross-linked `docs/environment-variables.md#paged-decode-v2-variables` and `docs/CONTINUOUS_BATCHING.md#seeing-which-path-ran` instead of duplicating the dispatch policy and log-line prose, and kept the existing ADR 0001 link. - Left `docs/adr/0001-paged-attention-gather-vs-fused-kernel.md` and the `History:` clause in `docs/environment-variables.md` untouched, since both intentionally describe the past. ## Test plan - [x] `grep -rn "not a server" docs README.md` only shows the ADR 0001 decision record and the two `History:` clauses (in `docs/environment-variables.md` and now `docs/turbo-kv-cache.md`), none asserting current behavior - [x] `python3 scripts/ci/check_cross_repo_refs.py` passes - [x] `git diff --stat` shows `docs/turbo-kv-cache.md` only, no code touched Closes #1139
Merged
7 of 17 tasks
be-free-snowboy
pushed a commit
to freestylejs/snowbrain-mlxcel
that referenced
this pull request
Oct 27, 2026
lablup#1119) ## Summary `docs/environment-variables.md` was missing six paged-decode v2 variables that are read from Rust, and its `MLXCEL_PAGED_ATTENTION_NATIVE` row still asserted "not a server knob" even though issue lablup#899 made that variable's force-off values the server's v2 decode kill switch. This adds the six variables with defaults read from the code and rewrites the stale row. Docs only, no behavior change. ## What changed `docs/environment-variables.md`: - New `## Paged decode v2 variables` section (operator-facing, placed after the KV cache section) with `MLXCEL_PAGED_SLAB_BLOCKS`, `MLXCEL_PAGED_V2_MIN_KV_TOKENS` and `MLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST`. Its lead-in names `MLXCEL_PAGED_ATTENTION_NATIVE` as the kill switch and cross-links `docs/CONTINUOUS_BATCHING.md#seeing-which-path-ran` for the dispatch policy and per-outcome log lines rather than duplicating that prose. - Three rows added to `## Hardware and kernel diagnostic variables`, each marked **Diagnostic**: `MLXCEL_PAGED_ATTENTION_V2`, `MLXCEL_PAGED_DECODE_V2_CHUNK` and `MLXCEL_PAGED_DECODE_V2_TARGET_CTAS`. - The `MLXCEL_PAGED_ATTENTION_NATIVE` row now describes both consumers, matching `resolve_dispatch_decision` and `resolve_paged_v2_dispatch` in `src/lib/mlxcel-core/src/layers.rs`, and keeps the lablup#710 library-only retirement as history rather than as the current statement. Its Default cell now covers the server floors as well as the library selector's regime. Defaults were read from the code, not from the issue: | Variable | Default | Source | |---|---|---| | `MLXCEL_PAGED_ATTENTION_V2` | off | `paged_v2/mod.rs` (`V2_ENV`, `parse_v2_enabled`) | | `MLXCEL_PAGED_DECODE_V2_CHUNK` | unset (planned or autotuned chunk) | `autotune/ops/paged_decode_v2_chunk.rs` (`CHUNK_ENV`) | | `MLXCEL_PAGED_DECODE_V2_TARGET_CTAS` | derived: Apple `gpu_core_count * 8` floored at 64, else 512 | `paged_v2/plan.rs` (`device_target_ctas`) | | `MLXCEL_PAGED_SLAB_BLOCKS` | derived `ceil(per_slot_ctx / block_size) * batch`, floored at the 32-block pool default, capped at the per-layer budget share | `execution/memory_estimate.rs` (`resolve_paged_slab_blocks`), `cache/paged.rs` (`POOL_SLAB_BLOCKS = 32`) | | `MLXCEL_PAGED_V2_MIN_KV_TOKENS` | `4096` | `paged_v2/dispatch.rs` (`MIN_SINGLE_REQUEST_KV_TOKENS`) | | `MLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST` | `512` | `paged_v2/dispatch.rs` (`MIN_BATCHED_KV_TOKENS_PER_REQUEST`) | One correction against the issue's wording: an unparseable `MLXCEL_PAGED_SLAB_BLOCKS` warns and then leaves the 32-block pool default in place, taking the same `None` path as `0`, even though the in-code warning text says "using the derived slab size". The row documents the behavior, not the warning. ## Test plan - [x] Every default traced to its definition site rather than to the issue text (table above) - [x] `python3 scripts/ci/check_cross_repo_refs.py` passes - [x] Table rows verified to keep the 4-column shape of the sections they were added to - [x] No code touched, so no build or test change: `git diff --stat` is `docs/environment-variables.md` only Not touched, and deliberately so: `README.md` and `docs/CONTINUOUS_BATCHING.md` already state the correct behavior, and the reference page is what disagreed with them. `docs/turbo-kv-cache.md` lines 298 and 309 carry the same pre-lablup#899 "library-only" framing and are worth a separate follow-up. Closes lablup#1104
be-free-snowboy
pushed a commit
to freestylejs/snowbrain-mlxcel
that referenced
this pull request
Oct 27, 2026
…up#1121 (lablup#1123) ## Summary Four PRs merged on 2026-08-13. Two of them, lablup#1120 and lablup#1122, got their bilingual technical reports from the chain workflow. lablup#1118, lablup#1119 and lablup#1121 merged without one. This PR closes that gap after the fact so the batch is uniformly documented. Six files, `.en.md` and `.ko.md` per PR, following the naming and section shape of the two reports already in `TECHNICAL_REPORTS/` from this same batch. No source, documentation, or build file is touched. ## What is here | PR | Issue | Squash commit | Report | |---|---|---|---| | lablup#1119 | lablup#1104 | `cf4e22cd` | `1119-paged-decode-v2-env-vars-20260814.{en,ko}.md` | | lablup#1118 | lablup#1108 | `33322d66` | `1118-cli-dry-sequence-breakers-20260814.{en,ko}.md` | | lablup#1121 | lablup#1110 | `f0bf3a2c` | `1121-utils-used-by-annotations-20260814.{en,ko}.md` | Each report was written from the merged diff (`git show <commit>`) and the linked issue body, not from the PR description alone. Each records at least one thing the issue did not contain. ## Findings recorded in the reports **lablup#1121 (issue lablup#1110).** The issue was wrong on a load-bearing point. It recorded `create_causal_mask` as carrying no `Used by:` annotation. It carried one, and that annotation named Llama, Mixtral, Gemma, Cohere, Phi, GLM4, StarCoder2 and OLMo among its users while grep at that commit shows `mixtral.rs`, `phi.rs`, `phi3small.rs`, `starcoder2.rs`, `llama3.rs`, `gemma.rs`, `gemma2.rs`, `cohere.rs`, `glm4.rs`, `olmoe.rs` and `qwen3_moe.rs` each calling it zero times. Those families moved to the implicit-causal fused-SDPA path (`mask: None` when `seq_len > 1`). The PR therefore replaced a misleading roster rather than adding a missing one, which is a stronger defect than the issue described: a missing annotation sends a contributor to look, a wrong one tells them not to. Measured counts at that commit: 44 non-test callers under `src/models` (the issue's 46 counted `diffusion_gemma/tests.rs` and `phi3small_tests.rs`), 55 across all of `src`. **lablup#1119 (issue lablup#1104).** All six variable defaults were traced to their definition sites rather than to the issue text. Two out-of-scope defects are recorded rather than fixed: `docs/turbo-kv-cache.md` around lines 298 to 312 still carries the same pre-lablup#899 "not a server knob" framing this PR corrected in `environment-variables.md`, and in `src/execution/memory_estimate.rs` the `Err(_)` arm of `resolve_paged_slab_blocks` warns "using the derived slab size" and then returns `None`, which keeps the 32-block pool default instead, so the warning describes behavior that does not happen. **lablup#1118 (issue lablup#1108).** The issue was reframed away from a flag-parity feature request into a docs fix after investigation showed the CLI omits nine server sampling knobs, not one. The change is comment-and-help-text only, 13 added lines all matching `^\s*(///|//)`. The second `dry_multiplier` field in `src/main.rs` belongs to `ServeArgs`, which already exposes `--dry-sequence-breakers` sixteen lines below, so it was deliberately left alone. ## Notes `TECHNICAL_REPORTS/` is listed in `.gitignore` but is tracked through the `TECHNICAL_REPORTS/.keep-reports` marker, so the six files were staged with `git add -f`. ## Test plan - [x] `git status --porcelain` shows exactly the six intended files staged and nothing else - [x] Every claim in each report checked against the merged commit: caller counts re-run with `git grep` at `f0bf3a2c`, variable defaults re-read at their definition sites, diffstats taken from `git show --stat` - [x] No build, test, lint, or format surface involved: the diff is six new Markdown files under `TECHNICAL_REPORTS/`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/environment-variables.mdwas missing six paged-decode v2 variables that are read from Rust, and itsMLXCEL_PAGED_ATTENTION_NATIVErow still asserted "not a server knob" even though issue #899 made that variable's force-off values the server's v2 decode kill switch. This adds the six variables with defaults read from the code and rewrites the stale row. Docs only, no behavior change.What changed
docs/environment-variables.md:## Paged decode v2 variablessection (operator-facing, placed after the KV cache section) withMLXCEL_PAGED_SLAB_BLOCKS,MLXCEL_PAGED_V2_MIN_KV_TOKENSandMLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST. Its lead-in namesMLXCEL_PAGED_ATTENTION_NATIVEas the kill switch and cross-linksdocs/CONTINUOUS_BATCHING.md#seeing-which-path-ranfor the dispatch policy and per-outcome log lines rather than duplicating that prose.## Hardware and kernel diagnostic variables, each marked Diagnostic:MLXCEL_PAGED_ATTENTION_V2,MLXCEL_PAGED_DECODE_V2_CHUNKandMLXCEL_PAGED_DECODE_V2_TARGET_CTAS.MLXCEL_PAGED_ATTENTION_NATIVErow now describes both consumers, matchingresolve_dispatch_decisionandresolve_paged_v2_dispatchinsrc/lib/mlxcel-core/src/layers.rs, and keeps the perf(core): wire the pooled paged-attention decode entry point into the scheduler or retire it #710 library-only retirement as history rather than as the current statement. Its Default cell now covers the server floors as well as the library selector's regime.Defaults were read from the code, not from the issue:
MLXCEL_PAGED_ATTENTION_V2paged_v2/mod.rs(V2_ENV,parse_v2_enabled)MLXCEL_PAGED_DECODE_V2_CHUNKautotune/ops/paged_decode_v2_chunk.rs(CHUNK_ENV)MLXCEL_PAGED_DECODE_V2_TARGET_CTASgpu_core_count * 8floored at 64, else 512paged_v2/plan.rs(device_target_ctas)MLXCEL_PAGED_SLAB_BLOCKSceil(per_slot_ctx / block_size) * batch, floored at the 32-block pool default, capped at the per-layer budget shareexecution/memory_estimate.rs(resolve_paged_slab_blocks),cache/paged.rs(POOL_SLAB_BLOCKS = 32)MLXCEL_PAGED_V2_MIN_KV_TOKENS4096paged_v2/dispatch.rs(MIN_SINGLE_REQUEST_KV_TOKENS)MLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST512paged_v2/dispatch.rs(MIN_BATCHED_KV_TOKENS_PER_REQUEST)One correction against the issue's wording: an unparseable
MLXCEL_PAGED_SLAB_BLOCKSwarns and then leaves the 32-block pool default in place, taking the sameNonepath as0, even though the in-code warning text says "using the derived slab size". The row documents the behavior, not the warning.Test plan
python3 scripts/ci/check_cross_repo_refs.pypassesgit diff --statisdocs/environment-variables.mdonlyNot touched, and deliberately so:
README.mdanddocs/CONTINUOUS_BATCHING.mdalready state the correct behavior, and the reference page is what disagreed with them.docs/turbo-kv-cache.mdlines 298 and 309 carry the same pre-#899 "library-only" framing and are worth a separate follow-up.Closes #1104