Skip to content

Commit 19c3b1e

Browse files
authored
Merge branch 'main' into add_reasoning_content_support
2 parents af3b384 + 98c06c8 commit 19c3b1e

6 files changed

Lines changed: 70 additions & 9 deletions

File tree

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ updates:
1313
directory: "/"
1414
target-branch: "main"
1515
schedule:
16-
interval: "weekly"
16+
interval: "quarterly"
1717
open-pull-requests-limit: 10
1818
versioning-strategy: "increase"
1919
allow:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dev = [
9090

9191
# code quality
9292
"mypy~=2.1.0",
93-
"ruff~=0.14.1",
93+
"ruff~=0.15.13",
9494

9595
# docs quality
9696
"mdformat~=1.0.0",

src/speculators/train/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,6 @@ def apply_fully_sharded(model: torch.nn.Module):
151151
for layer in model.layers: # type: ignore[union-attr]
152152
fully_shard(layer, mp_policy=mp_policy)
153153

154-
fully_shard(model, mp_policy=mp_policy)
154+
fully_shard(model)
155155

156156
return model

tests/e2e/regression/test_training_only_acceptance.py

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,20 @@ def _resolve_repo(repo_id: str, repo_type: str = "dataset") -> Path:
2020
try:
2121
return Path(
2222
snapshot_download(
23-
repo_id=repo_id, repo_type=repo_type, local_files_only=True
23+
repo_id=repo_id,
24+
repo_type=repo_type,
25+
local_files_only=True,
26+
allow_patterns=["*.arrow", "*.json", "*.pt", "hidden_states/*"],
2427
)
2528
)
2629
except LocalEntryNotFoundError:
27-
return Path(snapshot_download(repo_id=repo_id, repo_type=repo_type))
30+
return Path(
31+
snapshot_download(
32+
repo_id=repo_id,
33+
repo_type=repo_type,
34+
allow_patterns=["*.arrow", "*.json", "*.pt", "hidden_states/*"],
35+
)
36+
)
2837

2938

3039
@requires_cadence("weekly")
@@ -41,7 +50,7 @@ def test_eagle3_qwen3_8b_sharegpt(tmp_path: Path, prompts: list[list[dict[str, s
4150
seq_length=8192,
4251
epochs=epochs,
4352
lr=3e-4,
44-
draft_vocab_size=8192,
53+
draft_vocab_size=32000,
4554
online=False,
4655
log_freq=50,
4756
timeout=30 * 60, # 30 mins
@@ -71,7 +80,7 @@ def test_dflash_qwen3_8b_sharegpt(tmp_path: Path, prompts: list[list[dict[str, s
7180
seq_length=8192,
7281
epochs=epochs,
7382
lr=3e-4,
74-
draft_vocab_size=8192,
83+
draft_vocab_size=32000,
7584
num_layers=3,
7685
online=False,
7786
log_freq=50,
@@ -86,3 +95,39 @@ def test_dflash_qwen3_8b_sharegpt(tmp_path: Path, prompts: list[list[dict[str, s
8695
prompts=prompts,
8796
acceptance_thresholds=[0.30, 0.05, 0.001, 0, 0, 0, 0],
8897
)
98+
99+
100+
@requires_cadence("weekly")
101+
@pytest.mark.regression
102+
def test_peagle_qwen3_8b_sharegpt(tmp_path: Path, prompts: list[list[dict[str, str]]]):
103+
save_path = tmp_path / "checkpoints"
104+
hidden_states_dir = _resolve_repo("inference-optimization/Qwen3-8b-sharegpt-5k")
105+
epochs = 5
106+
run_training(
107+
model="Qwen/Qwen3-8B",
108+
speculator_type="peagle",
109+
data_path=hidden_states_dir,
110+
save_path=save_path,
111+
seq_length=8192,
112+
epochs=epochs,
113+
lr=6e-4,
114+
draft_vocab_size=32000,
115+
num_layers=4,
116+
online=False,
117+
log_freq=50,
118+
timeout=30 * 60, # 30 mins
119+
extra_train_args=[
120+
"--no-norm-before-residual",
121+
"--scheduler-type",
122+
"cosine",
123+
],
124+
)
125+
final_checkpoint = str(save_path / str(epochs - 1))
126+
run_vllm_engine(
127+
model_path=final_checkpoint,
128+
tmp_path=tmp_path,
129+
max_tokens=512,
130+
ignore_eos=True,
131+
prompts=prompts,
132+
acceptance_thresholds=[0.45, 0.1, 0.01],
133+
)

tests/e2e/smoke/test_offline_training.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@
3535
["--block-size", "8", "--max-anchors", "256", "--num-layers", "3"],
3636
[1, 13, 25],
3737
), # DFlash with 3 layers + verifier last layer
38+
(
39+
"peagle",
40+
[
41+
"--num-layers",
42+
"4",
43+
"--num-depths",
44+
"4",
45+
"--down-sample-ratio",
46+
"0.7",
47+
"--down-sample-ratio-min",
48+
"0.2",
49+
"--no-norm-before-residual",
50+
],
51+
None,
52+
), # P-EAGLE with parallel multi-token prediction
3853
],
3954
)
4055
def test_offline_smoke(

tests/unit/convert/test_eagle3_converter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,15 @@ def test_nm_testing_2layer_eagle3_model_config(self, tmp_path):
260260
checkpoint_path = "nm-testing/testing-llama3.1.8b-2layer-eagle3"
261261
base_model = "RedHatAI/Meta-Llama-3.1-8B-Instruct-FP8-dynamic"
262262

263+
local_checkpoint_path = tmp_path / checkpoint_path.rsplit("/", maxsplit=1)[-1]
263264
converter.convert(
264265
checkpoint_path,
265-
tmp_path / checkpoint_path.split("/")[-1],
266+
local_checkpoint_path,
266267
base_model,
267268
norm_before_residual=False,
268269
)
269270

270-
config = load_checkpoint_config(tmp_path / checkpoint_path.split("/")[-1])
271+
config = load_checkpoint_config(local_checkpoint_path)
271272

272273
# Verify that num_hidden_layers is correctly set to 2
273274
assert config["transformer_layer_config"]["num_hidden_layers"] == 2

0 commit comments

Comments
 (0)