Skip to content

[config] Migrate ModelConfigConverter to ModelConfigTransform - #6164

Merged
tianyu-l merged 3 commits into
mainfrom
wwwjn/migrate-converters-to-transforms
Nov 21, 2026
Merged

tianyu-l merged 3 commits into
mainfrom
wwwjn/migrate-converters-to-transforms

Conversation

@wwwjn

@wwwjn wwwjn commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

  • Every model config converter is now a ModelConfigTransform: BatchInvariantFlexTransform, LMHeadFP32OutputTransform, and MXFP8LinearTransform, MXFP8GroupedLinearTransform, NVFP4LinearTransform, NVFP4GroupedLinearTransform (base QuantizationTransform). ModelConfigConverter, validate_converter_compatibility and the converters argument of all 13 build_model_configs are deleted.
  • Recipes apply them with apply_transforms, like the other transforms. All 225 recipe configs that build on CPU are identical to main, and 21 debug recipes covering every changed model family plus an RL run train with bitwise-identical loss and grad_norm (numbers below).

Fixes #6087.

Why

  1. Converters ran inside build_model_config, so model builders imported torchtitan.config.transform, against that package's dependency direction (its README: "Those packages must not import this package").
  2. There were two composition mechanisms: converters always ran first and were checked by validate_converter_compatibility; transforms are ordered and checked by TransformRelations. The implicit "converters first" rule is what made quantization and the fp32 lm_head safe with LoRA.

What

  1. Transforms (config/transform/): each X.Config's fields become fields of the transform dataclass, and its __post_init__ checks stay in __post_init__. The torchao and SM100 checks move from __init__ to the start of transform(); before, build() ran them right before convert(). The bodies are otherwise unchanged.
  2. Relations (relations.py), replacing the implicit order and validate_converter_compatibility:
    • QuantizationTransform and LMHeadFP32OutputTransform run before LoRATransform. LoRA turns every non-target config into a frozen subclass, which neither of them converts.
    • QuantizationTransform runs before LMHeadFP32OutputTransform. On main validate_converter_compatibility rejected the pair, but RL with quantization needs both, and they target different Linears (e.g. MXFP8LinearTransform(fqns=["layers."]) leaves lm_head to the fp32 transform). LMHeadFP32OutputTransform raises on a quantized lm_head, and quantization raises on a HiMidLoLinear. rl_grpo_qwen3_0_6b_varlen_mxfp8 drops its TODO about this pair and applies MXFP8 through apply_transforms. MXFP8LinearTransform and NVFP4LinearTransform conflict with AsyncTensorParallelTransform (the TODO in relations.py): async TP converts only stock ColumnParallelLinear/RowParallelLinear owners and would silently leave quantized projections synchronous. Grouped quantization changes only routed experts, which async TP never converts, so it stays allowed, as on main.
    • Relations order transforms only within one call. On main, converters always ran inside build_model_config, so quantization could never follow LoRA; now a later apply_transforms call could. The quantization transforms therefore reject a config subclass (e.g. one LoRA froze) instead of rebuilding it as a trainable quantized config, as LMHeadFP32OutputTransform already does.
  3. Model builders: converters is removed from every build_model_config; config/transform/README.md drops the note about builders importing the package.
  4. Recipes: each converters=[...] becomes an apply_transforms call, merged into the recipe's existing call where there is one, with quantization listed first as before. A recipe that rebuilt the model only to pass converters now transforms its base config (configs verified identical).
    • RL: build_rl_model_configs(transforms=...) replaces the converters kwarg it forwarded to build_model_config; its fp32_lm_head default appends LMHeadFP32OutputTransform. rl_dapo_qwen3_30b_a3b_math_8k passed LMHeadFP32OutputConverter on top of that default, a no-op, so it is dropped.
  5. Docs and rules: transform README, OVERRIDE.md, MXFP8, NVFP4 and Flux READMEs, BITWISE_PARITY.md, .claude/rules/direction.md (the migration is finished).

Breaking changes

  • XConverter.Config(...) -> XTransform(...), and build_model_config(..., converters=[...]) -> apply_transforms(config, [...]) (or transform_model_config_(model_config, [...]) without a trainer config).
  • validate_converter_compatibility is gone; apply_transforms and transform_model_config_ check the relations.
  • Constructing a quantization transform no longer checks torchao or SM100; applying it does.

Verification

All comparisons are against main 49dbf7a.

Check What ran Result
Config identity Every torchtitan_recipes function with no required arguments, built on main and on this branch; repr of the whole config compared (worktree paths normalized). Quantization ran for real (torchao nightly on CPU, SM100 check patched); DistMoeTransform was stubbed to record its input model. 225 of 225 identical, including 50 RL recipes and the 26 with MXFP8/NVFP4 configs
Loss parity 21 debug recipes covering every model family whose builder changed and every changed quantized recipe with a debug variant, plus one RL recipe (table below) Loss and grad_norm bitwise identical at every step
New tests test_transforms.py::TestQuantizationAndLMHeadRelations: quantization and fp32 lm_head ordered before LoRA; quantization composes with the fp32 lm_head when they target different Linears, and a quantized lm_head is rejected; the async TP conflict. test_quantization.py::test_quantization_rejects_a_projection_lora_froze: LoRA in one call, then each of the 4 quantization transforms in a later call Pass; fail without the new relations and the stock-config check
Unit tests pytest tests/unit_tests/cpu; test_quantization.py (torchao nightly); RL CPU tests that load recipes (test_alphabet_sort.py, test_dapo_math.py, test_model_defaults.py and 7 more) 2053 passed, 5 failed (the same 5 fail on main: inductor's CPU build hits undefined symbol: c10::ParallelGuard in this env); 62 passed, as on main; 263 passed, 5 skipped
Lint pre-commit (except pyrefly and lychee); pyrefly on the touched non-excluded files Clean; the same 5 pyrefly errors as main, none new

Loss parity: scripts/loss_compare.py --assert-equal --metrics loss,grad_norm, 20 steps, seed 42, deterministic. Loss and grad_norm are bitwise identical to main at every step for every recipe below.

  • A100 x8 (torch 2.16.0.dev20261102): llama3_debugmodel, qwen3_debugmodel, qwen35_debugmodel_varlen_attn, qwen36_debugmodel_varlen_attn, qwen38_debugmodel_varlen_attn, kimi_k2_5_debugmodel, muse_glimmer_debugmodel, muse_spark_debugmodel (4 GPUs).
  • GB300 x4, SM100 (torch 2.16.0.dev20261012, torchao 0.19.0.dev20261012): llama3_debugmodel_mxfp8, llama3_debugmodel_nvfp4, llama3_debugmodel_first_85_pct_layers_nvfp4, qwen3_debugmodel_nvfp4, qwen3_debugmodel_first_85_pct_layers_nvfp4, deepseek_v3_debugmodel, deepseek_v3_debugmodel_mxfp8, deepseek_v3_debugmodel_dist_moe_mxfp8, deepseek_v4_debugmodel, gpt_oss_debugmodel, kimi_k3_debugmodel, graph_trainer_llama3_debugmodel_mxfp8, graph_trainer_deepseek_v3_debugmodel_mxfp8.
  • RL, A100 x8: rl_grpo_qwen3_0_6b_varlen_batch_invariant (seed 42, deterministic, trainer TP=4 + 1 generator TP=4, on-policy, 10 steps, TorchStore weight sync on both sides): loss/mean and trainer/grad_norm/mean bitwise identical.
  • Without the seed checkpoint (both sides initialize from seed 42), because loss_compare's 1-GPU seed run cannot build them (e.g. Muon needs DTensor parameters): kimi_k2_5_debugmodel, deepseek_v4_debugmodel, kimi_k3_debugmodel and both graph_trainer recipes.
  • Not identical on the first try, identical on rerun: kimi_k3_debugmodel differed once from step 2 on GB300; main vs main and main vs this PR were then both identical. qwen35_debugmodel_varlen_attn: main's first (cold Triton cache) run gave a different step-2 loss than main's later runs; with a warm cache, main and this PR are identical.
  • Some couldn't be compared because main fails too. These are the qwen3.5/3.6/3.8 multimodal base debug models, deepseek_v3 nvfp4_ffn_mxfp8_attn, muse_spark dist_moe_mxfp8, and flux (no autoencoder asset here). Their configs are identical to main.
  • Not run, covered by config identity only:
    • Full-size recipes this PR changes, which have no debug variant: llama3_8b_mxfp8, llama3_8b_first_85_pct_layers_nvfp4, qwen3_8b_first_85_pct_layers_nvfp4, deepseek_v3_16b_dist_moe_mxfp8, deepseek_v3_16b_nvfp4_ffn_mxfp8_attn, deepseek_v3_671b_dist_moe_mxfp8, deepseek_v3_671b_nvfp4_ffn_mxfp8_attn, flux_schnell_mxfp8, flux_dev_mxfp8.
    • The other RL recipes, e.g. rl_grpo_qwen3_0_6b_varlen_mxfp8, rl_grpo_qwen3_0_6b_flex_batch_invariant (BatchInvariantFlexTransform) and rl_dapo_qwen3_30b_a3b_math_8k.
  • Not run: the GPU integration test suites.

Rechecked at 6995e45 (the review fix): all 237 recipe functions give the same config or the same error as main, so the stock-config check fires for no in-repo recipe; the loss parity runs above were at 150c127. Config identity details: 12 functions fail identically on both sides (missing verifiers/sglang, unset env vars, the Hopper-only flex flash backend, and 'TrainingConfig' object has no attribute 'max_norm' in 4 graph_trainer numerics recipes, also on main). rl_dapo_qwen3_30b_a3b_math_8k_mxfp8 failed only on the dist_moe stub; compared on its own, it is identical. The 2 remaining functions are the renamed helpers (*_mxfp8_linear_converter_config -> *_mxfp8_linear_transform).

You may ask

  • Why are the quantization and lm_head transform methods unannotated, unlike BatchInvariantFlexTransform.transform? Their convert methods were unannotated. Annotating model: Module.Config makes pyrefly flag the traverse results (parent/attr unions, _owner | None, local_compile on Module.Config), and narrowing them would change the bodies. This PR keeps the bodies as they were.
  • Why no relation between grouped quantization and DistMoeTransform or TokenDispatcherTransform? Every recipe lists quantization first, the order converters ran in, so nothing changes; Dist-MoE already rejects non-stock grouped projections when it runs.

Every model config converter is now a ModelConfigTransform:
BatchInvariantFlexTransform, LMHeadFP32OutputTransform, and the
MXFP8/NVFP4 linear and grouped-linear transforms (base
QuantizationTransform). ModelConfigConverter,
validate_converter_compatibility and the `converters` argument of every
build_model_config are deleted; recipes apply the transforms with
apply_transforms.

TransformRelations now carries what the "converters run first" rule and
validate_converter_compatibility enforced: quantization and the fp32
lm_head run before LoRA, and quantization conflicts with the fp32 lm_head
and with async TP.

Fixes #6087.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@wwwjn

wwwjn commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

@claude Review this PR

@claude

claude Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 4m 31s —— View job


Request changes: quantization now runs before LoRA only inside a single transform call, so quantizing in a later call silently unfreezes LoRA's frozen base weights. A few-line check fixes it. Review

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Request changes -- the migration is right and the parity evidence is thorough, but it drops the structural guarantee that quantization runs before LoRA and puts nothing in its place. In-repo configs are unaffected; a later apply_transforms call can still silently unfreeze LoRA base weights. The fix is a few lines.

What this PR does. It finishes the ModelConfigConverter -> ModelConfigTransform migration. Batch-invariant flex, the fp32 lm_head and the four quantization converters become transforms. The converters argument is removed from all 13 build_model_configs. Recipes now call apply_transforms. The old rule that converters always run first becomes explicit TransformRelations: quantization and the fp32 lm_head run before LoRA, and quantization conflicts with the fp32 lm_head and with async TP.

Example.

# before
config.model = build_model_config("8B", seq_len=seq_len, parallelism=config.parallelism,
    converters=[NVFP4LinearConverter.Config(fqns=fqns)])
# after
config = apply_transforms(config, [NVFP4LinearTransform(fqns=fqns)])

# newly possible, and silent: quantizing in a call after LoRA
config = apply_transforms(llama3_debugmodel_lora(),
                          [MXFP8LinearTransform(fqns=["feed_forward"])])
# FrozenLinear.Config w13/w2 -> plain MXFP8Linear.Config, so the base FFN weights train

Must fix

  1. PR description -- the template's "Summary (human-written)" section is missing. The TLDR may be meant as the summary; put it under that heading (written by the author).
  2. torchtitan/config/transform/relations.py:35-38 -- the before-LoRA order is checked only within one call, and "convert only stock projection configs" isn't enforced. LoRA's frozen configs pass _validate_quantizable_linear and lose their freezing. Fix: add a type(config) is not owner.Config check in the quantization transforms (details inline).

Should consider

  • torchtitan/config/transform/relations.py:47-49 -- the async TP conflict also bans grouped-only quantization, which async TP never touches and which main allowed. The comment also says async TP rejects quantized projections; in fact it silently skips them (details inline).
Details
  • Gate: this finishes the migration listed in direction.md (#6087), removes the models -> config.transform dependency that went against the package's direction, and has net -363 LoC. Nothing else in flight overlaps.
  • Cross-call composition: _ordered and _reject_conflicts (apply.py) only see one call's list. For the fp32 lm_head this is already covered: LMHeadFP32OutputTransform raises on a non-plain Linear.Config, so applying it after LoRA fails loudly. Quantization has no such check. That is the must-fix above.
  • QuantizationTransform <-> LMHeadFP32OutputTransform is also per call. rl_grpo_qwen3_0_6b_varlen_mxfp8 relies on that by calling .transform() directly after build_rl_model_configs applied the fp32 head. Main had the same behavior, and the TODO there covers it.
  • Grouped quantization vs TokenDispatcherTransform: the result now depends on list order. The recipes list quantization first and pass pad_multiple in the dispatcher kwargs, so main's behavior is reproduced. The PR's "You may ask" answers this.
  • Mechanical parts checked: the 13 builders, renames in tests and docs, and recipe rewrites (_enable_mxfp8 dropping flavor, graph_trainer and muse_spark rebuilding from the base config). The 225-config identity check covers these.

Not verified: the silent-unfreeze path was traced by reading lora.py:137-160 and quantization.py, not by running it (no Python in this environment).

Comment on lines +35 to +38
# LoRA replaces each target projection config with an adapter and every
# other config with a frozen dynamic subclass. Quantization and the fp32
# lm_head convert only stock projection configs, so they run first.
(QuantizationTransform, LoRATransform),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ordering only applies inside a single apply_transforms / transform_model_config_ call. The claim that quantization "converts only stock projection configs" (here and in README.md:66-70) isn't enforced. On main the order was guaranteed by structure: converters always ran inside build_model_config, before any transform. With this PR, a later call can quantize a tree that LoRA already rewrote:

config = llama3_debugmodel_lora()  # LoRA on wqkv/wo; w13/w2 become FrozenLinear.Config
config = apply_transforms(config, [MXFP8LinearTransform(fqns=["feed_forward"])])

FrozenConfig subclasses Linear.Config and inherits _owner = Linear (lora.py:144). So _validate_quantizable_linear accepts it, and the new MXFP8Linear.Config loses the build() override that freezes the weights. The FFN base weights then train, and nothing raises. The grouped transforms behave the same way: frozen GroupedLinear.Config experts are rebuilt as trainable quantized configs (quantization.py:250, :366). LMHeadFP32OutputTransform already guards against this with type(linear_config) is not Linear.Config.

Smallest fix: reject non-stock config types in the quantization transforms. In _validate_quantizable_linear:

if type(config) is not owner.Config:
    raise ValueError(
        f"Cannot quantize {fqn!r}: {type(config).__qualname__} is not a stock "
        "config (e.g. frozen by LoRATransform). Apply quantization before or "
        "together with LoRATransform."
    )

Add the same check on config in both grouped loops. Only dynamic config subclasses fail it, so the in-repo recipe configs stay the same.

Comment on lines +47 to +49
# Async TP does not support quantized projections, and quantization does
# not support the async projection classes.
(AsyncTensorParallelTransform, QuantizationTransform),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should consider: this conflict names the QuantizationTransform base, so it also bans AsyncTensorParallelTransform + MXFP8GroupedLinearTransform / NVFP4GroupedLinearTransform on their own. Async TP never touches those: it converts only projections whose owner is exactly ColumnParallelLinear or RowParallelLinear (async_tensor_parallel.py). Main allowed that combination. Either name the two dense transforms (MXFP8LinearTransform, NVFP4LinearTransform), or say in the PR that the wider ban is intended.

Also, the comment overstates the current behavior. Async TP doesn't reject quantized projections; it skips them, because their owner is a get_quantized_linear subclass. So with quantization in an earlier apply_transforms call and async TP in a later one, those projections still stay synchronous and nothing raises, as on main. If you want this covered, raising in AsyncTensorParallelTransform.transform on a quantized Column/Row owner handles both orders and both call patterns.

…only with dense quantization

Relations order transforms only within one apply_transforms call. On main,
converters always ran inside build_model_config, so quantization could never
follow LoRA; now a later call could, and it rebuilt LoRA's frozen projections
as trainable quantized configs. The quantization transforms now reject a config
subclass (e.g. one LoRATransform froze), as LMHeadFP32OutputTransform does.

Async TP converts only stock ColumnParallelLinear/RowParallelLinear owners, so
the conflict names MXFP8LinearTransform and NVFP4LinearTransform; grouped
quantization changes only routed experts and stays allowed, as on main.
@wwwjn

wwwjn commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@claude review again

@claude

claude Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @wwwjn's task in 59s —— View job


Approve, once the "Summary (human-written)" section is added to the PR description: both code findings from the last review are fixed in 6995e45. Review

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Approve -- please address the items below before merging. 6995e45 fixes both code findings from the last review. Only the PR description item is left. This changes core config code, so a maintainer still needs to review it.

What changed since the last review. Quantization transforms now refuse to convert a projection whose config type is not its owner's stock Config. The async TP conflict now names only the two dense quantization transforms.

Example.

config = llama3_debugmodel_lora()  # w13/w2 -> FrozenLinear.Config
apply_transforms(config, [MXFP8LinearTransform(fqns=["feed_forward"])])
# before 6995e45: w2 silently rebuilt as a trainable MXFP8Linear.Config
# now: ValueError "Cannot quantize ...: ... is not the stock Linear.Config
#      (e.g. LoRATransform froze it)"

Earlier findings

  • Resolved: a later quantization call silently unfroze LoRA base weights. _require_stock_config (quantization.py:43-57) now runs in _validate_quantizable_linear and in both grouped loops (:265, :367). ColumnParallelLinear and RowParallelLinear each define their own Config, so stock configs still pass. FrozenConfig inherits _owner = Linear but is a different type, so it is rejected. test_quantization_rejects_a_projection_lora_froze covers all 4 transforms.
  • Resolved: the async TP conflict was too broad. relations.py:55-56 now pairs it only with MXFP8LinearTransform and NVFP4LinearTransform. The comment now says async TP would silently leave quantized projections synchronous, which is accurate.

Must fix

  1. PR description: the template's "Summary (human-written)" section is still missing. Put the summary under that heading, written by you.

No new problems in 6995e45.

Not verified: unit tests were not run in this environment. The PR reports they pass.

@wwwjn
wwwjn marked this pull request as ready for review November 19, 2026 18:10
@pytorch-bot pytorch-bot Bot added the ciflow/fake-pg Run 1-GPU Fake PG integration tests label Nov 19, 2026
@github-actions
github-actions Bot requested a review from pzhan9 November 19, 2026 18:11
Comment on lines +57 to +59
# TODO: Allow this pair once linear quantization and HiMidLoLinear can
# preserve each other's config and compute semantics.
(QuantizationTransform, LMHeadFP32OutputTransform),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this breaks existing recipes or not, but we need to support it for RL with quantization. The two transforms should target different modules -- quantization shouldn't be applied on the lm_head.

The guard doesn't need to be in this relations.py file. It could be that

  • we have to apply one of them first -- maybe quantization first, because in build_rl_model_configs you apply lm_head transform after base transforms.
  • then in lm_head transform, raise error if the module is already quantized

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, we should ban the quantization + lm_head relation. let me change it

RL with quantization needs both transforms: they target different Linears
(e.g. MXFP8LinearTransform(fqns=["layers."]) leaves lm_head to the fp32
transform). Replace their conflict relation with a precedence: quantization
runs first in the same call, and LMHeadFP32OutputTransform raises on a
quantized lm_head (its error now names quantization and points to the
quantization transform's fqns). Quantization already rejects a HiMidLoLinear.

rl_grpo_qwen3_0_6b_varlen_mxfp8 drops its TODO and applies MXFP8 through
apply_transforms; its config is unchanged.
@tianyu-l
tianyu-l merged commit 47cc112 into main Nov 21, 2026
28 checks passed
shuhuayu added a commit that referenced this pull request Nov 21, 2026
…_config

#6164 deleted ModelConfigConverter, validate_converter_compatibility and
the converters argument of every build_model_config. The Flash-Next stack
(#6046-#6054) landed after it with CI from the older base, so
qwen3_8_flash_next/flavors.py still imports them and fails at import time.
Remove the import, the argument and its loop, as #6164 did for the other
models; no Flash-Next caller passes converters.
sdmyzlp pushed a commit to sdmyzlp/torchtitan that referenced this pull request Nov 21, 2026
…_config

pytorch#6164 deleted ModelConfigConverter, validate_converter_compatibility and
the converters argument of every build_model_config. The Flash-Next stack
(pytorch#6046-pytorch#6054) landed after it with CI from the older base, so
qwen3_8_flash_next/flavors.py still imports them and fails at import time.
Remove the import, the argument and its loop, as pytorch#6164 did for the other
models; no Flash-Next caller passes converters.
tianyu-l pushed a commit that referenced this pull request Nov 21, 2026
…onfig (#6316)

Stacked PRs:
 * #6305
 * #6308
 * #6203
 * #6202
 * #6201
 * __->__#6316


--- --- ---

### [qwen3_8_fn] Drop the removed ModelConfigConverter from
build_model_config


## Summary (human-written)
<!-- Write this yourself, not with an AI tool. 2-5 sentences: the
problem, why
     this approach, and what you checked yourself. -->

#6164 deleted `ModelConfigConverter`, `validate_converter_compatibility`
and
the `converters` argument of every `build_model_config`, while the
Flash-Next
model (#6046-#6054) landed still using them. On main, importing
`torchtitan.models.qwen3_8_flash_next` fails with
`ImportError: cannot import name 'ModelConfigConverter'`, so every
Flash-Next
test errors at collection.

This applies #6164's change to Flash-Next: remove the import, the
`converters`
argument and its conversion block from `build_model_config`, as #6164
did for
the other models. Recipes apply converters as transforms with
`apply_transforms`. No in-repo caller passes `converters` to Flash-Next.

```bash
pytest -q tests/unit_tests/cpu/models/qwen3_8_flash_next
```
tianyu-l pushed a commit that referenced this pull request Nov 21, 2026
…_config (#6314)

## Summary (human-written)

as titled. 

## Why

`main` fails to import Flash-Next. #6164 deleted `ModelConfigConverter`,
`validate_converter_compatibility` and the `converters` argument of
every `build_model_config`. The Flash-Next stack (#6046-#6054) merged
about 2.5 hours later, but its CI had run against the older base, so
`torchtitan/models/qwen3_8_flash_next/flavors.py` still imports the
deleted names.

**Example.**

```
$ python -c "import torchtitan.models.qwen3_8_flash_next"
ImportError: cannot import name 'ModelConfigConverter' from 'torchtitan.config.transform'
```

On `main` (65e88e9) this breaks:
- CPU Unit Test: the 4 Flash-Next CPU test modules fail to collect;
- 1 GPU and Multi-GPU Unit Tests: the Flash-Next GPU test modules fail
to collect;
- lint: pyrefly `missing-module-attribute` at
`qwen3_8_flash_next/flavors.py:19-21`.

## What changed

- `qwen3_8_flash_next/flavors.py`: remove the import, the `converters`
argument of `build_model_config` and its loop, as #6164 did for the
other 13 models. No Flash-Next caller passes `converters`; recipes apply
transforms with `apply_transforms`.

## Numerics

None: the removed branch ran only when `converters` was passed, and no
caller passed it.

## Testing

- `pytest tests/unit_tests/cpu` (with `main`'s attn-gym pin): all
Flash-Next tests pass. The 12 failures are in `test_loss`,
`test_dist_moe`, `test_lora` and `qwen3_5`; the same 12 fail in this
environment on `main` before the Flash-Next stack (31d93fe), so they
come from the local environment, not this change.
- Pyrefly reports no errors in `qwen3_8_flash_next/flavors.py`.

## Known issues / follow-ups

- #6055 (6/n, pipeline parallelism) needs a rebase onto `main` with this
change.
saforem2 added a commit to saforem2/torchtitan that referenced this pull request Nov 30, 2026
Conflicts, per-commit effect on ezpz, the three replays (pytorch#6164, pytorch#6325, pytorch#5881),
the attn_gym venv upgrade for pytorch#6172, and the 21-arm smoke matrix on 15efc8b
across Sunspot, Aurora and Sirius. Aurora 2B losses differ from earlier syncs;
an attn_gym-hidden control on the same nodes reproduces the old values exactly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

migrate all ModeConfigConverter to ModelConfigTransform

2 participants