Skip to content

feat(m3): add from_pyconfig bridge - #6563

Draft
SurbhiJainUSC wants to merge 1 commit into
m3-model-configsfrom
m3-pyconfig-bridge
Draft

SurbhiJainUSC wants to merge 1 commit into
m3-model-configsfrom
m3-pyconfig-bridge

Conversation

@SurbhiJainUSC

@SurbhiJainUSC SurbhiJainUSC commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Stacked on #6541

Adds the transitional pyconfig compatibility bridge (src/maxtext/m3/configs/pyconfig_bridge.py) and a minimal lazy fallback in src/maxtext/configs/pyconfig.py, stacked independently on m3-model-configs.

  • pyconfig_bridge.from_pyconfig(cfg, mode="train" | "aot"): translates a parsed MaxTextConfig / HyperParameters instance into a validated (ModelConfig, TrainingConfig) pair across all 5 causal m3 model families (qwen3, qwen3_vl, glm5_3_flash, granitemoe, qwen3_8_flash_next), including dynamic sub-config discovery via TrainingConfig.model_fields and per-family field translations (e.g., num_experts → n_routed_experts or num_local_experts, base_mlp_dim → intermediate_size or shared_expert_intermediate_size, derived head_dim validation on GraniteMoeModelConfig).
  • Fail-fast ConfigMigrationError: performs both a live non-goal value audit (catching unsupported flags set via YAML files even when absent from model_fields_set, such as extended parallelism axes context/pipeline/fsdp_transpose/context_usp_ulysses, enable_diloco, custom_mesh, non-qwix quantization, opt_type outside adamw/adam_pax/sgd, lora, compiled_trainstep_file in mode="train") and an explicit override audit of model_fields_set. Passively inherited base.yml Goodput defaults (enable_goodput_recording/monitor_goodput) are accepted outside test runners while explicit true overrides fail fast.

Tests

CI

Checklist

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed.

@github-actions github-actions Bot added the skip-ci-tests Add this label to the PR to skip running CI tests label Nov 24, 2026
@codecov

codecov Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/m3/configs/pyconfig_bridge.py 90.00% 7 Missing and 6 partials ⚠️

📢 Thoughts on this report? Let us know!

@SurbhiJainUSC
SurbhiJainUSC changed the base branch from main to m3-model-configs November 25, 2026 21:55
@SurbhiJainUSC SurbhiJainUSC changed the title feat(m3): add from_pyconfig bridge and YAML-free pyconfig fallback feat(m3): add from_pyconfig bridge Nov 25, 2026

This branch has not been deployed

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

Labels

skip-ci-tests Add this label to the PR to skip running CI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant