Repository navigation
[review] Make the AI review catch what maintainers block on; code-owner override; agent self-review; rl/transport - #6407
Conversation
…agent self-review; RL transport folder
|
@claude review |
There was a problem hiding this comment.
Verdict: Needs discussion -- the skill and override changes need two wording fixes, but whether the rl/transport/ move ships in this PR is a scope and placement decision for maintainers.
What this PR does.
- Tightens the review skill so the bot stops approving PRs that still have open design or evidence items.
- Adds a
@claude overridethat lets a code owner overrule the bot's findings. - Asks agents to self-review before opening a PR.
- Moves
model_state_dict_transport.pyandrdma_microbatch.pyinto a newtorchtitan/rl/transport/package, and adds area reviewers for it and for.ci/.
Example.
before: bot posts REQUEST_CHANGES; a code owner disagrees -> dismiss in the UI;
the next "@claude review" blocks again
after: code owner comments "@claude override 2: tracked in #NNNN"
-> bot lists the open items, marks #2 overridden,
APPROVEs if nothing else is open, and doesn't re-raise #2 later
move: from torchtitan.rl.trainer.rdma_microbatch import RDMAMicrobatch
-> from torchtitan.rl.transport.rdma_microbatch import RDMAMicrobatch
Must fix
-
The "Summary (human-written)" section is empty. The skill on
maintreats that as a must-fix; this PR would turn it into a "Before merge" note. Either way, fill it in before merge. -
The
rl/transport/move is a separate concern bundled into a review-skill PR (CLAUDE.md PR Expectations: "One concern per PR"), and its placement goes againstdesign.md:rdma_microbatch.pyis used only byrl/trainer/batcher.pyandrl/trainer/trainer.py, plus their tests and Monarch wrappers. The move takes it out of its consumers' package.- The new folder holds two
.pyfiles, anddesign.md:60says "Flatten folders that hold one or two files." - The case for the folder rests on #6309's delta transport, which hasn't landed. The new Step 2.7 text calls that kind of justification out.
- #6309 and #6237 are editing
rl/model_state_dict_transport.pyright now.
The self-review's reason ("at the maintainer's request") is a process reason, not an argument that the rule doesn't apply. Smallest fix: drop the move and the
rl_transportarea from this PR, and land them in their own PR coordinated with #6309. If maintainers want it here, they should say so on the PR. -
.claude/skills/pr-review/SKILL.md:367-- an override is accepted from a code owner of any changed file, so an area owner can override findings on core files. It should require a code owner of every changed file, as branch protection does (inline). -
.claude/skills/pr-review/SKILL.md:383-- the override flow approves without reviewing commits pushed after the last full review (inline).
Should consider
.claude/skills/pr-review/SKILL.md:424-- "the event matches the verdict in every mode" contradicts the new scoped-requestCOMMENTdefault (inline)..github/area_reviewers.yml:24--rl_transportleaves out the MonarchRDMAMicrobatchimplementation (inline).
Details
- Overlap search.
pr-review: #6239 (draft, felipemello1) editspr-review/SKILL.mdandclaude-code.yml. That is a textual conflict only.model_state_dict_transport: #6237 (GPU direct weight sync).rdma_microbatch: none.- #6309 (delta transport) edits
rl/model_state_dict_transport.pyand addsrl/model_state_dict_delta_transport.pyat the old top level.
- Stale references. I grepped for
rl.model_state_dict_transport,rl/model_state_dict_transport,trainer.rdma_microbatch,trainer/rdma_microbatchandrl/MODEL_STATE_DICT_TRANSPORT. Nothing is left at HEAD, and the moved doc has no relative links that break. - Area routing.
rl_transportwins overrlby longest prefix, the same pattern asrl_attention. So transport-only PRs request d4l3k and not the RL reviewers. That looks intended. - Override scope.
.github/CODEOWNERSlists the core owners on every line, so core owners always qualify. The scope question only matters for area owners: graph_trainer owners and d4l3k for torchft. - Workflow. The
claude-code.ymlchange only adds "override" to the skill trigger text. The trigger phrase@claudealready catches@claude override.
Not verified: whether huydhn has collaborator access for review requests. The workflow requests reviewers one at a time and tolerates failures, so this is harmless either way.
Before merge: fill in the human-written summary.
| A code owner can overrule the bot. Code owners are the users listed in | ||
| `.github/CODEOWNERS` for at least one file the PR changes. Use the base |
There was a problem hiding this comment.
Must fix: "for at least one file the PR changes" gives area owners override power over files they don't own. .github/CODEOWNERS says area owners "can approve PRs that only touch their area", and branch protection needs a code owner for every changed file.
Concrete case: a PR edits torchtitan/experiments/torchft/... and torchtitan/trainer.py. d4l3k is a code owner for the torchft file, so under this text the bot accepts d4l3k's @claude override for a must-fix on trainer.py, and a core owner who approved while expecting that item to be fixed loses the bot's block. Use the same scope as branch protection:
| A code owner can overrule the bot. Code owners are the users listed in | |
| `.github/CODEOWNERS` for at least one file the PR changes. Use the base | |
| A code owner can overrule the bot. A code owner here is a user listed in | |
| `.github/CODEOWNERS` for every file the PR changes, as branch protection | |
| requires. Use the base |
(The other option is "for the file each overridden item is in". That is more permissive and harder for the bot to check.)
| 1. Don't re-review. List the open must-fix items from your latest review and | ||
| mark the overridden ones. |
There was a problem hiding this comment.
Must fix: "Don't re-review" followed by step 2's APPROVE contradicts the new Approve rule ("every change since your last full review was reviewed").
Scenario: the bot posts Request changes with items 1 and 2. The author pushes a commit that fixes item 1 and adds new code. A code owner comments @claude override 2: tracked in #NNNN. Under this text the bot doesn't review, sees nothing open, and approves a commit it never read. Also, "latest review" could be a scoped COMMENT that has no must-fix list.
| 1. Don't re-review. List the open must-fix items from your latest review and | |
| mark the overridden ones. | |
| 1. List the open must-fix items from your latest full review and mark the | |
| overridden ones. If commits landed after that review, review them first | |
| (as in "review again"); a new must-fix there isn't covered by the override. |
| @@ -311,7 +424,8 @@ repo="torchtitan", pullNumber=N, event, body)` posts the review in one call. | |||
| review again, review my review, a question): `APPROVE` for Approve, | |||
There was a problem hiding this comment.
Should consider: this paragraph still says the event matches the verdict "in every mode (... review my review, a question)". Line 72 now makes those scoped requests COMMENT by default unless every change since the last full review was reviewed. Drop "review my review, a question" from this list, or say "when a verdict line is posted", so the two places don't give different instructions.
| - name: rl_transport | ||
| paths: | ||
| - torchtitan/rl/transport/ | ||
| - tests/rl/unit_tests/cpu/test_model_state_dict_transport.py | ||
| - tests/rl/unit_tests/cpu/test_rdma_microbatch.py | ||
| reviewers: [d4l3k] |
There was a problem hiding this comment.
Should consider: rl_transport covers the RDMAMicrobatch interface but not its only implementation, torchtitan/rl/actors/monarch/rdma_microbatch.py. That file and test_batcher_actor.py, which imports _TensorRef from it, still route to the rl reviewers. If d4l3k should see RDMA microbatch changes, add that file here.
… before an override approves; scoped requests default to COMMENT
…l_transport area owns the folder
Summary (human-written)
Why
Since #5667,
@claude reviewhas reviewed 459 PRs. Of the 380 PRs it approved,30 then got a formal "request changes" from a maintainer, and about 20 more got
substantive inline asks. In nearly all of them the bot either saw the problem
and approved anyway, or never asked the questions maintainers ask most ("does
the repo already do this?", "who should own this?"). The opposite failure, the
bot blocking something a maintainer was fine with, is rare: in the PRs we
sampled, 2 of its 81 must-fix items were wrong and about a third were minor
(the empty human-written summary was the biggest source).
Example (#6112, controller sizes the rollout worker pool):
There was also no way for a code owner to overrule the bot except dismissing
its review in the GitHub UI, and a later
@claude review againwould blockagain.
What changed
Review skill (
.claude/skills/pr-review/,review-checklist.md):could write itself. Anything the author still owes (a design change, an
unexplained golden change, evidence the PR rests on) is Request changes;
anything only a maintainer can decide is Needs discussion. A hedge like "a
maintainer should decide" can't come with Approve.
definition of an existing concept, a gate finding.
and the design behind a bug; "ban only what doesn't work on main"; read the
numbers behind a claim. The overlapping-PR search is mandatory and reported.
taken from the bot's own suggestions. A scoped question gets a
COMMENT, nota whole-PR verdict.
about external tools or marks them unverified (never must-fix).
never affects the verdict.
PR creates, model variants as flavors, a mechanical pass over every new or
changed function.
Code owner override (
SKILL.md,claude-code.yml,CONTRIBUTING.md): acode owner comments
@claude override(optionally@claude override 2,3: <reason>); the bot approves if nothing else is open and doesn't re-raise theoverridden items. A code owner's GitHub approval or "LGTM" is not an override,
so a teammate can approve without the bot dropping its findings. Dismissing the
bot's review still unblocks the PR, but isn't an override: the bot can't tell
who dismissed it.
Agent self-review (
CLAUDE.md,pr-description): an agent preparing a PRruns
pr-reviewin branch mode first and records unaddressed items in anoptional "Self-review" section. PRs written without an agent are unaffected; a
missing section is never a finding.
Where each new rule comes from (maintainer asks the bot missed):
Rules:
design.mdgets the one-general-wrapper rule (moved frommodels.md, whose glob skippedtorchtitan/rl), thin adapters, and theconsumer owning its values;
config.mdgets ownership direction and "a Configdoesn't read runtime state";
direction.mdcalls all-to-all the MoE referenceimplementation, so a new vendor-specific dispatch path (e.g. #6242) needs a
reason the existing backends can't serve.
Area reviewers:
.ci/-> huydhn, wwwjn;torchtitan/rl/transport/-> d4l3k.Mechanical, skim:
torchtitan/rl/transport/holds data movement between RLactors.
rl/model_state_dict_transport.py->rl/transport/model_state_dict.pyrl/MODEL_STATE_DICT_TRANSPORT.md->rl/transport/MODEL_STATE_DICT_TRANSPORT.mdrl/trainer/rdma_microbatch.py->rl/transport/rdma_microbatch.pytests/rl/unit_tests/cpu/test_{model_state_dict_transport,rdma_microbatch}.py->
tests/rl/unit_tests/cpu/transport/test_{model_state_dict,rdma_microbatch}.pyscripts/install_rl_env.shupdated; no code changes.User-facing changes
@claude override [items]: <reason>; the bot approves and doesn't re-raise themfrom torchtitan.rl.model_state_dict_transport import ...from torchtitan.rl.transport.model_state_dict import ...from torchtitan.rl.trainer.rdma_microbatch import ...from torchtitan.rl.transport.rdma_microbatch import ...Testing
Backtest: the new skill run locally (nothing posted) on each PR at the commit
and thread state the bot originally saw.
dp_shardtoo (caught)Code owner override, simulated on #6201: override by a code owner lifts the
named item;
@claude overridefrom the author changes nothing; a code owner's"LGTM" approval followed by "review again" keeps Request changes.
Transport move: 83 RL CPU unit tests pass locally
(
transport/test_model_state_dict.py,test_trainer.py,test_engine_loop.py).transport/test_rdma_microbatch.py,test_generator.pyandtest_batcher_actor.pyfail to collect in my env onorigin/maintoo (staleattention-gym / Monarch), so CI is the check for those.
Known issues / follow-ups
but new imports of the old module paths will break: Implement delta model state dict transport #6309 (adds a delta
transport that should live in
rl/transport/), GPU direct weight sync #6237, [rl] Push model state dicts as compressed XOR deltas #6176, [rl] XOR quantized operands' deltas into the generator's weights in place #6177, [WIP][rl] One RDMA object for microbatches and prompts; rollout workers send images as RDMA handles #5862,and drafts [rl] Read model state dict directly into generator GPU with gpu_fetch #6127, [rl] Batch generator weight reads when the transport supports it #6393, [rl] Migrate RDMA microbatches from Monarch RDMA to torch.distributed._transport #6163, [rl] A streamed forward_backward call starts its RDMA reads when it arrives #5764.
workflow.
Self-review
pr-review (branch mode) at ad905a5: Needs discussion. Fixed: branch mode diffs
against
origin/mainand skips description findings before a descriptionexists; the "Config doesn't read runtime state" rule no longer contradicts
hardware validation; dismissal dropped as an override form (the bot can't tell
who dismissed);
test_rdma_microbatch.pyadded to the transport area. Notaddressed:
request.
coordinate.