Views
No views yet
config.json is set for context length up to 32k tokens. Add the "rope_scaling" section to config.json to enable YaRN, eg:1 "max_position_embeddings": 65536,
2 ...
3 "rope_scaling": {
4 "factor": 2.0,
5 "original_max_position_embeddings": 32768,
6 "type": "yarn"
7 },1 "max_position_embeddings": 131072,
2 ...
3 "rope_scaling": {
4 "factor": 4.0,
5 "original_max_position_embeddings": 32768,
6 "type": "yarn"
7 },1 "max_position_embeddings": 163840,
2 ...
3 "rope_scaling": {
4 "factor": 5.0,
5 "original_max_position_embeddings": 32768,
6 "type": "yarn"
7 },llama.cpp uses "static-YaRN" the scaling factor remains constant regardless of input length! Only add the rope_scaling configuration when processing long contexts is required...1> python ./transplant_vocab.py \
2 ./Qwen2.5-0.5B-Instruct \
3 ./DeepSeek-V3-0324 \
4 ./DeepSeek-V3-DRAFT-0.6B-UNTRAINED \
5 --override "<|begin▁of▁sentence|>" "<|endoftext|>" \
6 --override "<|end▁of▁sentence|>" "<|im_end|>" \
7 --override "<|▁pad▁|>" "<|endoftext|>" \
8 --override "<|fim▁hole|>" "<|fim_middle|>" \
9 --override "<|fim▁begin|>" "<|fim_prefix|>" \
10 --override "<|fim▁end|>" "<|fim_suffix|>" \
11 --override "<|User|>" "<|im_start|>user\\n" \
12 --override "<|Assistant|>" "<|im_start|>assistant\\n" \
13 --override "<|EOT|>" "<|endoftext|>" \
14 --override "<|tool▁calls▁begin|>" "<tool_call>" \
15 --override "<|tool▁calls▁end|>" "</tool_call>" \
16 --override "<|tool▁call▁begin|>" "<tool_call>" \
17 --override "<|tool▁call▁end|>" "</tool_call>" \
18 --override "<|tool▁outputs▁begin|>" "<tool_response>" \
19 --override "<|tool▁outputs▁end|>" "</tool_response>" \
20 --override "<|tool▁output▁begin|>" "<tool_response>" \
21 --override "<|tool▁output▁end|>" "</tool_response>" \
22 --override "<|tool▁sep|>" "</tool_call>"
23
24Loading config from 'Qwen2.5-0.5B-Instruct'... Done.
25Loading config from 'DeepSeek-V3-0324'... Done.
26Loading tokenizer from 'Qwen2.5-0.5B-Instruct'... Done.
27Loading tokenizer from 'DeepSeek-V3-0324'... Done.
28Loading model from 'Qwen2.5-0.5B-Instruct'... Done.
29
30Input model configuration:
31- Target vocabulary size : 129280 (used = 128815, unused = 465)
32- Donor vocabulary size : 151936
33- Donor num layers : 24 (tied embeddings = True)
34- Donor hidden size : 896
35- Donor attention heads : 14
36- Donor intermediate size : 4864 (ratio = 1:5.4)
37- Donor total parameters : 494032768 (0.49B)
38-- Embedding parameters : 136134656 (0.14B)
39-- Non-embedding parameters : 357898112 (0.36B)
40
41Processing 3 automatic token overrides:
42✔ 'bos_token_id' : 0 '<|begin▁of▁sentence|>' → [151643] '<|endoftext|>'
43✔ 'eos_token_id' : 1 '<|end▁of▁sentence|>' → [151645] '<|im_end|>'
44✘ 'pad_token_id' : 1 is already mapped to [151645]
45
46Processing 18 manual token overrides:
47✔ 0 : '<|begin▁of▁sentence|>' → [151643] '<|endoftext|>'
48✔ 1 : '<|end▁of▁sentence|>' → [151645] '<|im_end|>'
49✔ 2 : '<|▁pad▁|>' → [151643] '<|endoftext|>'
50✔ 128800 : '<|fim▁hole|>' → [151660] '<|fim_middle|>'
51✔ 128801 : '<|fim▁begin|>' → [151659] '<|fim_prefix|>'
52✔ 128802 : '<|fim▁end|>' → [151661] '<|fim_suffix|>'
53✔ 128803 : '<|User|>' → [151644, 872, 198] '<|im_start|>user\n'
54✔ 128804 : '<|Assistant|>' → [151644, 77091, 198] '<|im_start|>assistant\n'
55✔ 128805 : '<|EOT|>' → [151643] '<|endoftext|>'
56✔ 128806 : '<|tool▁calls▁begin|>' → [151657] '<tool_call>'
57✔ 128807 : '<|tool▁calls▁end|>' → [151658] '</tool_call>'
58✔ 128808 : '<|tool▁call▁begin|>' → [151657] '<tool_call>'
59✔ 128809 : '<|tool▁call▁end|>' → [151658] '</tool_call>'
60✔ 128810 : '<|tool▁outputs▁begin|>' → [27, 14172, 9655, 29] '<tool_response>'
61✔ 128811 : '<|tool▁outputs▁end|>' → [522, 14172, 9655, 29] '</tool_response>'
62✔ 128812 : '<|tool▁output▁begin|>' → [27, 14172, 9655, 29] '<tool_response>'
63✔ 128813 : '<|tool▁output▁end|>' → [522, 14172, 9655, 29] '</tool_response>'
64✔ 128814 : '<|tool▁sep|>' → [151658] '</tool_call>'
65
66NOTE: Using an "untied" copy of 'embed_tokens.weight' as new 'lm_head.weight' tensor...
67
68Transplanting tokens: 100%|████████████████████████████████████████████████████████████| 128815/128815 [00:53<00:00, 2423.79token/s]
69
70Transplant mappings:
71- 1 to 1 : 83683 (65%)
72- 2 to 1 : 38380 (30%)
73- 3 to 1 : 4583 (3.6%)
74- 4 to 1 : 927 (0.72%)
75- 5 to 1 : 273 (0.21%)
76- 6 to 1 : 91 (0.071%)
77- 7 to 1 : 35 (0.027%)
78- 8 to 1 : 22 (0.017%)
79- 9 to 1 : 8 (0.0062%)
80- 10 to 1 : 4 (0.0031%)
81- 11 to 1 : 4 (0.0031%)
82- 13 to 1 : 1 (0.00078%)
83- 14 to 1 : 10 (0.0078%)
84- 15 to 1 : 91 (0.071%)
85- 16 to 1 : 701 (0.54%)
86- 19 to 1 : 1 (0.00078%)
87- 21 to 1 : 1 (0.00078%)
88
89Head initialized with:
90- Copies : 83683 (65%)
91- Means : 45132 (35%)
92- Zeros : 465 (0.36%)
93
94Output model configuration:
95- Output vocabulary size : 129280
96- Output num layers : 24 (tied embeddings = False)
97- Output hidden size : 896
98- Output attention heads : 14
99- Output intermediate size : 4864 (ratio = 1:5.4)
100- Output total parameters : 589567872 (0.59B)
101-- Embedding parameters : 231669760 (0.23B)
102-- Non-embedding parameters : 357898112 (0.36B)
103
104Saving model and tokenizer to 'DeepSeek-V3-DRAFT-0.6B-UNTRAINED' folder
105[2025-08-07 15:36:33,693] [INFO] [real_accelerator.py:203:get_accelerator] Setting ds_accelerator to cuda (auto detect)
106
107Patching 'torch_dtype' in 'DeepSeek-V3-DRAFT-0.6B-UNTRAINED/config.json' based on actual saved tensors
108- Updated 'torch_dtype' to 'bfloat16' based on actual tensor dtype
109
110Operation completed successfully (ignore any 'segmentation fault' that follows!!!)output field only)<|end▁of▁sentence|> tags.1# ==============================
2# MODEL AND OUTPUT CONFIGURATION
3# ==============================
4
5model_dir = 'models/DeepSeek-V3-DRAFT-0.6B-UNTRAINED'
6output_dir = 'finetuned'
7
8# ===========================
9# TRAINING TYPE CONFIGURATION
10# ===========================
11
12full_fine_tune = true
13
14# =======================
15# OPTIMIZER CONFIGURATION
16# =======================
17
18lr = 5e-5
19
20# ======================
21# TRAINING CONFIGURATION
22# ======================
23
24sequence_len = 32768
25
26gradient_accumulation_steps = 10 # 10×6 = batch size 60, 10×6×32768 = ~2M tokens per step
27
28# =====================
29# DATASET CONFIGURATION
30# =====================
31
32[[datasets]]
33dataset_path = 'datasets/common-crawl-sample/*.json'
34drop_tails = true
35
36[[datasets]]
37dataset_path = 'datasets/the-stack-smol-xl/*.jsonl'
38drop_tails = true
39
40[[datasets]]
41dataset_path = 'datasets/rombodawg-Everything-Instruct/*.json'
42drop_tails = true
43RTX A6000 GPUs over three nodes and hence the 60 batch size (6 x 10 gradient accumulation steps = 60):