Skip to content

docs: Inkling 2 Mini on Apple silicon (exploratory MLX record) + scheduling RSI lessons - #544

Merged
Dong1017 merged 11 commits into
InferMatrixLab:mainfrom
zuiho-kai:docs/inkling2-mini-apple-silicon
Nov 21, 2026
Merged

Dong1017 merged 11 commits into
InferMatrixLab:mainfrom
zuiho-kai:docs/inkling2-mini-apple-silicon

Conversation

@zuiho-kai

@zuiho-kai zuiho-kai commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Adds an exploratory on-device record for a looped MoE model on Apple silicon, four InferRSI-style search rounds on it, and the method lessons of two earlier scheduling campaigns of the same RSI line. Nothing here is a performance claim: there is no acceptance issue, nothing claims PASS, and the speed figures are labelled exploratory / unverified per the public performance claim rules in docs/contributing.md.

1. docs/inkling2-mini-apple-silicon.md (new): Inkling 2 Mini on one M5 Max (128 GB), exploratory record.

  • Bring-up: the ModelOpt NVFP4/MXFP8 release does not load in Apple runtimes; MLX via Add Inkling 2 Mini model ml-explore/mlx-lm#2086 and llama.cpp main both run community conversions.
  • Default-against-default route comparison, one runtime at a time; raw outputs in examples/inkling2_mini_mlx/route/.
  • Four search rounds on MLX. The round tables can be recomputed from the committed rounds/r*/ records; evolve and holdout are both reported as exploratory data (no record that the candidate was fixed before holdout was read). Mechanism (step time, graph building, op count) is measured separately from the speed screen.
  • Limits: one machine, single stream, short prompts, quality = token identity on four prompts; llama.cpp at defaults; no acceptance issue or independent rerun.

2. docs/scheduling-rsi-lessons.md (new): inherited method lessons. Campaign figures come from an unpublished ledger and are marked unverified; no headline number.

3. docs/apple-silicon-playbook.md: new "Bringing up a new model" rows (labelled exploratory / unverified). README.md: "Field lessons" link line.

4. examples/inkling2_mini_mlx/ (new): benchmark scripts, the round runner, the mechanism probe, the op counter, all candidates of rounds 1–4, the records they wrote, and the raw route comparison outputs. rsi_mlx.py marks incomplete runs (error, fewer pairs than --reps, failed revert) INCONCLUSIVE, requires equal token length and ids, and prints "speed screen passed, pending mechanism check" instead of a final verdict. CPU regression test: tests/test_inkling2_mlx_round_scoring.py.

External package. The round-4 candidate is also packaged outside this repository: https://github.com/zuiho-kai/inkling2-mlx-fastpath

No knowledge-model-policy protected, policy or generated path is touched (tools/knowledge_declaration_paths.py: all lists empty except other paths).

AI authorship: drafted by Claude Code (claude-opus-5-5); search candidates written by the same agent from the model source; not yet reviewed by a human.

🤖 Generated with Claude Code

zuiho-kai and others added 5 commits November 21, 2026 15:44
…iction)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-21T06:44:43.303419Z
We couldn’t complete this review. Comment @codex review to try again.
7aa1112 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Dong1017
Dong1017 previously approved these changes Nov 21, 2026

@Dong1017 Dong1017 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PR review verdict — PASS
Reviewed base 9466bc8 and head 7aa1112 (full diff, complete). There is no formal review and no outstanding CHANGES_REQUESTED on this head, so this Approve is the first independent review. I read this as a Dong-bot (authorized delegate) review.

Scope. This is a docs and examples change: README link row, a new "Bringing up a new model" section in the Apple silicon playbook, two new docs (inkling2-mini-apple-silicon.md, scheduling-rsi-lessons.md), and examples/inkling2_mini_mlx/ (scripts and round records). It touches no inferrsi package code.

Claims policy. Both new pages say up front that they are maintainer measurements with no acceptance issue and are not an InferRSI PASS. Rows are labelled measured / public / ledger / inferred, and the unpublished-log limits are stated. I found nothing that over-claims against the contributing-evidence rules.

What I checked against the committed records

  • Round 1. I recomputed the adjacent-paired ratios from r1/log-evolve.jsonl, using the README's rule that default run 1+3k+i precedes repetition i of candidate k. They are gates 1.031, MoE 1.015, gates+MoE 1.048 and residual 1.012. These match the doc. The doc's 1.053 all-runs-median figure matches score-evolve.json. The drift from 47.4 to 48.9 tok/s matches dec_all (47.45 → 48.87).
  • Round 2. The medians of the paired arrays match every table cell, for example winner evolve 1.0677 (doc 1.068) and holdout 1.064 with (1.068, 1.064, 1.060). Noise values of 2.3% (evolve) and 3.9% (holdout) match noise_range. All candidates show same_output: true.
  • Mechanism. The two-process averages in mechanism.txt match the doc: 22.07 → 20.94 ms per step and build time 3.89 → 3.34 ms. The doc's "about half" attribution to CPU graph construction is right (0.55 of 1.13 ms). mechanism.py uses 60 steps with a 10-step warm-up, which gives the "median of 50 steps".
  • Playbook rows. The new rows are consistent with the same data: per-module compiles at 1–3%, the 6.4% held-out figure, and the 1.048 → 1.053 inflation.
  • Gates. The 5% no-conclusion rule, evolve/holdout split, token-identity gate and adjacent pairing in rsi_mlx.py match the gates the doc says were frozen. The doc also lists what was not established (one machine, single stream, short prompts, no upstream or server test).
  • Candidates. The winning candidate path named in the doc, rounds/r2/cands/r2d_fused_half_gates.py, exists in the diff.

Non-blocking follow-ups

  1. r1/score-evolve.json still carries the old-scorer verdict for c3_compile_gates_moe ("留" at 1.053), while the doc says every round-1 candidate was below 5% and "no conclusion". The README explains that the round-1 records predate adjacent pairing. One more sentence would help: the committed verdict strings and speedup there are from the superseded scorer. The Chinese verdict strings in the records also differ from the English ones rsi_mlx.py now prints.
  2. The README now links docs/h3-metal-apple-silicon-lessons.md. It is not in this diff, so please confirm it exists on main and the link does not 404.
  3. The route-comparison numbers (MLX 47.0 / 1,677 tok/s against llama.cpp 41.7 / 998) and the Campaign 1/2 ledger figures are not reproducible from the repository. The docs label this honestly, but I cannot verify them.

Not verified here. I did not run any script, MLX, llama.cpp or the simulators. I did not check CI status, the external links (mlx-lm#2086, the HF repos, vllm-evolve#1), the model facts, or the macOS build string. Delegation and two-approval merge eligibility are for the integrator to confirm.


Posted by Dong-bot, an automated agent acting on behalf of @Dong1017 (always-on-bot, model claude-sonnet-5-5).

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

首次独立检视:9466bc8d910c9fef55d4a9e23ee1a82950280c30…7aa11120db6e9bec7ae4ab3464b6fbddf03a4d8a。结论针对本 PR 新增的评测脚本和公开文档,不是对 Inkling 加速结果作验收。无上一轮意见。

  1. 不完整的对照会被判为 keep。 examples/inkling2_mini_mlx/rsi_mlx.py:69–90 捕获异常并保存 err,但最终只检查有没有速度数据,不检查 err 或配对数。三轮中若第一轮 token 一致且快 6%,第二轮中断,现有逻辑仍能用第一轮给出 keep。请保留原始样本和错误,但只有无错误、达到 --reps、完成回滚且逐样本质量门通过的候选才可进入打分判定;不完整样本应标为 INCONCLUSIVE。建议加一个「第一对成功、第二对抛错」的 CPU 回归用例。
  2. 区分脚本的速度筛选和文档宣称的结论。 docs/inkling2-mini-apple-silicon.md 把机制证据列为「better」的必要条件,但 rsi_mlx.py 仅看 token 和速比就写 keep,不读取 mechanism.py 的证据。请将自动输出改为明确的「速度筛选通过,待机制验证」,或把机制证据纳入最终判定。两篇文档的公开数字也应分别链接能支撑对应范围的验收/证据(尤其是只见未公开 ledger 的调度数字),或明确标为未验证的探索记录而非已建立的性能收益。这里只验证了提交内可复算的部分。

已核对: 阅读 27 个变更文件的差异及仓库证据规则;从提交内记录独立重算了两轮邻接配对中位数。R1 最佳约 1.048,R2 胜出候选的 holdout 约 1.064,与正文一致;这不能独立核对 token 原始序列或硬件行为。没有重跑 M5 Max、llama.cpp、Ascend NPU 或调度模拟。

@Dong1017 Dong1017 added the kind:docs Documentation and template delivery label Nov 21, 2026

Copy link
Copy Markdown
Collaborator

首次完整检视:9466bc8d910c9fef55d4a9e23ee1a82950280c30…7aa11120db6e9bec7ae4ab3464b6fbddf03a4d8a。结论针对本 PR 的文档与 examples/inkling2_mini_mlx 脚本,不是对 Inkling 加速或调度战役作验收。

已从提交内记录独立复算,与正文一致:

  • Round 1 邻接配对中位数:gates 1.031、MoE 1.015、residual 1.012、gates+MoE 1.048;score-evolve.json 里的 1.053 /「留」来自旧的全默认中位数计分;默认路径 47.45→48.87 tok/s 与正文 47.4→48.9 一致。
  • Round 2 各格配对中位数及 noise 2.3% / 3.9% 均匹配;胜出候选 holdout 1.064(1.068, 1.064, 1.060),记录均为 same_output: true。
  • mechanism.txt 两进程平均 22.07→20.94 ms/step、graph building 3.89→3.34 ms,与正文一致。
  • README 所链 docs/h3-metal-apple-silicon-lessons.md 在当前 main 上存在。
    未重跑 MLX、llama.cpp 或调度模拟,也无法核验 token 原始序列,以及未入库的路线对比 / ledger 数字。

同意 @zengchuang-hw 在 #544 (review) 的两点,因此本轮不 Approve。

  1. 不完整对照仍可得到 keep。 examples/inkling2_mini_mlx/rsi_mlx.py 在 except 里保存 err 后,最终只要存在 dec_med 就按 paired 中位数出 verdict,既不检查 err,也不要求 len(paired) == --reps。若第一对 token 一致且快 6%、后续中断,仍会被标为 keep。这与正文写明的「每候选 3 对」不符,也与 contributing 中「不完整比较证据为 INCONCLUSIVE」一致。请只在无错误、跑满 --reps、revert 成功且质量门通过时进入打分;否则记 INCONCLUSIVE 并保留 err 和已有样本。另:质量门用 zip(r, ref_ids) 比较 token ids,长度不同时只比公共前缀,请改为长度也必须一致。建议补一个不依赖 MLX 的回归用例,覆盖「第一对成功、第二对抛错」。

  2. 脚本 keep 与文档「better 需机制证据」不一致;ledger 公开数字的证据范围需收紧。 正文把机制信号列为冻结门,但 rsi_mlx.py 只看 token 与速比就写 keep,并不读取 mechanism.py。请把自动输出改为「速度筛选通过,待机制验证」,或把机制证据纳入最终判定。另外,README 已把两篇新文档放进 Field lessons:Inkling 的 6.4% 可从本 PR 记录复算,但路线对比(MLX 47.0 / 1,677 vs llama.cpp 41.7 / 998)和调度战役的 4.61× 等数字只在未公开 ledger / maintainer logs。虽已声明不是 InferRSI PASS、并标注 measured/ledger,按 contributing 的公开性能声称规则,请为这些数字分别链到能支撑对应范围的证据,或明确标为未验证的探索记录,而不是已建立的性能收益。

非阻塞:r1/score-evolve.json 仍保留旧计分器的「留」/1.053,README 已说明 Round 1 记录早于邻接配对;建议再写一句,明确其中的 verdict / speedup 来自已被取代的计分器。

CI 观察(不归因为本 PR 的 diff):Ready lane full-check 在 3.10 与 3.11 上失败(https://github.com/InferMatrixLab/InferRSI/actions/runs/44876994163),`tests/test_project_explanation.py:508` test_recovered_attempt_does_not_trust_a_rewritable_declaration 报 DID NOT RAISE KeyboardInterrupt。该测试与 harness 代码不在本 PR 变更中,基线 9466bc8d 刚合入 #457;该 commit 的 merge lane 为 success(通常是 smoke,不是完整 full-check)。合入前仍需 ready lane 变绿。Ruff、declarations 及其他已完成检查为 success。Codex 评论是用量上限导致的 review failed,不是代码发现。

zuiho-kai and others added 2 commits November 21, 2026 16:18
…n-identical

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zuiho-kai zuiho-kai changed the title docs: Inkling 2 Mini on Apple silicon (MLX vs llama.cpp, one RSI round) and inherited scheduling RSI lessons docs: Inkling 2 Mini on Apple silicon (1.49x MLX decode, token-identical) + scheduling RSI lessons Nov 21, 2026

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

增量:7aa11120db6e9bec7ae4ab3464b6fbddf03a4d8a..fc17889e1adf1f065813b9f77bca6786ecf801ec,2 个提交、24 个文件。上一轮检视。

  • 原有判定缺陷未修复。 R3/R4 增加了候选、记录和单步机制测量,但没有改动共用的 examples/inkling2_mini_mlx/rsi_mlx.py。它仍能在配对未达到 --reps 或记录了 err 时输出 keep;它也不读取机制记录。批准前请让未完成的试验输出 INCONCLUSIVE,并区分「速度筛选通过」与满足机制门后的最终判定。
  • 新增的 1.491× 需要明确证据边界。 三组相邻配对可从 rounds/r4/score-holdout.json 复算为 1.462 / 1.491 / 1.515,机制记录也与正文的单步耗时相符;这支持对已提交样本的描述,不等于验收。对公开性能结论,请按仓库规则关联验收 Issue 和可复核证据(固定版本、配置及原始产物),或把量化结论从公开标题中移除,保留明确标为未验证的探索经验。调度仿真的旧结论也仍只有未公开账本。
  • 非阻塞建议: 写明最终候选是在查看留出集之前,基于 evolve 的结果和预先约定的 5% 规则选定的;若这一点没有记录,就把两组结果都描述为探索数据。批量门控在 evolve 的记录里数值略高,但差距不到 5%,不应称任一版本为确定最快。

本轮独立阅读了新增路径、记录和文档,复算了配对结果,核对了已提交的单步计时;未运行 Metal/MLX 硬件复测、逐 token 复验或调度仿真。

Copy link
Copy Markdown
Collaborator

增量检视:7aa11120db6e9bec7ae4ab3464b6fbddf03a4d8a…fc17889e1adf1f065813b9f77bca6786ecf801ec(2 个提交、24 个文件)。结论仍针对本 PR 的文档与 examples/inkling2_mini_mlx 记录,不是对 Inkling 加速作验收。上一轮评论。

已从本轮提交记录独立复算,与正文一致:

  • Round 3 各格邻接配对中位数及 noise 9.1% / 6.8% 均匹配(evolve/holdout:1.290/1.290、1.354/1.353、1.430/1.419、1.424/1.396、1.375/1.392);记录均为 same_output: true、err: null。
  • Round 4 胜出候选 holdout 1.491(1.462, 1.491, 1.515),evolve 1.486;r4c 为 1.516 / 1.501;noise 12.2% / 9.2%。
  • rounds/r4/mechanism.txt 两进程平均:step (22.17+22.05)/2 → (15.28+15.28)/2,即 22.11 → 15.28 ms;graph building (3.94+3.91)/2 → (1.75+1.79)/2,即 3.925 → 1.77 ms;non-view ops 7,624 → 3,664。与正文 22.1 → 15.3、3.9 → 1.8、7,624 → 3,664 一致。
    未重跑 MLX / Metal,也无法核验 token 原始序列。

上一轮两点仍未解决:本轮未改 examples/inkling2_mini_mlx/rsi_mlx.py。同意 @zengchuang-hw 在 #544 (review) 的判断,因此本轮不 Approve。

  1. 不完整对照仍可得到 keep。 rsi_mlx.py 在 except 里保存 err 后,只要已有 dec_med 就按 paired 中位数出 verdict,既不检查 err,也不要求 len(paired) == --reps。若第一对 token 一致且快 6%、后续中断,仍会被标为 keep。请只在无错误、跑满 --reps、revert 成功且质量门通过时进入打分;否则记 INCONCLUSIVE 并保留 err 和已有样本。建议补一个不依赖 MLX 的回归用例,覆盖「第一对成功、第二对抛错」。

  2. 脚本 keep 与文档「better 需机制证据」不一致;1.491× 的公开数字证据范围需收紧。 正文仍把机制信号列为冻结门,但 rsi_mlx.py 只看 token 与速比就写 keep,不读取 mechanism.py / count_ops2.py。请把自动输出改为「速度筛选通过,待机制验证」,或把机制证据纳入最终判定。本轮把 1.491× 写进了标题、导语和 playbook(标注 measured),并链接了外部包装仓库;提交内记录支持对已提交样本的描述,但不等于验收。路线对比与调度战役数字仍只在未公开 ledger。按 contributing 的公开性能声称规则,请为这些数字分别链到能支撑对应范围的验收/证据,或把量化结论从公开标题中撤回,明确标为未验证的探索记录。

非阻塞:

  • Round 3 正文突出的是 r3c(holdout 1.419),但 Round 4 的基线是 r3e 全选项(holdout 原 1.392,本轮重跑 1.409)。r3e 在 evolve 上相对 r3c 为 1.375 vs 1.430,差距未超过 5%。请写明最终候选是在查看 holdout 之前、按预先约定的 5% 规则从 evolve 选定的;若没有该记录,请把两组结果都描述为探索数据。r4c 在 evolve/holdout 上数值略高(1.516 / 1.501),正文已正确写明与 shipped 候选差距不到 5%、不作确定最快。
  • 上一轮提到的 r1/score-evolve.json 旧计分器「留」/1.053 说明,若尚未补上一句,可一并写上。

CI:Ready lane full-check(3.10 / 3.11)在本 head 上仍在进行(https://github.com/InferMatrixLab/InferRSI/actions/runs/44879725872)。其余已完成检查(declarations、installed-package、pr-references、dashboard-browser、host-compatibility advisory)为 success。上一轮看到的 test_recovered_attempt_does_not_trust_a_rewritable_declaration 失败不在本 PR 变更中;合入前仍需 ready lane 变绿。

…nly a screen

- A candidate with an error, fewer than --reps pairs or a failed revert
  gets verdict INCONCLUSIVE; its error and samples stay in the record.
- Token gate compares length as well as ids (zip compared a prefix only).
- A complete, token-identical win >=5% now prints
  "speed screen passed, pending mechanism check" instead of "keep";
  the mechanism gate (mechanism.py, count_ops2.py) is separate.
- Scoring moved into functions with MLX imported inside main(), so it is
  testable on CPU; tests/test_inkling2_mlx_round_scoring.py covers
  first pair ok / second pair raises, a complete win, and a shorter
  output with an equal prefix.

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

增量:fc17889e1adf1f065813b9f77bca6786ecf801ec..e29c2cfdc15b23fb290fd760f79109449272e628,2 个文件。上一轮检视。部分配对不再给 keep,完整配对也只输出速度筛选结果,机制验证单列;这两点已修复。

仍可污染后续基线。 rsi_mlx.py 在 mod.apply(model) 返回后才把 reverted 设为 False。如果 apply() 修改模型后抛错,清理会被跳过,结果还会写成 reverted=True。实际 R4 _fast.apply() 就是在替换 DecoderLayer.__call__ 后才执行 _fuse_msg()。此外,真正的 revert() 失败后,主循环仍会把下一次测量当成默认路径。请在调用 apply() 前标记状态可能已变,在部分失败时也尝试恢复;不能确认恢复时,保留失败记录并停止本轮,或重建干净基线后再继续。请覆盖这两种异常路径。

文档证据边界未改。 R4 留出组的 1.491× 是逐对比值的中位数;已提交的两臂绝对中位数约为 45.0 → 66.6 tok/s,不是标题的 47 → 70。请分开表述,或明确后者只是估算;公开量化结论仍需可复核证据和对应验收 Issue,否则保留为明确未验证的探索记录。

在隔离环境执行了变更中的 3 个 CPU 测试,均通过;另外用两个最小替身独立复现部分 apply 失败和 rollback 失败。未重跑 MLX/Metal 或调度模拟。

Per the public performance claim rules in docs/contributing.md:
- Inkling page: drop the quantitative claims from title and lead; state that
  it is an exploratory record without an acceptance issue; link raw route
  comparison outputs (examples/inkling2_mini_mlx/route/); describe the
  scorer's speed screen vs the separate mechanism gate; note the committed
  verdict strings (keep / 留, round-1 1.053) are from superseded scorers;
  report evolve and holdout as exploratory data (no record that the
  candidate was fixed before holdout was read).
- Scheduling lessons: remove the 4.61x headline; ledger figures unverified.
- Playbook and README rows labelled exploratory / unverified.
@zuiho-kai zuiho-kai changed the title docs: Inkling 2 Mini on Apple silicon (1.49x MLX decode, token-identical) + scheduling RSI lessons docs: Inkling 2 Mini on Apple silicon (exploratory MLX record) + scheduling RSI lessons Nov 21, 2026
@zuiho-kai

Copy link
Copy Markdown
Contributor Author

@zengchuang-hw @amy-why-3459 感谢两轮检视。按意见改了两个提交:e29c2cfd(脚本判定 + CPU 回归用例)、f229ed59(文档证据边界)。逐条回复:

1. 不完整对照会被判为 keep(两位的第 1 点) —— e29c2cfd

  • examples/inkling2_mini_mlx/rsi_mlx.py:配对逻辑拆成 pair_candidate(),判定拆成 score()。有 err、len(paired) != --reps、或回滚没成功的候选,一律 INCONCLUSIVE;err、已有的 paired 和样本照样写进记录。中途出错时,如果候选还没回滚,会先尝试回滚;回滚也失败,原因会追加到 err。
  • 质量门:新的 same_ids() 先比每个 prompt 的长度,再比 token ids,不再用 zip 只比公共前缀。
  • 回归用例 tests/test_inkling2_mlx_round_scoring.py,不依赖 MLX,MLX 的 import 已挪进 main()。覆盖三种情况:
    • 第一对成功、第二对抛错 → INCONCLUSIVE,并保留 err 和第一对样本;
    • 跑满且 token 一致 → 只给速度筛选结论;
    • 前缀相同但长度更短 → output changed: rejected。
  • 本地 pytest tests/test_inkling2_mlx_round_scoring.py:3 passed;ruff check 通过。

2. 脚本 keep 与文档「better 需机制证据」不一致(两位的第 2 点前半) —— e29c2cfd + f229ed59

  • 脚本在跑满、token 一致、提升 ≥5% 时,输出改为 speed screen passed, pending mechanism check,不再输出 keep。机制门(mechanism.py / count_ops2.py)单独测,正文和 examples README 都写明了这一点。
  • 已提交的 score-*.json 里保留的旧 verdict 字符串(keep,第一轮的「留」)在正文和 README 里注明来自已被取代的计分器。这些记录是冻结的原始产物,没有改写。

3. 公开数字的证据边界(两位的第 2 点后半;1.491×、路线对比、调度 4.61×) —— f229ed59

  • Inkling 页:标题改为 "…four exploratory RSI rounds",导语撤掉所有量化结论。开头写明:这是未验证的探索记录,不是性能声称,没有验收 Issue,不是 InferRSI PASS。轮次数字可以从已提交的 rounds/r*/ 复算;其余 measured 行只有未公开日志,按未验证处理。
  • 路线对比:原始输出入库到 examples/inkling2_mini_mlx/route/,包括 mlx_lm.benchmark 日志、llama-bench JSON(含 build 418fe97 和全部参数,本地路径已脱敏)、逐次 chat 计时。正文写明这是默认参数对默认参数的一次探索比较,不是运行时排名。
  • 调度页:去掉 4.61× 的加粗导语。开头写明战役数字来自未公开 ledger、未验证,只作方法经验;ledger 标签的定义加上 unverified。
  • Playbook 新增行标为 exploratory / unverified;README 的 Field lessons 一行标为 exploratory, unverified。
  • PR 标题和描述去掉了 1.49x。

4. 非阻塞

  • 候选选定与 holdout:每轮的 evolve 和 holdout 在同一个会话里跑完。没有记录能证明最终候选是在看 holdout 之前、按 evolve 和 5% 规则定下的,所以正文按建议把两组都写成探索数据("Selection and holdout" 段)。
  • r1/score-evolve.json 的「留」/1.053:Round 1 段落补了一句,说明它来自已被取代的全默认中位数计分器,配对数字取代了它。

CI:full-check 的失败是基线问题,与本 PR 无关

  • 失败的只有 tests/test_project_explanation.py::test_recovered_attempt_does_not_trust_a_rewritable_declaration(DID NOT RAISE KeyboardInterrupt,第 508 行)。run 44879725872 的 3.10 和 3.11 都是 1 failed, 5895 passed。
  • 在干净的 main(9466bc8d,harness: explain gains with profile evidence and paired statistics #457 合入点)上,Python 3.11、pip install -e ".[dev]",单跑这条测试,同样失败、报错相同。本 PR 没有改 harness,也没有改这个测试文件。
  • 所以本 PR 不改这条测试。新 head f229ed59 的 ready lane 已重新排队;如果除这一条外都绿,这条需要在 main 上另外修。

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

增量:e29c2cfdc15b23fb290fd760f79109449272e628..f229ed596617402f2c151b74fcc3f9e9625fe27b,1 个提交、10 个文档及记录文件。上一轮检视。

文档已移除把 47 → 70 tok/s 等同于留出组结果的标题,明确两组提示都是探索数据,并补了路线对比的原始记录。正文的证据范围比上一版清楚。

批准前仍须修复评分器的回滚路径。本提交没有改动 rsi_mlx.py:apply() 部分成功后抛错仍会跳过恢复,revert() 失败后仍会继续测后续候选。上轮两项 CPU 复现仍适用于未变的实现。请先确保部分应用也能清理;无法恢复时停止或重建基线,避免把被修改的路径当作默认对照。

另请把 route/mlx-chat.jsonl 的原始模型文本与前三行计时 JSON 分开,或将混合文件改成 .log 并更新说明;逐行校验显示第 4 行起不是有效 JSONL。已核对新增路线计时记录和文档口径,未重跑 MLX/Metal 或调度模拟。

Copy link
Copy Markdown
Collaborator

增量检视:fc17889e1adf1f065813b9f77bca6786ecf801ec…f229ed596617402f2c151b74fcc3f9e9625fe27b(2 个提交、12 个文件)。上一轮评论。结论仍针对本 PR 的文档与 examples/inkling2_mini_mlx 脚本,不是对 Inkling 加速作验收。

上一轮两点已修好:

  1. rsi_mlx.py 的 score() 在有 err、len(paired) != --reps 或回滚失败时输出 INCONCLUSIVE;same_ids() 要求长度与 token ids 都一致。tests/test_inkling2_mlx_round_scoring.py 覆盖了「第一对成功、第二对抛错」、完整加速只给速度筛选、以及前缀相同但更短被拒绝。
  2. 速度胜出改为 speed screen passed, pending mechanism check;正文与 examples README 标明机制门单独测量。文档已撤掉把 47 → 70 / 1.49x 当作验收结论的标题与导语,路线对比补了 examples/inkling2_mini_mlx/route/ 原始输出,调度页数字标为未验证探索记录。没有「先看 evolve 再看 holdout」的选定记录,正文已按建议把两组都写成探索数据;r1/score-evolve.json 的「留」/1.053 也补了说明。

同意 @zengchuang-hw 在 #544 (review) 的判断,因此本轮不 Approve。

  1. 回滚路径仍可能污染后续基线。 examples/inkling2_mini_mlx/rsi_mlx.py 的 pair_candidate() 在 mod.apply(model) 返回后才把 reverted 设为 False。若 apply() 已改模型再抛错,reverted 仍为 True,except 里不会尝试 revert(),记录也会写成已回滚。另外,即使本候选因 revert() 失败被标为 INCONCLUSIVE,main() 仍会继续测下一个候选,并把下一次 run_once({}) 当作默认路径。请在调用 apply() 前就标记模型可能已变;部分失败时也尝试恢复;不能确认恢复时停止本轮或重建干净基线后再继续,并补上这两条异常路径的 CPU 用例。

  2. examples/inkling2_mini_mlx/route/mlx-chat.jsonl 从第 4 行起不是有效 JSONL。 前三行是计时 JSON,随后是 ----- 输出 ----- 和模型思考/回复文本。请把原始模型输出与计时记录分开,或改成 .log 并更新文档说明。

非阻塞:README 的 Field lessons 整行(含已有的 Apple silicon playbook 与 h3-metal lessons)都被标成 exploratory, unverified。苤只想限定本 PR 新增的两篇,建议把标签写到那两篇链接上,避免扩大到既有文档。

CI:当前 head 的 Ready lane full-check(3.10 / 3.11)仍在进行(https://github.com/InferMatrixLab/InferRSI/actions/runs/44885328359)。作者称该失败在干净的 main 9466bc8d 上也能复现、且不在本 PR 变更中;合入前仍需 ready lane 结论明确。未重跑 MLX/Metal 或调度模拟。

…; stop the round on an unconfirmed revert

- pair_candidate() sets reverted=False before calling apply(), so an apply()
  that changes the model and then raises is still reverted.
- run_round() stops the round when a revert is not confirmed, so later default
  runs are not taken from a possibly changed model.
- Two CPU tests for these paths.
- route/mlx-chat.jsonl keeps only the timing records; the model output moves to
  route/mlx-chat-output.txt. Docs updated.
- README: the exploratory label is on the two new pages only.
@zuiho-kai

Copy link
Copy Markdown
Contributor Author

@amy-why-3459 @zengchuang-hw 按 #544 (comment) 改完,新提交 e6a6c03:

  1. 回滚路径(examples/inkling2_mini_mlx/rsi_mlx.py)

    • pair_candidate() 在调用 mod.apply(model) 之前就把 reverted 设成 False;apply() 改了模型再抛错时,except 里会尝试 revert(),记录不再写成已回滚。
    • 新增 run_round(),main() 改为调用它:某个候选回滚没能确认(reverted 为 False)时,记一条 stopped 事件并停止本轮,不再测后面的候选,也不再把之后的 run_once({}) 当默认路径;提示重新加载模型后再继续。
    • tests/test_inkling2_mlx_round_scoring.py 补两条 CPU 用例:apply() 改模型后抛错 → 调了 revert()、判 INCONCLUSIVE;revert() 失败 → 本轮在该候选处停止,后一个候选没被 apply,之后没有默认路径运行。本地 pytest -q tests/test_inkling2_mlx_round_scoring.py:5 passed(旧代码下第一条新用例会失败)。
  2. route/mlx-chat.jsonl:只留前三行计时 JSON,每行都能被 json.loads 解析;----- 输出 ----- 之后的模型输出原样移到 route/mlx-chat-output.txt。examples/inkling2_mini_mlx/README.md 和 docs/inkling2-mini-apple-silicon.md 已同步说明。llama-chat.jsonl 也核过,全部是有效 JSONL。

非阻塞:README 的 Field lessons 去掉整行标签,只在本 PR 新增的两篇(Inkling 2 Mini on Apple silicon、Scheduling RSI lessons)链接后标 (exploratory, unverified),已有的 playbook 和 h3-metal lessons 不受影响。

CI:上一个 head f229ed5 的 ready lane(https://github.com/InferMatrixLab/InferRSI/actions/runs/44885328359)`full-check (3.10)和(3.11)都是1 failed, 5898 passed,失败的都是同一条 test_recovered_attempt_does_not_trust_a_rewritable_declaration,和之前说的一样,干净 main` 9466bc8 本地也能复现,本 PR 没碰它。其余 job 全绿。新 head 的 CI 跑完后再补一句结果。

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NO PASS

增量:f229ed596617402f2c151b74fcc3f9e9625fe27b..e6a6c03eba9b3838e3a2e7223cdac68ba6e4d543,7 个文件。上一轮检视的两项已修:部分 apply() 失败会尝试恢复,无法确认恢复会在下一次基线测量前停止;MLX 计时 JSONL 和模型输出已拆开。未发现新的代码阻塞。

剩余是公开文档的证据要求。新版已经标为探索性,这是正确的;但 docs/scheduling-rsi-lessons.md 导语仍公开给出仅来自未公开账本的 4.61×,playbook 也仍发布数值总结。按 AGENTS.md 的数字发布规则,审批前请关联相应验收 Issue 和可核证据,或将没有验收依据的公开数字总结删去,保留方法、失败模式等定性经验。这个要求不是让本 PR 重跑硬件。

我在隔离目录执行了新增文件中的 5 个 CPU 测试,全部通过,mlx-chat.jsonl 的 3 条计时记录也均可解析。未重跑 MLX/Metal 或调度模拟。

…test line length

AGENTS.md (Issues and claims, Research lock): no published numbers without an
acceptance issue. Removed every speed, latency, memory, hit-rate, capacity
and speedup figure from the Inkling page, the scheduling lessons and the
playbook rows; kept method and failure lessons. Raw records under
examples/inkling2_mini_mlx/rounds and route stay as unverified artifacts.
Wrap a test line over the 100-column ruff limit.

Copy link
Copy Markdown
Collaborator

增量检视:f229ed596617402f2c151b74fcc3f9e9625fe27b…e6a6c03eba9b3838e3a2e7223cdac68ba6e4d543(1 个提交、7 个文件)。上一轮评论。结论仍针对本 PR 的文档与 examples/inkling2_mini_mlx 脚本,不是对 Inkling 加速或调度战役作验收。

上一轮两点已修好:

  1. pair_candidate() 在调用 apply() 前就把 reverted 设为 False,apply() 中途抛错时会尝试 revert();新增 run_round(),无法确认回滚时停止本轮,不再把后续 run_once({}) 当作默认路径。tests/test_inkling2_mlx_round_scoring.py 也覆盖了这两条路径。
  2. route/mlx-chat.jsonl 只保留 3 行计时 JSON,模型输出已移到 route/mlx-chat-output.txt,文档说明已同步。

非阻塞:README 的 Field lessons 已把 (exploratory, unverified) 只标在本 PR 新增的两篇链接上。

本轮不 Approve。

  1. 本提交引入了 ruff E501,Ready lane 在 lint 步骤失败。 tests/test_inkling2_mlx_round_scoring.py:99 行长 114(限制 100):results = rsi.run_round([("bad", bad), ("good", good)], None, run_once, [sample(40.0)], REF, 3, events.append)。Ready lane https://github.com/InferMatrixLab/InferRSI/actions/runs/44886871680 的 full-check (3.10) 与 (3.11) 都在 Ruff 步骤失败,后续 Tests 被跳过。这与上一 head 上那个不在本 PR 变更中的 test_recovered_attempt_does_not_trust_a_rewritable_declaration 失败不是同一件事。请将该行折行后重新跑 ruff check src tests tools。

  2. 当前 head 上 @zengchuang-hw 的 NO PASS 尚未被回应。 我同意其中关于调度页的部分仍构成阻塞:docs/scheduling-rsi-lessons.md 导语和表格仍公开给出仅来自未公开 ledger、无法从本仓库复算的 4.61× 等数字。虽然已标明 unverified exploration record、无 acceptance issue、不是 InferRSI PASS,按 AGENTS.md「Open or update an acceptance issue before claiming PASS (or publishing numbers)」以及 contributing 的公开性能声称规则,合入前请为这些数字关联验收 Issue 和可核验证据,或从公开导语/数字总结中撤下,只保留方法与失败模式等定性经验。playbook「Bringing up a new model」里的 48 tok/s / 6.4% / 1.49× 可从本 PR 已提交记录复算,且已标明 exploratory / unverified;上一轮我已把这种标注视为对 Inkling 数字的可接受处理。是否也要按同一条规则撤回,请一并明确。

未重跑 MLX/Metal 或调度模拟。因 ruff 失败,本 head 的 Ready lane 也尚未跑到测试。

@zengchuang-hw zengchuang-hw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PASS

增量检视:e6a6c03eba9b3838e3a2e7223cdac68ba6e4d543 → 655c3dc8268278d115585494dc7e4279b50457c8(1 个提交、4 个文件)。上轮检视的剩余阻塞已解决:三份文档移除了未经验收的量化性能总结,只保留注明未验证的定性经验和实验方法;原始探索记录和旧评分并未作为已验收结果对外宣称。此前的回滚保护和 JSONL 分离未被改动。

独立核对了三份文档与测试的差异,并执行了当前提交的 5 个 CPU 用例,全部通过。未运行 MLX/Metal 或调度实验,未看 CI。本批准只针对文档和样例改动,不是性能结论或合入判断。

@amy-why-3459 amy-why-3459 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PR review verdict — PASS
Reviewed base e6a6c03 and head 655c3dc (PR base 9466bc8). Incremental review of 1 commit, 4 files. This Approve covers the docs and examples changes, not a performance acceptance or merge decision.

上一轮评论 的两点已修好:

  1. tests/test_inkling2_mlx_round_scoring.py 原先超长的 run_round(...) 调用已折行,最长行 93 列(限制 100)。Ready lane https://github.com/InferMatrixLab/InferRSI/actions/runs/44889531592 的 full-check (3.10) 与 (3.11) 的 Ruff 步骤均已 success,正在跑 Tests。
  2. docs/scheduling-rsi-lessons.md 已撤下未公开 ledger 中的 4.61× 等容量/时延/命中率数字,只保留方法与失败模式;docs/inkling2-mini-apple-silicon.md 与 playbook 新增的「Bringing up a new model」行也不再发布速度、时延、显存或加速比总结,原始记录仍留在 examples/inkling2_mini_mlx/rounds 与 route/。此前的回滚路径与 JSONL 拆分未被改动。

当前 head 上 @zengchuang-hw 的 Approve 已覆盖其先前 NO PASS;未发现未解决的 CHANGES_REQUESTED 或针对本 head 的阻塞意见。未重跑 MLX/Metal 或调度实验。

@zuiho-kai

Copy link
Copy Markdown
Contributor Author

@zengchuang-hw @amy-why-3459 按 #544 (review) 这一轮(剩余:没有验收依据的公开数字),新提交 655c3dc8:

1. 删掉所有没有验收依据的公开数字(依据 AGENTS.md 的 Issues and claims / Research lock 两节)

  • docs/scheduling-rsi-lessons.md:导语不再给 4.61×,改成说明本页不发布容量、延迟、命中率和倍数,只保留方法和失败模式。两个战役表里的倍数、百分比、TTFT 秒数、命中率、花费全部删掉,每行只留定性观察(例如「按缓存占比排序优于按绝对节省」「均值达标点明显高于每次都达标点」「pin 之后 LRU 和 Belady 差距几乎消失」)和对应做法。gates 第 6 条 system1-omni 的例子也去掉了数字。
  • docs/inkling2-mini-apple-silicon.md:导语写明本页不发布速度、延迟、内存和倍数。路线对比表删掉,只留命令和「本次比较中 MLX 在前,所以搜索用 MLX」。Round 1–4 的配对比、噪声、ms 计时、op 数和表格删掉,改成每轮「试了什么、学到什么」。数值只留在 rounds/r*/ 和 route/ 这两类原始记录里,作为未验证产物,正文不再汇总。
  • docs/apple-silicon-playbook.md(回答 @amy-why-3459 在 docs: Inkling 2 Mini on Apple silicon (exploratory MLX record) + scheduling RSI lessons #544 (comment) 里问的:playbook 数字要不要也撤):按同一条规则一起撤了。两行新经验去掉 48 tok/s、1–3%、6.4%、1.49×、7,624→3,664、47.4→48.9、1.048→1.053,只留做法,写明 "No speedup is claimed",来源标为 measured, unverified。这样 playbook 和两篇新文档的口径一致;可复算的数值仍在 rounds/r*/ 原始记录里。
  • 全量搜过:对本 PR 所有非原始记录的改动文件(git diff origin/main 去掉 rounds/、route/),按 ×、x、tok/s、%、ms、µs、req/s、USD、带小数的秒和 GB、speedup、faster 逐个 grep。剩下的只有三类,都不是性能结论:
    • 冻结门槛的定义("below 5%: no conclusion"、"score = median paired ratio of decode tok/s");
    • 脚本代码和注释里的字段名(speedup、打印 tok/s);
    • 测试里的假数据(44.0 vs 40.0)。
    • 另外保留了模型和硬件事实(参数量、层数、权重文件大小、128 GB),这些不是性能数字。PR 描述里也没有数字。

2. CI 上的 Ruff 失败(上一个 head e6a6c03e)

  • 是我们的问题:tests/test_inkling2_mlx_round_scoring.py 有一行超过 100 列(E501)。已折行。
  • 推送前已按 ready lane 的步骤在本地跑过:ruff check src tests tools(.[dev] 装的同版本 ruff 0.17.6)→ All checks passed;pytest tests/test_inkling2_mlx_round_scoring.py → 5 passed;全量 pytest -rs 结果见下。
  • 全量 pytest -rs:以 Linux 上的 ready lane 为准(run 44889531592,正在跑),出结果后补在这里。本地 macOS 跑全量会因为平台差异(APFS 文件名、进程组)挂一批与本 PR 无关的用例,本 PR 也不改 src/ 和 tools/。
  • 失败的那条 test_project_explanation.py::test_recovered_attempt_does_not_trust_a_rewritable_declaration 在干净的 main(9466bc8d)上也同样失败,不在本 PR 改动里。

@zuiho-kai

Copy link
Copy Markdown
Contributor Author

补上 655c3dc8 的 ready lane 结果(https://github.com/InferMatrixLab/InferRSI/actions/runs/44889531592):

  • full-check (3.10) 和 (3.11):两边 Ruff 都是 All checks passed;测试都是 1 failed, 5900 passed。唯一的失败是 tests/test_project_explanation.py::test_recovered_attempt_does_not_trust_a_rewritable_declaration(DID NOT RAISE KeyboardInterrupt)。这条用例在干净的 main 9466bc8d 上同样失败,不在本 PR 的改动里。
  • 其余检查(declarations、installed-package 3.10/3.11、pr-references、dashboard-browser、host-compatibility macOS/Windows、knowledge-model-policy)全部通过。

@zuiho-kai

Copy link
Copy Markdown
Contributor Author

关于 ready lane 上唯一剩下的失败(tests/test_project_explanation.py::test_recovered_attempt_does_not_trust_a_rewritable_declaration,DID NOT RAISE KeyboardInterrupt),查到了它在 main 上失败的原因,供维护者参考。本 PR 不改这个文件。

  • 原因:该测试第 497 行 from inferrsi.infra.artifacts import digest,而 inferrsi.infra 包在当前 main(9466bc8d)上已经不存在,digest 现在在 inferrsi.harness.artifact_primitives。这句 import 写在测试替身 forge_then_crash 里面,抛出的 ModuleNotFoundError 被 harness/optimization.py 的 evaluate_round() 中 except Exception 接住,当成协调器错误正常收尾,所以后面的 raise KeyboardInterrupt(...) 根本没执行到。
  • 修法(一行):把这句改成 from inferrsi.harness.artifact_primitives import digest。
  • 验证:在干净的 main 9466bc8d 上只改这一行,Python 3.11 跑 pytest tests/test_project_explanation.py → 33 passed;不改时这一条失败,报错与 CI 相同。

这条在 main 上修掉后,本 PR 更新分支即可让 ready lane 变绿。需要的话我们也可以另提一个只含这一行的 PR。

@Dong1017
Dong1017 merged commit 91addd9 into InferMatrixLab:main Nov 21, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:docs Documentation and template delivery

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants