fix(configs): validate inference weight_broadcast type against orchestrator#2848
Open
EazyReal wants to merge 1 commit into
Open
fix(configs): validate inference weight_broadcast type against orchestrator#2848EazyReal wants to merge 1 commit into
EazyReal wants to merge 1 commit into
Conversation
…trator validate_shared_weight_broadcast used a chained comparison `trainer.type != orchestrator.type != inference.type`, which Python evaluates as `(trainer != orchestrator) and (orchestrator != inference)`. Inference was therefore never compared against trainer, so a config where trainer and orchestrator agree but inference differs (e.g. filesystem/filesystem/nccl) passed validation and broke weight sync at runtime. This is reachable whenever the shared [weight_broadcast] is unset, since auto_setup_weight_broadcast otherwise unifies all three components. Check each component against the orchestrator independently, which transitively requires all three to match. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
22d317c to
dfb98f4
Compare
Contributor
Author
|
@mikasenghaas @samsja Could I get a quick review on this config validation fix? It catches inference weight-broadcast type mismatches before runtime weight sync breaks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
validate_shared_weight_broadcastchecks that thetrainer,orchestrator, and (optional)inferenceweight-broadcast transports agree. It used a chained comparison:Python evaluates this as
(trainer != orchestrator) and (orchestrator != inference), so inference is never compared against trainer. When trainer and orchestrator agree but inference differs (e.g.filesystem/filesystem/nccl), the check passes and the mismatch only surfaces as a broken weight sync at runtime.This is reachable whenever the shared
[weight_broadcast]is unset (the default):auto_setup_weight_broadcastonly unifies the three sub-configs when the shared field is set, otherwise it passes the user's per-component values straight to this validator.Why / fix
Compare each component against the orchestrator independently, which transitively requires all three to match. Both original error messages are preserved.
Test
tests/unit/test_configs.py:test_weight_broadcast_inference_mismatch_raises—(filesystem, filesystem, nccl)now raises (fails onmain: "DID NOT RAISE").test_weight_broadcast_all_matching_passes— all-matching config still validates.All 111 tests in
test_configs.pypass;ruff format/ruff checkclean.