[models] Upgrade Qwen3.5 implementation to Qwen3.8 - #4355
Conversation
|
do we want to retire qwen 3.5 now or we can in addition support qwen 3.8 in the same folder? what are the major differences? |
| "0.8B": _0_8b, | ||
| "2B": _2b, | ||
| "4B": _4b, | ||
| "9B": _9b, |
There was a problem hiding this comment.
it seems small models are gone -- what are best small models on the market, both dense and moe?
My current plan is to retire all qwen3.5 and just keep Qwen 3.8 model. However qwen3.8 only have 27B model as the smallest model. Because the model architecture is the same, we can keep these small models in the config_regitry.py as well? |
I think we should keep two folders one for 3.5 and one for 3.8.
|
Summary
qwen3_5model package with a singleqwen3_8packagemodel.language_model.*for the multimodal checkpoint andmodel.*for the text-only checkpointqwen4_exparchitectureHugging Face retains the
Qwen3_5*implementation class and model-type names for these Qwen3.8 checkpoints, so those internal class names remain where they describe the upstream architecture contract.Qwen3.8-27B numerical parity
Tested against
Qwen/Qwen3.8-27Bwith Transformers 5.15 on an NVIDIA H100. The released 55.6 GB safetensor checkpoint was converted through the TorchTitan state-dict adapter to DCP without missing-key or shape errors.FP16 multimodal, three deterministic image-text samples
1.6405e-60.99997100%100%589824reconstructed pixel values matched, maximum difference1.19e-7Per-sample KL:
2.1510e-6,4.8427e-7,2.2861e-6.Text-only FP16 isolation
4.3627e-70.999966100%This isolates and validates the decoder architecture and HF weight conversion independently of the vision encoder.
BF16 multimodal, three deterministic samples
1.9280e-4100%Tests
uvx pre-commit run --all-filespytest -q tests/unit_tests/cpu/test_qwen3_8.py tests/unit_tests/cpu/test_no_new_cli_options.py::TestCliOptionsFrozen::test_every_model_is_guarded tests/unit_tests/cpu/components/data/test_qwen_multimodal_data.py::test_qwen38_recipe_geometry_matches_dataset_processor13 passedSome existing varlen-attention tests require the separately installed FlashAttention-3
flash_attn_interfacemodule.