Skip to content

Config-driven Qwen3-0.6B VLM configs#140

Open
amazloumi wants to merge 4 commits into
mainfrom
feat/qwen3-vlm-configs
Open

Config-driven Qwen3-0.6B VLM configs#140
amazloumi wants to merge 4 commits into
mainfrom
feat/qwen3-vlm-configs

Conversation

@amazloumi

@amazloumi amazloumi commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Make ModelConfig.head_dim an overridable field so the attention width can decouple from dim (Qwen3: dim=1024, head_dim=128); default dim // n_heads is unchanged
  • Add qwen_patch_merger adapter (RMSNorm ln_q + 2-layer MLP)
  • Thread head_dim through CrossAttentionBlockCrossAttention so CA blocks share the backbone head_dim
  • Add Qwen3-0.6B configs for all four arches: configs/train/vlm_qwen3_0.6b_{joint_decoder,cross_attn,mot,moma}.toml (SigLIP2 so400m-patch14-224 + qwen_patch_merger), identical backbone differing only in [vlm].arch
  • Add tests/unit/test_qwen3_vlm_configs.py

Testing

  • uv run ruff check kempnerforge/ tests/ passes
  • uv run ruff format --check kempnerforge/ tests/ scripts/ passes
  • uv run pyright kempnerforge/ passes (0 errors)
  • uv run pytest tests/unit/ -v --timeout=60 passes (1560 passed, 12 skipped)
  • If distributed code changed: uv run torchrun --nproc_per_node=4 -m pytest tests/distributed/ -v
  • If training loop / parallelism / optimizers changed: uv run pytest tests/e2e/ --e2e -v

Closes #139
Refs: KEM-571

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
kempnerforge/config/model.py 100.00% <100.00%> (ø)
kempnerforge/model/adapter.py 97.63% <100.00%> (+0.35%) ⬆️
kempnerforge/model/cross_attention.py 100.00% <100.00%> (ø)
kempnerforge/model/transformer.py 94.62% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Config-driven Qwen3 backbone + Qwen3-0.6B VLM configs

1 participant