Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
46cc360
[qwen3.5] Phase 1: Add core modules — GatedDeltaNet, Qwen35Attention,…
YunchaoYang Mar 25, 2026
e76d906
[qwen3.5] Phase 4: Add MoE module — Qwen35MoeBlock, TopKRouter, Experts
YunchaoYang Mar 25, 2026
825ab75
[qwen3.5] Phase 3: Add component parity tests (29 tests)
YunchaoYang Mar 25, 2026
8fcccb2
[qwen3.5] Add design documentation
YunchaoYang Mar 25, 2026
20f868b
update plan
YunchaoYang Mar 25, 2026
a2bac84
[qwen3.5] Fix critical bugs in Qwen35Attention
YunchaoYang Mar 25, 2026
10f3937
[qwen3.5] Fix MoE router to return raw pre-softmax logits
YunchaoYang Mar 25, 2026
06e648a
[qwen3.5] Add Qwen3.5-0.8B arch config and asset cards
YunchaoYang Mar 25, 2026
526cd53
[qwen3.5] Add Phase 5 TODOs for HuggingFaceConverter registration
YunchaoYang Mar 25, 2026
74e41f0
[qwen3.5] Fix interop: add q_norm/k_norm to RMSNorm weight conversion
YunchaoYang Mar 25, 2026
24246a3
[qwen3.5] Add HF parity test and investigation docs
YunchaoYang Mar 25, 2026
44fa587
rm unnecessary file
YunchaoYang Mar 25, 2026
624dac7
[qwen3.5] Add all model variant configs, asset cards, and update prog…
YunchaoYang Mar 25, 2026
08f093b
[qwen3.5] Phase 6: Integration polish — HF converters, MoE hub, fast-…
YunchaoYang Mar 25, 2026
d734951
stripe image encoder for loading text model only
YunchaoYang Mar 25, 2026
f3a24d7
add interop to qwen
YunchaoYang Mar 26, 2026
118b17e
[qwen3.5] Add SFT training recipe for Qwen 3.5 0.8B on GSM8K
YunchaoYang Mar 31, 2026
6722da4
[qwen3.5] Fix CI: mypy errors, flake8 lint, and parity test collectio…
YunchaoYang Mar 31, 2026
d372d27
[qwen3.5] Fix CI: remove old parity test path, fix unused import in a…
YunchaoYang Mar 31, 2026
04e543c
fix lint
YunchaoYang Apr 1, 2026
85e5350
clean up docs
YunchaoYang Apr 1, 2026
8ebe8d5
fix lint
YunchaoYang Apr 1, 2026
03914bd
[qwen3.5] Add continued pretraining recipe for Qwen 3.5 0.8B on FineW…
YunchaoYang Apr 2, 2026
5e9fe7d
fix lint and format
YunchaoYang Apr 2, 2026
3d1df7f
add TP guard and import warning
YunchaoYang Apr 2, 2026
3c9e1ed
add tests
YunchaoYang Apr 3, 2026
dd4280c
[qwen3.5] Fix integration test: use local checkpoint, add trust_remot…
YunchaoYang May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ warn_unused_ignores = false
module = "torch.distributed.*,torch.optim.*"
implicit_reexport = true

[[tool.mypy.overrides]]
module = "causal_conv1d.*,fla.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "fairseq2.data.parquet.*,tests.unit.data.parquet.*,tests.integration.parquet.*"
ignore_errors = true
Expand Down
81 changes: 81 additions & 0 deletions recipes/lm/sft/configs/qwen35_0.8b_gsm8k.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# Qwen 3.5 0.8B GSM8K SFT Fine-tuning Config
#
# Validates training recipe integration and loss convergence for the Qwen 3.5
# model on the GSM8K math reasoning dataset.
#
# Usage:
# torchrun --standalone --nproc_per_node=8 -m recipes.lm.sft \
# --config-file recipes/lm/sft/configs/qwen35_0.8b_gsm8k.yaml \
# /path/to/output_dir

model:
name: "qwen35_0.8b"
dtype: bfloat16
config_overrides:
pad_idx: 248044

tokenizer:
name: "qwen35_0.8b"
config_overrides:
use_im_end: true

dataset:
max_seq_len: 4096
max_num_tokens: 8192
valid_split: "sft_test"
chat_mode: false
config_overrides:
sources:
train:
- path: "hg://facebook/fairseq2-lm-gsm8k"
split: "sft_train"
weight: 1.0
sft_test:
- path: "hg://facebook/fairseq2-lm-gsm8k"
split: "sft_test"
weight: 1.0

trainer:
data_parallelism: fsdp
max_grad_norm: 1.0
mixed_precision:
mode: static
dtype: bfloat16

optimizer:
name: adamw
config:
lr: 2.0e-5
betas: [0.9, 0.95]
weight_decay: 0.1
impl: fused

lr_scheduler:
name: cosine_annealing
config:
final_lr_scale: 0.1
num_warmup_steps: 100

regime:
num_steps: 100000
checkpoint_every_n_steps: 100
validate_every_n_steps: 100
keep_last_n_checkpoints: 10
publish_metrics_every_n_steps: 1
save_model_only: false

common:
seed: 0
metric_recorders:
wandb:
enabled: true
entity: "yunchaoyang1"
project: "fairseq2"
tensorboard:
enabled: false
162 changes: 162 additions & 0 deletions recipes/lm/train/configs/llama3_2_1b_fineweb_edu_10bt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# LLaMA 3.2 1B Continued Pretraining on FineWeb-Edu 10BT
#
# Loads the pretrained LLaMA 3.2 1B checkpoint and continues training
# on the FineWeb-Edu Sample 10BT educational text dataset.
#
# Prerequisites:
# 1. Convert parquet data to chunked JSONL:
# cd /checkpoint/smallomnillm/shared/data/fineweb-edu
# python convert_to_jsonl.py --sample 10BT --chunk-format --lightweight \
# --num-shards 256 --output-dir jsonl/10BT
#
# Usage:
# torchrun --standalone --nproc_per_node=8 -m recipes.lm.train \
# --config-file recipes/lm/train/configs/llama3_2_1b_fineweb_edu_10bt.yaml \
# /path/to/output_dir

model:
name: llama3_2_1b
dtype: bfloat16
mmap: false
compile: false
compile_options:
fullgraph: false
dynamic: false
mode: default
backend: inductor
backend_options: null

dataset:
name: null
family: lm_train
config_overrides:
sources:
- path: /checkpoint/smallomnillm/shared/data/fineweb-edu/jsonl/10BT
weight: 1.0
max_seq_len: 4096
max_num_tokens: 8192
prefetch: 4
sync_ranks: false

tokenizer:
name: llama3
path: null
family: null
config_overrides: null

gang:
tensor_parallel_size: 1
timeout: 15
high_priority: true

trainer:
data_parallelism: fsdp
fsdp:
version: v2
granularity: layer
hybrid: false
reshard_after_forward: true
fp32_reduce: true
mixed_precision:
mode: static
dtype: bfloat16
grad_accumulation:
num_batches: 1
no_sync: false
activation_checkpointing:
mode: layerwise
every_nth_layer: 1
max_grad_norm: 1.0
fp16_loss_scale:
- 128.0
- 0.0001
gc_every_n_steps: 1000
grad_check: false
anomaly_detection: false

optimizer:
name: adamw
config:
lr: 5.0e-5
betas:
- 0.9
- 0.95
eps: 1.0e-8
weight_decay: 0.1
amsgrad: false
maximize: false
capturable: false
differentiable: false
impl: fused
groups: []

lr_scheduler:
name: cosine_annealing
config:
cycle_len: null
num_warmup_steps: 500
cycle_mul: 1.0
lr_mul: 1.0
start_lr: 1.0e-30
final_lr: null
final_lr_scale: 0.01

regime:
num_steps: 76000
num_data_epochs: null
validate_at_start: false
validate_after_n_steps: 0
validate_every_n_steps: 4000
validate_after_n_data_epochs: 0
validate_every_n_data_epochs: null
score_metric: null
checkpoint_after_n_steps: 0
checkpoint_every_n_steps: 2000
checkpoint_after_n_data_epochs: 0
checkpoint_every_n_data_epochs: null
save_model_only: all_but_last
export_hugging_face: true
keep_last_n_checkpoints: 3
keep_best_n_checkpoints: null
keep_checkpoint_every_n_steps: 10000
publish_metrics_after_n_steps: 0
publish_metrics_every_n_steps: 10
publish_metrics_after_n_data_epochs: 0
publish_metrics_every_n_data_epochs: null

common:
torch:
num_threads: null
allow_tf32: true
fp16_reduced_precision: true
bf16_reduced_precision: true
default_sdpa: torch
compiled_region_activation_memory_budget: 0.9
metric_recorders:
tensorboard:
enabled: true
wandb:
enabled: true
entity: yunchaoyang1
project: llama3_2_1b_fineweb_edu_10bt
run_id: persistent
run_name: null
group: null
job_type: null
resume_mode: null
profilers:
torch:
enabled: false
skip_n_steps: 4
wait_n_steps: 0
num_warmup_steps: 1
num_active_steps: 4
repeat: 1
assets:
extra_paths: []
prev_checkpoint_dir: null
seed: 2
debug: false
cluster: auto
no_sweep_dir: false
sweep_format: ws_{world_size}.{hash}
Loading
Loading