Datasets:
Upload checkpoints/dspark_block7_qwen3_4b_full_step_380/train_config.py with huggingface_hub
Browse files
checkpoints/dspark_block7_qwen3_4b_full_step_380/train_config.py
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
|
| 3 |
+
from deepspec.trainer import Qwen3DSparkTrainer
|
| 4 |
+
from deepspec.utils.constant import BASE_CKPT_DIR, BASE_TB_DIR, QWEN_3_4B
|
| 5 |
+
|
| 6 |
+
project_name = "deepspec"
|
| 7 |
+
exp_name = "dspark_block7_qwen3_4b"
|
| 8 |
+
seed = 42
|
| 9 |
+
|
| 10 |
+
model = dict(
|
| 11 |
+
target_model_name_or_path=QWEN_3_4B,
|
| 12 |
+
block_size=7,
|
| 13 |
+
num_draft_layers=5,
|
| 14 |
+
target_layer_ids=[1, 9, 17, 25, 33],
|
| 15 |
+
mask_token_id=151669,
|
| 16 |
+
num_anchors=512,
|
| 17 |
+
|
| 18 |
+
## markov head
|
| 19 |
+
markov_rank=256,
|
| 20 |
+
markov_head_type='vanilla',
|
| 21 |
+
|
| 22 |
+
## confidence head
|
| 23 |
+
confidence_head_alpha=1.0,
|
| 24 |
+
confidence_head_with_markov=True,
|
| 25 |
+
|
| 26 |
+
## loss
|
| 27 |
+
loss_decay_gamma=4.0,
|
| 28 |
+
ce_loss_alpha=0.1,
|
| 29 |
+
l1_loss_alpha=0.9,
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
train = dict(
|
| 33 |
+
trainer_cls=Qwen3DSparkTrainer,
|
| 34 |
+
lr=6.0e-4,
|
| 35 |
+
warmup_ratio=0.04,
|
| 36 |
+
weight_decay=0.0,
|
| 37 |
+
precision="bf16",
|
| 38 |
+
local_batch_size=1,
|
| 39 |
+
global_batch_size=512,
|
| 40 |
+
num_train_epochs=10,
|
| 41 |
+
max_train_steps=None,
|
| 42 |
+
max_grad_norm=1.0,
|
| 43 |
+
sharding_strategy="no_shard",
|
| 44 |
+
torch_compile=True,
|
| 45 |
+
)
|
| 46 |
+
|
| 47 |
+
logging = dict(
|
| 48 |
+
logging_steps=10,
|
| 49 |
+
checkpointing_steps=3000,
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
data = dict(
|
| 53 |
+
target_cache_path=None,
|
| 54 |
+
chat_template="qwen",
|
| 55 |
+
max_length=4096,
|
| 56 |
+
num_workers=4,
|
| 57 |
+
)
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def finalize_cfg(cfg):
|
| 61 |
+
logging_cfg = dict(cfg["logging"])
|
| 62 |
+
project_name=str(cfg['project_name'])
|
| 63 |
+
exp_name = str(cfg["exp_name"])
|
| 64 |
+
logging_cfg["checkpoint_dir"] = os.path.join(BASE_CKPT_DIR, project_name, exp_name)
|
| 65 |
+
logging_cfg["tensorboard_dir"] = os.path.join(BASE_TB_DIR, project_name, exp_name)
|
| 66 |
+
cfg["logging"] = logging_cfg
|
| 67 |
+
|
| 68 |
+
return cfg
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
# --opts overrides applied at save time
|
| 72 |
+
exp_name = 'dspark_block7_qwen3_4b_full'
|
| 73 |
+
train['num_train_epochs'] = 10
|
| 74 |
+
train['local_batch_size'] = 2
|
| 75 |
+
data['target_cache_path'] = '/vol/cache'
|