Skip to content

docs: environment-variables.md omits six paged-decode v2 knobs and its MLXCEL_PAGED_ATTENTION_NATIVE row wrongly says "not a server knob" #1104

Closed

Description

@rapsealk

Summary

docs/environment-variables.md claims to be the index for MLXCEL_* variables, but six paged-decode v2 variables that are read from Rust are missing from it, and the one paged-attention row that is present, MLXCEL_PAGED_ATTENTION_NATIVE, still describes itself as "not a server knob" even though it is now the server's v2 decode kill switch. An operator reading the reference page to find the v2 kill switch is told the variable does not apply to them, while README.md and docs/CONTINUOUS_BATCHING.md tell them it does.

Background

The page intro (lines 1-4) states its scope: MLXCEL_* variables affecting runtime, server, downloader, build, and diagnostic behavior.

Six variables are read in Rust but absent from the page:

Variable Read at
MLXCEL_PAGED_ATTENTION_V2 src/lib/mlxcel-core/src/paged_v2/mod.rs:116 (V2_ENV)
MLXCEL_PAGED_DECODE_V2_CHUNK src/lib/mlxcel-core/src/autotune/ops/paged_decode_v2_chunk.rs:60
MLXCEL_PAGED_DECODE_V2_TARGET_CTAS src/lib/mlxcel-core/src/paged_v2/plan.rs:60
MLXCEL_PAGED_SLAB_BLOCKS src/execution/memory_estimate.rs:950
MLXCEL_PAGED_V2_MIN_KV_TOKENS src/lib/mlxcel-core/src/paged_v2/dispatch.rs:108
MLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST src/lib/mlxcel-core/src/paged_v2/dispatch.rs:111

The last three are documented as operator-facing knobs in docs/CONTINUOUS_BATCHING.md, and a sibling knob MLXCEL_CASCADE_ATTENTION from the same feature area is listed on the reference page (line 222), so the omission looks like drift rather than a deliberate withholding.

The stale row: docs/environment-variables.md:258 ends the MLXCEL_PAGED_ATTENTION_NATIVE entry by calling it "not a server knob" (a control for external mlxcel-core consumers and examples/paged_attention_kernel_bench.rs, per #710). But src/lib/mlxcel-core/src/layers.rs:4443-4457 documents two consumers, including the server's pool-backed batched paged decode, and notes that issue #899 made the fused v2 kernel the production decode path and named this variable's force-off values as its kill switch. README.md:17 and docs/CONTINUOUS_BATCHING.md:294 both describe MLXCEL_PAGED_ATTENTION_NATIVE=0 as a server-side gather-path restore.

Proposed Solution

  1. Rewrite the tail of the MLXCEL_PAGED_ATTENTION_NATIVE row to describe both consumers, keeping the perf(core): wire the pooled paged-attention decode entry point into the scheduler or retire it #710 library-only note as history rather than as the current statement. layers.rs:4443-4457 is the accurate source.
  2. Add the six missing variables. MLXCEL_PAGED_SLAB_BLOCKS, MLXCEL_PAGED_V2_MIN_KV_TOKENS and MLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST belong under an operator-facing heading with their defaults; MLXCEL_PAGED_ATTENTION_V2, MLXCEL_PAGED_DECODE_V2_CHUNK and MLXCEL_PAGED_DECODE_V2_TARGET_CTAS belong under "Hardware and kernel diagnostic variables" and should be marked diagnostic.
  3. Cross-link to docs/CONTINUOUS_BATCHING.md rather than duplicating its prose.

Implementation Notes

  • Verify the current defaults from the code, not from this issue; floors move.
  • A follow-up worth filing separately: a CI check that diffs MLXCEL_* occurrences in src/**/*.rs against the table in docs/environment-variables.md, modeled on scripts/ci/check_kernel_dtype_keys.py. That is a larger change than this issue.

Acceptance Criteria

  • All six variables appear with values, default, and a one-line note.
  • The MLXCEL_PAGED_ATTENTION_NATIVE row no longer asserts "not a server knob".
  • README.md:17, docs/CONTINUOUS_BATCHING.md:294 and the reference page agree.
  • No behavior change; docs only.

Original Suggestion

Title: docs: environment-variables.md omits the paged-decode v2 knobs and its MLXCEL_PAGED_ATTENTION_NATIVE row still says "not a server knob"

Problem / Background

docs/environment-variables.md:1-4 states its scope:

This page documents the MLXCEL_* environment variables that affect mlxcel
runtime, server, downloader, build, and diagnostic behavior.

Six paged-decode variables that are read from Rust are absent from it:

Variable Read at Documented in
MLXCEL_PAGED_ATTENTION_V2 src/lib/mlxcel-core/src/paged_v2/mod.rs:116 (V2_ENV) docs/adr/0001 only
MLXCEL_PAGED_DECODE_V2_CHUNK src/lib/mlxcel-core/src/paged_v2/ —
MLXCEL_PAGED_DECODE_V2_TARGET_CTAS src/lib/mlxcel-core/src/paged_v2/ —
MLXCEL_PAGED_SLAB_BLOCKS pool sizing docs/CONTINUOUS_BATCHING.md:~310
MLXCEL_PAGED_V2_MIN_KV_TOKENS dispatch floor docs/CONTINUOUS_BATCHING.md:298
MLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST dispatch floor docs/CONTINUOUS_BATCHING.md:299

The last three are documented as operator-facing knobs in CONTINUOUS_BATCHING.md, so
this is not a case of internal-only variables being deliberately withheld: the page that
claims to be the index for them just does not list them. MLXCEL_CASCADE_ATTENTION, a
sibling knob from the same feature area, is listed (docs/environment-variables.md:222),
which makes the omission look like drift rather than policy.

The stale row

Worse than the omissions, the row that is there is now wrong.
docs/environment-variables.md:258 ends with:

#710 retired this entry point to a library-only API: it is not on the mlxcel serve
decode path (which dispatches through the separate
DecodeBatchContext::use_native_paged_kernel block-table kernel), so this variable is
a control for external mlxcel-core consumers and examples/paged_attention_kernel_bench.rs,
not a server knob.

Issue #899 made the fused v2 kernel the production decode path and gave this variable a
second consumer. src/lib/mlxcel-core/src/layers.rs:4443-4457:

/// Two consumers:
///
/// - The library-only [`paged_decode_attention_pooled`] entry point (ADR 0001
///   #710), through [`resolve_dispatch_decision`]. Unchanged.
/// - The server's pool-backed batched paged decode, through
///   [`resolve_paged_v2_dispatch`]. Issue #899 made the fused v2 kernel the
///   production path for that decode, and named this variable's force-off
///   values (`0` / `false` / `off` / `no`) as its kill switch: setting it
///   restores the pre-#899 gather-then-SDPA behaviour end to end.

Two other documents already describe it as a server knob:

  • README.md:17 — "Set MLXCEL_PAGED_ATTENTION_NATIVE=0 to restore the gather path."
  • docs/CONTINUOUS_BATCHING.md:294 — "MLXCEL_PAGED_ATTENTION_NATIVE=0 is the kill switch.

So an operator who reads the reference page to find the v2 kill switch is told the
variable does not apply to them, while the README tells them it does.

Proposed solution

  1. Rewrite the tail of the MLXCEL_PAGED_ATTENTION_NATIVE row to describe both consumers,
    keeping the perf(core): wire the pooled paged-attention decode entry point into the scheduler or retire it #710 library-only note as history rather than as the current statement.
    layers.rs:4443-4457 is the accurate source.
  2. Add the six missing variables. MLXCEL_PAGED_SLAB_BLOCKS, MLXCEL_PAGED_V2_MIN_KV_TOKENS
    and MLXCEL_PAGED_V2_MIN_KV_TOKENS_PER_REQUEST belong under an operator-facing heading
    with their defaults (4096 and 512 per CONTINUOUS_BATCHING.md); MLXCEL_PAGED_ATTENTION_V2,
    MLXCEL_PAGED_DECODE_V2_CHUNK and MLXCEL_PAGED_DECODE_V2_TARGET_CTAS belong under
    "Hardware and kernel diagnostic variables" and should be marked diagnostic.
  3. Cross-link to docs/CONTINUOUS_BATCHING.md rather than duplicating its prose.

Acceptance criteria

  • All six variables appear with values, default, and a one-line note.
  • The MLXCEL_PAGED_ATTENTION_NATIVE row no longer asserts "not a server knob".
  • README.md:17, docs/CONTINUOUS_BATCHING.md:294 and the reference page agree.
  • No behavior change; docs only.

Technical considerations

Verify the current defaults from the code rather than from this issue; floors move.
A follow-up worth filing separately: a CI check that diffs MLXCEL_* occurrences in
src/**/*.rs against the table in docs/environment-variables.md, in the shape of
scripts/ci/check_kernel_dtype_keys.py. That would keep this from recurring; it is a
larger change than this issue.

Activity

  1. changed the title [-]docs: `environment-variables.md` omits the paged-decode v2 knobs and its `MLXCEL_PAGED_ATTENTION_NATIVE` row still says "not a server knob"[/-] [+]docs: `environment-variables.md` omits six paged-decode v2 knobs and its `MLXCEL_PAGED_ATTENTION_NATIVE` row wrongly says "not a server knob"[/+] on Aug 12, 2026
  2. added
    status:ready
    type:docs
    priority:medium
    status:in-progress
    status:review
    status:done
    and removed
    status:ready
    status:in-progress
    status:review
    on Aug 12, 2026
  3. added a commit that references this issue on Aug 20, 2026
    cf4e22c
  4. added 2 commits that reference this issue on Oct 27, 2026
    cd9fd69
    61cc702
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:mediumstatus:donetype:docs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions