docs(MoE): address review suggestions from PR #1542#1547
Conversation
- 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 │ ← 被选中,参与计算 |
| token → Router ──► │ Expert 3 │ | ||
| │ ... │ | ||
| └── Expert N ──┘ 未被选中,不激活 | ||
| (选 Top-K) |
- 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.
|
@gh-pr-review |
|
@gh-pr-review 在pr中引用回复下 |
There was a problem hiding this comment.
你能直接将
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未认证)。
可行替代方案
-
本地一条命令(推荐):
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
-
GitHub 页面直接 Merge 本 PR:因本 PR base 就是
add_moe_note_20260424,页面点 "Merge pull request"(fast-forward / rebase 模式)即可,无需本地。 -
工具兜底:把净变更以单个 diff 重新 commit 到
add_moe_note_20260424:这本质仍是"文件修改",不是真正的 commit 直推,但最终效果等价。如需此兜底,回复即执行。
建议用方案 1 或方案 2,最干净。
|
@gh-pr-review 选择rebase的话hash不会变吗 |
There was a problem hiding this comment.
@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-only 后 git 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 换了一批。
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' |
There was a problem hiding this comment.
报错根因:本地既没有 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。
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 |
There was a problem hiding this comment.
新错误的根因是 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。
不陪你玩了。 |
3e54bde
into
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 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).就是忘记换号了 |
…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>
Summary
基于 PR #1542 review #4175132766 的三条 P3 建议,对 MoE 小节做精细化打磨。本 PR 以
feat/gh_pr_review_bot/add_moe_note_20260424为 base,仅包含针对 review 的增量修改。Changes
```→```text,关闭渲染器自动高亮──►│的竖线与右侧框线┐视觉重合,Expert 2 看起来像在边界上约 47B / 约 13B→约 46.7B / 约 12.9B160 个路由专家 + 2 个共享专家对于 review 中剩余两条更开放的建议(Top-K 现状分化、Expert Parallelism 补充),评估后认为属于"后续扩展话题"而非本条知识点的必改项,本 PR 暂不处理,可在后续迭代章节时一并纳入。
Test plan
patch --dry-run本地验证可干净应用