Skip to content

Fix: clear LM-head signals after forward - #850

Open
high-cloud wants to merge 1 commit into
hw-native-sys:mainfrom
high-cloud:fix/clear-lm-head-signals-after-forward
Open

Fix: clear LM-head signals after forward#850
high-cloud wants to merge 1 commit into
hw-native-sys:mainfrom
high-cloud:fix/clear-lm-head-signals-after-forward

Conversation

@high-cloud

Copy link
Copy Markdown
Collaborator
  • Clear local hidden and logits completion counters after final gather
  • Let retained CommDomains safely reuse the fixed done epoch

- Clear local hidden and logits completion counters after final gather
- Let retained CommDomains safely reuse the fixed done epoch
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The lm_head function now clears per-peer hidden and logits completion counters after gathering logits, allowing the communication domain to reuse the same completion epoch on the next forward pass.

Changes

LM Head Signal Reset

Layer / File(s) Summary
Clear completion counters
models/deepseek/v4-flash/lm_head.py
Adds a core-group scope that writes zero to hidden_done and logits_done for each src_tp after logits gathering.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a bunny with counters to clear,
Zeroing signals so paths reappear.
Logits hop through the gate,
Then epochs reset their state—
A tidy new forward draws near.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main change: clearing LM-head signals after forward.
Description check ✅ Passed The description directly describes clearing completion counters and reusing the done epoch.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@high-cloud
high-cloud marked this pull request as ready for review July 28, 2026 08:20
@high-cloud high-cloud closed this Jul 28, 2026
@high-cloud high-cloud reopened this Jul 28, 2026
@high-cloud high-cloud closed this Jul 28, 2026
@high-cloud high-cloud reopened this Jul 28, 2026
@high-cloud high-cloud closed this Jul 28, 2026
@high-cloud high-cloud reopened this Jul 28, 2026
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