Skip to content

docs(MoE): address review suggestions from PR #1542#1547

Merged
LetMeFly666 merged 3 commits into
feat/gh_pr_review_bot/add_moe_note_20260424from
feat/gh_pr_review_bot/address_review_moe_20260425
Apr 25, 2026
Merged

docs(MoE): address review suggestions from PR #1542#1547
LetMeFly666 merged 3 commits into
feat/gh_pr_review_bot/add_moe_note_20260424from
feat/gh_pr_review_bot/address_review_moe_20260425

Conversation

@gh-pr-review
Copy link
Copy Markdown
Contributor

@gh-pr-review gh-pr-review Bot commented Apr 25, 2026

Summary

基于 PR #1542 review #4175132766 的三条 P3 建议,对 MoE 小节做精细化打磨。本 PR 以 feat/gh_pr_review_bot/add_moe_note_20260424 为 base,仅包含针对 review 的增量修改。

Changes

# Review 建议 本 PR 应对
1 ASCII 图代码围栏缺语言标签(跨 review 的 P2,顺手带上) ``````text,关闭渲染器自动高亮
2 ASCII 路由示意图 ──►│ 的竖线与右侧框线 视觉重合,Expert 2 看起来像在边界上 重绘示意图:Router 箭头指向整框,专家各占一行,"被选中 / 未被选中"旁注分离,层次更清晰
3 Mixtral 8x7B 参数建议使用论文原始数字 约 47B / 约 13B约 46.7B / 约 12.9B
4 DeepSeek-V2 细粒度专家数量可补充 补全 160 个路由专家 + 2 个共享专家

对于 review 中剩余两条更开放的建议(Top-K 现状分化、Expert Parallelism 补充),评估后认为属于"后续扩展话题"而非本条知识点的必改项,本 PR 暂不处理,可在后续迭代章节时一并纳入。

Test plan

  • patch --dry-run 本地验证可干净应用
  • 合并后在 GitHub / Hexo 预览渲染,确认 ASCII 图不再被当代码高亮、对齐视觉无歧义
  • 检查 Markdown 表格、三级标题、文末维护日期均未被误动

- Add `text` language tag to ASCII diagram code fence (P2 → disable auto-highlight)
- Redraw ASCII routing diagram to avoid `│` / `┐` visual overlap on Expert 2
- Use Mixtral 8x7B paper-accurate params: 46.7B total / 12.9B activated (was ~47B / ~13B)
- Supplement DeepSeek-V2 fine-grained expert count: 160 routed + 2 shared
Expert N(未被选中,不激活)
```text
┌── Expert 1 ──┐
│ Expert 2 │ ← 被选中,参与计算
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Expert 2
Expert 3
往右移动一个空格

token → Router ──► │ Expert 3 │
│ ... │
└── Expert N ──┘ 未被选中,不激活
(选 Top-K)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

(选 Top-K) 往左移动一个空格

gh-pr-review Bot added 2 commits April 25, 2026 06:30
- Shift `Expert 2` / `Expert 3` right by one space inside the box for visual centering
- Shift `(选 Top-K)` left by one space to better align under the Router arrow
Fix accidental extra space introduced in previous commit so the left
box border `│` stays column-aligned across all expert rows.
@LetMeFly666
Copy link
Copy Markdown
Owner

@gh-pr-review
你能直接将feat/gh_pr_review_bot/address_review_moe_20260425分支新增的commit推送到feat/gh_pr_review_bot/add_moe_note_20260424分支吗?
不是文件修改,而是commit直推,从而实现直接merge

@LetMeFly666
Copy link
Copy Markdown
Owner

@gh-pr-review 在pr中引用回复下

Copy link
Copy Markdown
Contributor Author

@gh-pr-review gh-pr-review Bot left a comment

Choose a reason for hiding this comment

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

你能直接将 feat/gh_pr_review_bot/address_review_moe_20260425 分支新增的 commit 推送到 feat/gh_pr_review_bot/add_moe_note_20260424 分支吗?不是文件修改,而是 commit 直推,从而实现直接 merge。

坦率回答:当前工具链不能直接做到

原因

  • gh-pr-review 工具集仅提供 create_branch / create_commit / create_pr / submit_review 四个操作,未暴露 push / update-ref / fast-forward 接口
  • 等价 git push origin A:B 的操作需要 GitHub 的 PATCH /git/refs/heads/B 能力,当前 token 只开放了写 feat/gh_pr_review_bot/* 前缀分支,但仍缺 ref 更新入口。
  • 本地环境对目标仓库没有 git 推送权限(gh 未认证)。

可行替代方案

  1. 本地一条命令(推荐)address_review_moe_20260425 就是在 add_moe_note_20260424 顶上顺序提交的,完全可 fast-forward:

    git fetch origin feat/gh_pr_review_bot/address_review_moe_20260425
    git checkout feat/gh_pr_review_bot/add_moe_note_20260424
    git merge --ff-only origin/feat/gh_pr_review_bot/address_review_moe_20260425
    git push origin feat/gh_pr_review_bot/add_moe_note_20260424

    推完后 PR #1542 自动带上这些 commit,本 PR #1547 也会自动关闭(0 diff)。

  2. GitHub 页面直接 Merge 本 PR:因本 PR base 就是 add_moe_note_20260424,页面点 "Merge pull request"(fast-forward / rebase 模式)即可,无需本地。

  3. 工具兜底:把净变更以单个 diff 重新 commit 到 add_moe_note_20260424:这本质仍是"文件修改",不是真正的 commit 直推,但最终效果等价。如需此兜底,回复即执行。

建议用方案 1 或方案 2,最干净。

@LetMeFly666
Copy link
Copy Markdown
Owner

@gh-pr-review 选择rebase的话hash不会变吗

Copy link
Copy Markdown
Contributor Author

@gh-pr-review gh-pr-review Bot left a comment

Choose a reason for hiding this comment

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

@gh-pr-review 选择 rebase 的话 hash 不会变吗

会变。GitHub Web UI 的 "Rebase and merge" 即便在可 fast-forward 的场景下,也会重建 commit(committer 会被改成 GitHub,时间戳刷新),原 SHA 一定变。

三种合并方式对 hash 的影响:

合并方式 原 commit hash 附加 commit 备注
Create a merge commit ✅ 保留 多一个 merge commit 历史有分叉痕迹
Rebase and merge ❌ 全部重写 即使可 ff 也会重建
Squash and merge ❌ 合成一个新 commit 多个 commit 压扁

想保留原 hash 且线性历史,只有一条路:本地 git merge --ff-onlygit push。GitHub Web UI 没有"纯 fast-forward 合并"选项。

命令如前所述:

git fetch origin feat/gh_pr_review_bot/address_review_moe_20260425
git checkout feat/gh_pr_review_bot/add_moe_note_20260424
git merge --ff-only origin/feat/gh_pr_review_bot/address_review_moe_20260425
git push origin feat/gh_pr_review_bot/add_moe_note_20260424

如果 hash 是否保留不重要,只求省事 → Web UI "Rebase and merge" 即可,历史依然是线性的,只是 SHA 换了一批。

@LetMeFly666
Copy link
Copy Markdown
Owner

git fetch origin feat/gh_pr_review_bot/address_review_moe_20260425
git checkout feat/gh_pr_review_bot/add_moe_note_20260424
git merge --ff-only origin/feat/gh_pr_review_bot/address_review_moe_20260425
git push origin feat/gh_pr_review_bot/add_moe_note_20260424
remote: Enumerating objects: 26, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 20 (delta 15), reused 0 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (20/20), 7.93 KiB | 353.00 KiB/s, done.
From github.com:LetMeFly666/LeetCode
 * branch                feat/gh_pr_review_bot/address_review_moe_20260425 -> FETCH_HEAD
error: pathspec 'feat/gh_pr_review_bot/add_moe_note_20260424' did not match any file(s) known to git
merge: origin/feat/gh_pr_review_bot/address_review_moe_20260425 - not something we can merge
error: src refspec feat/gh_pr_review_bot/add_moe_note_20260424 does not match any
error: failed to push some refs to 'github.com:LetMeFly666/LeetCode.git'

Copy link
Copy Markdown
Contributor Author

@gh-pr-review gh-pr-review Bot left a comment

Choose a reason for hiding this comment

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

报错根因:本地既没有 feat/gh_pr_review_bot/add_moe_note_20260424 分支,也没 fetch 过它对应的 origin/... 引用。所以 git checkout 直接 pathspec fail,后续 merge / push 连锁失败。

修正命令(一次性 fetch 两个分支,再基于 remote 建本地分支):

git fetch origin feat/gh_pr_review_bot/add_moe_note_20260424 feat/gh_pr_review_bot/address_review_moe_20260425
git checkout -B feat/gh_pr_review_bot/add_moe_note_20260424 origin/feat/gh_pr_review_bot/add_moe_note_20260424
git merge --ff-only origin/feat/gh_pr_review_bot/address_review_moe_20260425
git push origin feat/gh_pr_review_bot/add_moe_note_20260424

要点:

  • L1:一次性 fetch 两个分支,确保 origin/... 两个 ref 都存在
  • L2-B 覆盖创建 / 重置本地分支并直接追踪 remote
  • L3--ff-only 保证不产生额外 merge commit,也不改写 hash
  • L4:推送后 PR #1542 自动携带这些 commit,本 PR #1547 因 0 diff 会自动关闭

git fetch 报 "couldn't find remote ref",先 git remote -v 确认 origin 指向 LetMeFly666/LeetCode

@LetMeFly666
Copy link
Copy Markdown
Owner

git fetch origin feat/gh_pr_review_bot/add_moe_note_20260424 feat/gh_pr_review_bot/address_review_moe_20260425
git checkout -B feat/gh_pr_review_bot/add_moe_note_20260424 origin/feat/gh_pr_review_bot/add_moe_note_20260424
git merge --ff-only origin/feat/gh_pr_review_bot/address_review_moe_20260425
git push origin feat/gh_pr_review_bot/add_moe_note_20260424
From github.com:LetMeFly666/LeetCode
 * branch                feat/gh_pr_review_bot/add_moe_note_20260424 -> FETCH_HEAD
 * branch                feat/gh_pr_review_bot/address_review_moe_20260425 -> FETCH_HEAD
fatal: 'origin/feat/gh_pr_review_bot/add_moe_note_20260424' is not a commit and a branch 'feat/gh_pr_review_bot/add_moe_note_20260424' cannot be created from it
merge: origin/feat/gh_pr_review_bot/address_review_moe_20260425 - not something we can merge
error: src refspec feat/gh_pr_review_bot/add_moe_note_20260424 does not match any
error: failed to push some refs to 'github.com:LetMeFly666/LeetCode.git'

有没有可能是

git fetch origin feat/gh_pr_review_bot/add_moe_note_20260424:feat/gh_pr_review_bot/address_review_moe_20260425

Copy link
Copy Markdown
Contributor Author

@gh-pr-review gh-pr-review Bot left a comment

Choose a reason for hiding this comment

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

新错误的根因是 Git 的一个经典坑:

git fetch origin <branch> 只会更新 FETCH_HEAD不会更新 refs/remotes/origin/<branch>

所以上一步看似 fetch 成功,origin/feat/.../add_moe_note_20260424 其实仍然不存在 → checkout -B ... origin/... 报 "is not a commit" → 后面连锁失败。

你猜的 fetch origin src:dst 方向是对的,但 dst 写成了另一个分支同名会把目标分支直接覆盖,语义不对。

正确做法(二选一)

方案 A — 推荐,最简单:不带分支参数,让 remote.origin.fetch 的通配 refspec 自动更新 origin/*

git fetch origin
git checkout -B feat/gh_pr_review_bot/add_moe_note_20260424 origin/feat/gh_pr_review_bot/add_moe_note_20260424
git merge --ff-only origin/feat/gh_pr_review_bot/address_review_moe_20260425
git push origin feat/gh_pr_review_bot/add_moe_note_20260424

方案 B — 显式写 refspec,把远端分支写入 refs/remotes/origin/*

git fetch origin \
  feat/gh_pr_review_bot/add_moe_note_20260424:refs/remotes/origin/feat/gh_pr_review_bot/add_moe_note_20260424 \
  feat/gh_pr_review_bot/address_review_moe_20260425:refs/remotes/origin/feat/gh_pr_review_bot/address_review_moe_20260425
# 然后同上 checkout / merge / push

为什么你写的 A:B 形式不行src:dst 中 dst 是"本地要写到的 ref",你把它写成了 feat/.../address_review_moe_20260425 这个本地分支名(而不是 refs/remotes/origin/...),结果是:把 remote 上的 add_moe_note_20260424 的内容强制写入你本地的 address_review_moe_20260425 分支,相当于覆盖/破坏它,不符合意图。

建议直接用方案 A。

@LetMeFly666
Copy link
Copy Markdown
Owner

新错误的根因是 Git 的一个经典坑:

git fetch origin <branch> 只会更新 FETCH_HEAD不会更新 refs/remotes/origin/<branch>

所以上一步看似 fetch 成功,origin/feat/.../add_moe_note_20260424 其实仍然不存在 → checkout -B ... origin/... 报 "is not a commit" → 后面连锁失败。

你猜的 fetch origin src:dst 方向是对的,但 dst 写成了另一个分支同名会把目标分支直接覆盖,语义不对。

正确做法(二选一)

方案 A — 推荐,最简单:不带分支参数,让 remote.origin.fetch 的通配 refspec 自动更新 origin/*

git fetch origin
git checkout -B feat/gh_pr_review_bot/add_moe_note_20260424 origin/feat/gh_pr_review_bot/add_moe_note_20260424
git merge --ff-only origin/feat/gh_pr_review_bot/address_review_moe_20260425
git push origin feat/gh_pr_review_bot/add_moe_note_20260424

方案 B — 显式写 refspec,把远端分支写入 refs/remotes/origin/*

git fetch origin \
  feat/gh_pr_review_bot/add_moe_note_20260424:refs/remotes/origin/feat/gh_pr_review_bot/add_moe_note_20260424 \
  feat/gh_pr_review_bot/address_review_moe_20260425:refs/remotes/origin/feat/gh_pr_review_bot/address_review_moe_20260425
# 然后同上 checkout / merge / push

为什么你写的 A:B 形式不行src:dst 中 dst 是"本地要写到的 ref",你把它写成了 feat/.../address_review_moe_20260425 这个本地分支名(而不是 refs/remotes/origin/...),结果是:把 remote 上的 add_moe_note_20260424 的内容强制写入你本地的 address_review_moe_20260425 分支,相当于覆盖/破坏它,不符合意图。

建议直接用方案 A。

不陪你玩了。

@LetMeFly666 LetMeFly666 merged commit 3e54bde into feat/gh_pr_review_bot/add_moe_note_20260424 Apr 25, 2026
1 check passed
@LetMeFly666
Copy link
Copy Markdown
Owner

➜  leetcode_test_solution git:(feat/gh_pr_review_bot/newSolution_trailing_blank_go_tabs_20260424) git fetch origin feat/gh_pr_review_bot/add_moe_note_20260424:feat/gh_pr_review_bot/add_moe_note_20260424                                                 
From github.com:LetMeFly666/LeetCode
 * [new branch]          feat/gh_pr_review_bot/add_moe_note_20260424 -> feat/gh_pr_review_bot/add_moe_note_20260424
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/newSolution_trailing_blank_go_tabs_20260424) git switch feat/gh_pr_review_bot/add_moe_note_20260424                                                  
Switched to branch 'feat/gh_pr_review_bot/add_moe_note_20260424'
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/add_moe_note_20260424) git fetch origin feat/gh_pr_review_bot/address_review_moe_20260425                                                                                       
git mergeFrom github.com:LetMeFly666/LeetCode
 * branch                feat/gh_pr_review_bot/address_review_moe_20260425 -> FETCH_HEAD
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/add_moe_note_20260424) git merge origin/feat/gh_pr_review_bot/address_review_moe_20260425
merge: origin/feat/gh_pr_review_bot/address_review_moe_20260425 - not something we can merge
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/add_moe_note_20260424) git merge origin feat/gh_pr_review_bot/address_review_moe_20260425
merge: feat/gh_pr_review_bot/address_review_moe_20260425 - not something we can merge
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/add_moe_note_20260424) git merge FETCH_HEAD
Updating f78d814fe..3e54bde42
Fast-forward
 Solutions/Other-AI-LLM_Maintained_TechNotes.md | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/add_moe_note_20260424) git push              
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
To github.com:LetMeFly666/LeetCode.git
   f78d814fe..3e54bde42  feat/gh_pr_review_bot/add_moe_note_20260424 -> feat/gh_pr_review_bot/add_moe_note_20260424
branch 'feat/gh_pr_review_bot/add_moe_note_20260424' set up to track 'origin/feat/gh_pr_review_bot/add_moe_note_20260424'.
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/add_moe_note_20260424) git config user.name
LetMeFly666
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/add_moe_note_20260424) git switch feat/gh_pr_review_bot/newSolution_trailing_blank_go_tabs_20260424                                           
Switched to branch 'feat/gh_pr_review_bot/newSolution_trailing_blank_go_tabs_20260424'
Your branch is up to date with 'origin/feat/gh_pr_review_bot/newSolution_trailing_blank_go_tabs_20260424'.
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/newSolution_trailing_blank_go_tabs_20260424) git branch -d feat/gh_pr_review_bot/add_moe_note_20260424                                                 
error: the branch 'feat/gh_pr_review_bot/add_moe_note_20260424' is not fully merged
hint: If you are sure you want to delete it, run 'git branch -D feat/gh_pr_review_bot/add_moe_note_20260424'
hint: Disable this message with "git config set advice.forceDeleteBranch false"
➜  leetcode_test_solution git:(feat/gh_pr_review_bot/newSolution_trailing_blank_go_tabs_20260424) git branch -D feat/gh_pr_review_bot/add_moe_note_20260424
Deleted branch feat/gh_pr_review_bot/add_moe_note_20260424 (was 3e54bde42).

就是忘记换号了

@LetMeFly666 LetMeFly666 deleted the feat/gh_pr_review_bot/address_review_moe_20260425 branch April 25, 2026 06:48
Tisfy added a commit that referenced this pull request Apr 25, 2026
…1542)

* docs: add MoE (Mixture of Experts) note to AI-maintained tech notes

* fix: rewrite file with correct structure - MoE note appended at end

* docs(MoE): address review #4175132766 — refine MoE section

- Add `text` language tag to ASCII diagram code fence (P2 → disable auto-highlight)
- Redraw ASCII routing diagram to avoid `│` / `┐` visual overlap on Expert 2
- Use Mixtral 8x7B paper-accurate params: 46.7B total / 12.9B activated (was ~47B / ~13B)
- Supplement DeepSeek-V2 fine-grained expert count: 160 routed + 2 shared

* docs(MoE): fine-tune ASCII diagram alignment per review #1547

- Shift `Expert 2` / `Expert 3` right by one space inside the box for visual centering
- Shift `(选 Top-K)` left by one space to better align under the Router arrow

* docs(MoE): restore single-space indent on Router arrow line

Fix accidental extra space introduced in previous commit so the left
box border `│` stays column-aligned across all expert rows.

* docs(MoE): round Mixtral 8x7B total params 46.7B → 47B

* docs(MoE): restore frontmatter and change 46.7B to 47B

Previous commit f28c9f0 was broken:
1. It clobbered the frontmatter opening `---` on line 1
2. It never actually touched the 46.7B on line 171
3. It also changed a full-width comma `,` to a half-width `,`

This commit restores line 1 to `---` and changes 46.7B to 47B on the
real target line while preserving the original full-width comma.

* reorder: 不然变动(diff)有点奇怪

---------

Signed-off-by: Tisfy <Tisfy@foxmail.com>
Co-authored-by: gh-pr-review[bot] <268385713+gh-pr-review[bot]@users.noreply.github.com>
Co-authored-by: Tisfy <Tisfy@foxmail.com>
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.

1 participant