Skip to content

[trainer] fix: capture channel metadata before accounting - #1224

Closed
YLlllllllllll wants to merge 1 commit into
ByteDance-Seed:mainfrom
YLlllllllllll:qwen38-base-channel-order
Closed

YLlllllllllll wants to merge 1 commit into
ByteDance-Seed:mainfrom
YLlllllllllll:qwen38-base-channel-order

Conversation

@YLlllllllllll

@YLlllllllllll YLlllllllllll commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #1276. Its complete registered-callback metadata-before-meter behavior, once-only dispatch and unchanged step-end ordering are retained in the current-main channel-loss lifecycle implementation. Both unique lifecycle tests are covered there with stronger keyword-forwarding checks. Independent immutable-source comparison and five lifecycle checks passed. Review #1276, then #1006 for compact source metrics.

@github-actions github-actions Bot added the fix label Sep 22, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: ByteDance-Seed/VeOmni/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5221ae75-62cc-4d51-a2a9-8c2acc3c133e

📥 Commits

Reviewing files that changed from the base of the PR and between 49cc654 and 46a4331.

📒 Files selected for processing (2)
  • tests/trainer/test_channel_loss_callback.py
  • veomni/trainer/base.py

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

BaseTrainer.on_step_begin now dispatches a registered channel-loss callback before other callbacks. Tests cover metadata visibility, step-end ordering, and unregistered callbacks.

Changes

Channel-loss callback ordering

Layer / File(s) Summary
Ordered step-begin dispatch
veomni/trainer/base.py
BaseTrainer calls the registered channel-loss callback before the generic callback loop and skips it during that loop. The callback ordering comment now documents the metadata and step-end sequence.
Callback lifecycle tests
tests/trainer/test_channel_loss_callback.py
Tests verify metadata visibility, registered callback ordering, and omission of an unregistered channel-loss callback.

Priority: ⬇️ Low

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant BaseTrainer
  participant channel_loss_callback
  participant self_callbacks
  BaseTrainer->>channel_loss_callback: on_step_begin(state, micro_batches, kwargs)
  BaseTrainer->>self_callbacks: iterate registered callbacks
  BaseTrainer->>self_callbacks: skip channel_loss_callback
Loading

Suggested reviewers: coach257

Merge Risk: ⚪ Minimal · up to 46a43

The trainer preserves channel metadata visibility and avoids duplicate callback invocation; no concrete correctness or availability risk currently blocks merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: capturing channel metadata before accounting in the trainer.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant