Skip to content

Flash Next (Metal/HIP), LFM2, Kolibri-1: refuse a config that asks for scaled RoPE (#2562) - #2604

Merged
ashhart merged 1 commit into
ashhart:mainfrom
jschmied:rope-refusals
Nov 9, 2026
Merged

ashhart merged 1 commit into
ashhart:mainfrom
jschmied:rope-refusals

Conversation

@jschmied

@jschmied jschmied commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

These three config readers accepted a config.json that asks for YaRN and then ran plain RoPE (#2562). Each one now
refuses it and names the key, the way qwen3/config.zig:54 does. A config is refused when rope_parameters.rope_type
(or .type) is anything but default, or when rope_scaling is set (any value but null). transformers reads a legacy
rope_scaling as the config's rope_parameters, so both forms mean YaRN there.

  • Flash Next, Metal and HIP (flashnext/config.zig): the old rope_parameters type check moves into scaledRope,
    which also checks rope_scaling. Both keys fail with error.UnsupportedFlashRope as before, and a warn line now
    names the key. Metal Flash Next still gets its YaRN factor from --context (window_config.zig). That path never
    reads the config, so it is unchanged. CUDA already refuses both keys in cuda_config.zig:189, and this PR leaves it
    alone. The CUDA --vision check (native/flashnext_images.zig:99) also calls this reader, but the CUDA config
    check has already refused those configs by then.
  • LFM2 (lfm2/config.zig): two more lines in refusal(), worded like the other checks: "a
    rope_parameters.rope_type other than default (the kernels run plain RoPE)" and "a rope_scaling (the kernels run
    plain RoPE)".
  • Kolibri-1 (kolibri1/config.zig): error.UnsupportedRope, with the key in Why.

Every config these readers accept today parses to the same theta and rotary dims. Nothing in the forward changes.

Checks on this head

  • Head commit: cca2abc, replayed on main b558c18 with the release note reworded. Its code diff is identical to
    0a1fb90, where the checks below ran.

  • Lean checker, python3 tools/zig/lean_check.py, on the base and on this head: 398 on the base (8be9c40), 398 on
    this head, 0 new.

  • Tests run, with the command and pass, fail and skip counts: x86_64 host: zig build -Dfixed-cpu test test-golden test-kernel-contract test-server-security test-pull-security fuzz-cortheon: 632/635 steps, 3413 passed, 42 skipped, 2 failed. The two failures are
    drama_voice_tool cleanup tests, because that run was root, which ignores chmod 500. Both pass on the GB10 run
    below as a normal user. zig build check-native-cuda-host compile-cuda-tests: 16/16 steps. zig build hip-host-test test-flashnext-rope-host -Dhip=true: 69/69. python3 tools/pr_check.py: 0 errors (1 advisory warning: pass --pr).. GB10 (aarch64): zig build test test-cuda-host -Dnvcc: 609/609 steps, 7127 passed, 49 skipped, 0 failed. zig build test-flashnext-rope-host test-kolibri-host test-lfm2-load-host: 38 passed, 3 skipped,
    0 failed. zig fmt --check build.zig zig and git diff --check: clean.
    New tests:

    • Flash Next (flashnext/rope_refusal_test.zig, new step test-flashnext-rope-host, part of zig build test on
      every host): the pinned public config, alone and with "rope_scaling": null, keeps rope_theta 1e7 and
      rotary_dim 64. YaRN x4 in rope_parameters and in rope_scaling is refused.
    • LFM2 (lfm2/config.zig): the d1 config with rope_scaling: null, with type for rope_type, and with a bare
      rope_theta in place of rope_parameters keeps theta 1e6 and head dim 64. YaRN in either form is refused with
      the text above.
    • Kolibri-1 (kolibri1/config.zig): the pinned config, and the same config with a default rope_parameters and a
      null rope_scaling, keep theta 1e4 and head dim 128. YaRN in either form is refused, and the reason names the key.

    Each new refusal test fails when its refusal is removed in a scratch copy: Flash Next 1 test fails, Kolibri-1 1,
    LFM2 1 (the refusal-list test).

  • CI: green on this head (cca2abc), merge state clean.

  • Mac (Apple M-series, 36 GB), on 24d98d9 (same code as this head) against main 8be9c40: zig build test-flashnext-rope-host test-flashnext-host:
    45/45 steps, 229 passed, 1 skipped. zig build test: 762/762 steps, 11474 passed, 91 skipped, 0 failed. Load of a
    directory with the real Flash Next MLX 4bit-MTP config.json, tokenizer and index but no weights (so an accepted config
    stops at FileNotFound for the weights):

    config main branch
    plain accepted (FileNotFound) accepted (FileNotFound)
    YaRN in rope_parameters UnsupportedFlashRope, no key named UnsupportedFlashRope, warn names rope_parameters.rope_type
    YaRN in rope_scaling accepted (FileNotFound): the bug UnsupportedFlashRope, warn names rope_scaling
  • Not run, and why: no served run. The change only reads config.json and adds no compiled CUDA code. The host tests
    show that every config accepted before gives the same theta and dims. Metal Flash Next: the Mac run above covers the
    tests and config admission. A served Metal run is not possible there: the smallest Flash Next checkpoint (MLX
    4bit-MTP) is 105.5 GiB against 36 GB. HIP: host checks
    only (zig build hip-host-test -Dhip=true), no AMD GPU. Kolibri-1 and LFM2 d1: no checkpoint on this machine.

Receipt

  • Main against branch: n/a for served output (see above). The parse results are pinned by the host tests.
  • Boxes it reaches: config admission in flashnext/config.zig (Metal, HIP, and the CUDA --vision check),
    lfm2/config.zig, kolibri1/config.zig.
  • New switch? None.
  • Environment: TensorFold cca2abc on main b558c18; Zig 0.17.0; one NVIDIA GB10 (aarch64) and an x86_64 host.
  • Paths and platforms the change reaches, which I ran and which I could not: host tests on aarch64 and x86_64. Metal host tests and config admission on a Mac. Not
    run: Metal, HIP and CUDA serving, for the reasons above.
  • Exactness: accepted configs give the same theta and rotary dims (host tests). No forward code changes.
  • Decode speed before and after: n/a (only config parsing at load).
  • Prompt speed before and after: n/a.
  • Licence of any new weights or drafter: n/a.

Checklist

  • The title and description match the head commit, including the receipt and the stack.
  • New tests fail before the change, pass after it, and skip cleanly without their dependency.
  • Comments and docstrings are one line. No measurements or history in the source.
  • No personal data, machine names, internal hosts or local paths in the diff or its commits. No AI attribution lines.

@jschmied
jschmied force-pushed the rope-refusals branch 2 times, most recently from 24d98d9 to 9b7d193 Compare November 8, 2026 20:21
@ashhart

ashhart commented Nov 8, 2026

Copy link
Copy Markdown
Owner

@jschmied, the code matches the refusal-first scope agreed in #2562. Both config forms are covered in all three readers, null scaling remains accepted, and the accepted theta and rotary-dimension calculations are unchanged. The Metal factor selected by --context is unchanged too. The host checks pass, and removing either refusal makes the corresponding tests fail.

Please tighten the release note: Flash Next already rejected a non-default rope_parameters type; its newly refused case is legacy rope_scaling. LFM2 and Kolibri-1 newly reject both forms. With that wording corrected, the conflicting release-note hunk resolved and current-head CI checked, I have no implementation change request. The shared reader can stay a separate follow-up.

@jschmied

jschmied commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

@ashhart thanks. Release note reworded: Flash Next on Metal and HIP newly refuses a legacy rope_scaling (a non-default rope_parameters type already was); LFM2 and Kolibri-1 newly refuse both forms. The branch is replayed on main b558c1870, the CHANGELOG line was the only conflict, and the code diff is unchanged. CI was green on b946cfc64 (same code and note, one main commit older) and is running on the head cca2abca0. The shared reader stays a follow-up after #2563.

…aders

A config.json whose rope_parameters names a type other than default, or that
sets rope_scaling (YaRN in either form), loaded and ran plain RoPE. Each reader
now refuses it and names the key, as qwen3/config.zig does. Configs accepted
before keep their theta and rotary dims. Metal Flash Next still takes its YaRN
factor from --context.

Refs ashhart#2562
@ashhart
ashhart merged commit abc39af into ashhart:main Nov 9, 2026
15 of 20 checks passed
@ashhart

ashhart commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Thank you @jschmied. This is merged into main with your commits under your own name, so you're listed as a TensorFold contributor. It ships in the next release, credited to you in the changelog and the release notes.

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.

2 participants