Repository navigation
Flash Next (Metal/HIP), LFM2, Kolibri-1: refuse a config that asks for scaled RoPE (#2562) - #2604
Conversation
24d98d9 to
9b7d193
Compare
|
@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 Please tighten the release note: Flash Next already rejected a non-default |
f6c1611 to
b946cfc
Compare
b946cfc to
cca2abc
Compare
|
@ashhart thanks. Release note reworded: Flash Next on Metal and HIP newly refuses a legacy |
…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
cca2abc to
4af6a60
Compare
|
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. |
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:54does. A config is refused whenrope_parameters.rope_type(or
.type) is anything butdefault, or whenrope_scalingis set (any value but null). transformers reads a legacyrope_scalingas the config'srope_parameters, so both forms mean YaRN there.flashnext/config.zig): the oldrope_parameterstype check moves intoscaledRope,which also checks
rope_scaling. Both keys fail witherror.UnsupportedFlashRopeas before, and a warn line nownames the key. Metal Flash Next still gets its YaRN factor from
--context(window_config.zig). That path neverreads the config, so it is unchanged. CUDA already refuses both keys in
cuda_config.zig:189, and this PR leaves italone. The CUDA
--visioncheck (native/flashnext_images.zig:99) also calls this reader, but the CUDA configcheck has already refused those configs by then.
lfm2/config.zig): two more lines inrefusal(), worded like the other checks: "arope_parameters.rope_type other than default (the kernels run plain RoPE)" and "a rope_scaling (the kernels run
plain RoPE)".
kolibri1/config.zig):error.UnsupportedRope, with the key inWhy.Every config these readers accept today parses to the same theta and rotary dims. Nothing in the forward changes.
atc overlap --json: run on this head,complete: false(its pull-file limits). Every overlap it lists (95 open PRs, oneshared file each) is the CHANGELOG's top lines. A file search of the open PRs finds none that touch the four code files. Against today's
main (bf39c2c) only the CHANGELOG's Unreleased lines conflict. Replayed on main b558c18 after the review; the CHANGELOG line was the only conflict.
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 onthis 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 aredrama_voice_toolcleanup tests, because that run was root, which ignoreschmod 500. Both pass on the GB10 runbelow 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 zigandgit diff --check: clean.New tests:
flashnext/rope_refusal_test.zig, new steptest-flashnext-rope-host, part ofzig build testonevery host): the pinned public config, alone and with
"rope_scaling": null, keepsrope_theta1e7 androtary_dim64. YaRN x4 inrope_parametersand inrope_scalingis refused.lfm2/config.zig): the d1 config withrope_scaling: null, withtypeforrope_type, and with a barerope_thetain place ofrope_parameterskeeps theta 1e6 and head dim 64. YaRN in either form is refused withthe text above.
kolibri1/config.zig): the pinned config, and the same config with a defaultrope_parametersand anull
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 adirectory 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):
rope_parametersrope_parameters.rope_typerope_scalingrope_scalingNot 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
flashnext/config.zig(Metal, HIP, and the CUDA--visioncheck),lfm2/config.zig,kolibri1/config.zig.run: Metal, HIP and CUDA serving, for the reasons above.
Checklist