Skip to content

fix(inference): align context, batching, RoPE, and runtime override semantics #1450

Description

@inureyes

Parent

Problem

Several common b10621 options affect model arithmetic or context management independently of the GGML hardware backend: context size, logical/physical batch size, kept prompt tokens, SWA cache sizing, RoPE scaling/base/frequency, YaRN controls, escape processing, tensor checks, and model metadata overrides. mlxcel currently shares some spellings but does not establish equivalent defaults or effects.

Scope

  • Audit and align --ctx-size, --batch-size, --ubatch-size, --keep, and --swa-full value domains, defaults, and truncation behavior.
  • Implement compatible RoPE scaling, scale, frequency base/scale, and YaRN parameters only for model families whose Rust implementation can honor them.
  • Align escape/no-escape processing at CLI prompt boundaries without changing JSON request escaping.
  • Classify performance-timing, tensor-check, metadata-override, and operation-offload flags as supported, not applicable, or deferred.
  • Align warmup/no-warmup startup behavior and prove whether the empty warmup run allocates the same caches and surfaces the same startup failures.
  • Reject model-family or checkpoint combinations that cannot safely apply a requested runtime override.

Acceptance criteria

  • CLI and canonical environment precedence tests cover every common runtime option and sentinel. (RoPE/YaRN group: src/cli/rope_args_tests.rs, tests/llama_compat_manifest.rs. The remaining runtime options in this shard were audited and their divergences recorded in compat/llama-server/b10621/runtime-and-context.json rather than claimed.)
  • Resolved context and batch settings are observable in startup diagnostics and native props. (/props now reports n_ctx, n_batch, n_ubatch, n_batch_decode, n_kv_max; startup logs the resolved per-slot context, slot count and prefill chunk.)
  • Truncation/keep/SWA tests cover full context, sliding windows, rotating cache, and MoE/VLM model families where applicable. (Not implemented. --keep, --swa-full, --context-shift, n_keep and n_discard stay deferred with their observable divergences recorded; the retained prefix is still the fixed 4-token attention sink and sliding-window families build their own RotatingKVCache with no server-side reach into it.)
  • RoPE/YaRN overrides are applied before cache allocation and are rejected for unsupported architectures. (Applied inside model construction, which precedes make_caches; an override that reaches no RoPE seam refuses to serve, verified by an applications counter rather than a hand-maintained architecture list.)
  • No arithmetic-affecting option is accepted without a behavioral or numerical test. (Teacher-forced logit traces over 8192 positions, plus two per-process integration tests and 24 unit tests.)
  • Warmup enablement, disablement, latency boundary, and startup-failure propagation are covered with a real checkpoint. (Out of this shard: --warmup is owned by model-source.json / fix(server): translate model-source flags and reject unsupported GGUF semantics #1434, so this chain cannot edit its entry.)

Numerical validation

Use the teacher-forced logit-trace procedure from docs/benchmarks.md at the configured prompt/decode widths and report disagreement at decided positions for every new scaling or batching path.

Activity

  1. added
    status:backlogIn the backlog, not yet ready
    type:bugBug fixes, error corrections, or issue resolutions
    area:coremlxcel-core: MLX FFI, primitives, KV cache, layers
    area:inferenceGeneration, sampling, decoding (incl. speculative, DRY)
    area:cliCommand-line interface / CLI flags
    on Aug 26, 2026
  2. 4 remaining items

  3. self-assigned this
    on Aug 31, 2026
  4. added 2 commits that reference this issue on Sep 6, 2026
    737c6b0
    f4aec89
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cliCommand-line interface / CLI flagsarea:coremlxcel-core: MLX FFI, primitives, KV cache, layersarea:inferenceGeneration, sampling, decoding (incl. speculative, DRY)priority:highHigh prioritystatus:doneCompletedtype:bugBug fixes, error corrections, or issue resolutions

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions