← Back to Pull requests

fix(model): default MODEL_CONFIG_CLASS to None and opt in per family #6305

Closed
unknown closed this pull request without merging on Oct 13, 2026 02:51 UTC
View on GitHub
unknown unknown commented on Oct 03, 2026 02:35 UTC
Author

What does this PR do ?

Makes the builder-backed config path opt-in per model family. Builder calls for families that have not migrated now raise instead of returning a wrong config, and the provider path no longer tells those families to switch.

Every bridge used to inherit MODEL_CONFIG_CLASS = BridgeGPTModelConfig, but only the migrated families map their HF config into it. For the rest, get_model_config() returned generic defaults and to_megatron_provider() warned users toward it.

Changelog

  • MegatronModelBridge.MODEL_CONFIG_CLASS now defaults to None. Migrated families opt in explicitly: LlamaBridge and Qwen3Bridge set BridgeGPTModelConfig; MuseGlimmerBridge already sets MuseGlimmerModelConfig. Subclasses of a migrated bridge inherit the opt-in.

  • hf_config_to_model_config() rejects unmigrated families through the existing MODEL_CONFIG_CLASS is None branch. The error names the bridge and points to AutoBridge.to_megatron_provider().

  • provider_bridge() emits the deprecation FutureWarning only when MODEL_CONFIG_CLASS is set. The provider path itself is unchanged.

  • Removed the _has_model_config_mapping() hook-override guard from the first revision.

  • Removed the explicit MODEL_CONFIG_CLASS = None on GLM5Bridge and BagelBridge, which is now the default.

  • Updated the class comment, docstrings and docs/bridge-guide.md to describe the opt-in default.

  • Tests: test_bridge_can_explicitly_disable_model_config is parametrized over every registered bridge (64). Unmigrated bridges must reject the builder path and have no config mapping; opted-in bridges must provide one; a subclass that sets None is rejected. Added an inheritance test and a provider test on Qwen2 (unmigrated) that asserts no FutureWarning. The Qwen3-based tests are gone since Qwen3 is migrated.
  • Testing

    CPU only, no TransformerEngine (stubbed locally). Run against unmodified main, the updated test file gives 65 failed, 9 passed, 1 skipped; with this change it gives 74 passed, 1 skipped.

    Unchanged between main and this branch: models/llama 44 passed, models/qwen 118 passed, models/glm_moe_dsa 25 passed, models/bagel conversion/checkpoint/dependencies 16 passed and 1 skipped, test_gpu_backend.py 21 passed, test_vlm_generation.py 7 passed, test_llama_recipes.py 105 passed, test_llama_perf_recipes.py 16 passed, test_qwen3_recipes.py 24 passed. test_auto_bridge.py: 97 passed, with the same 5 failures before and after locally (they need TE or a writable /tmp/output). The Muse Glimmer tests need real TransformerEngine and were not run locally; no Muse Glimmer file changed. ruff check and format clean.

    Additional Information

  • Fixes #6242
  • AI-assisted (Claude Code); I reviewed the change and ran the tests.

    Diff: 340 lines (+255 / -85) across 4 files Reviewer: jayzuccarelli Review duration: 14415m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.65) × (1 − Review Confidence (0.54)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.65 · 340 lines diff across 4 files
    0.65
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    54%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.349
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.065
    Real PR Conversation Timeline
    1 comments
    "Review active on #6305"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 54.2% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 65.5% (HIGH) · Higher = larger blast radius
    65.5%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 54.2% · Lower = rushed or shallow review
    54.2%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 29.9% · Safe to merge
    29.9%