yujiepan commited on
Commit
c6b32c5
·
verified ·
1 Parent(s): 8f4aac0

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +12 -7
  2. config.json +1 -1
  3. model.safetensors +2 -2
  4. tokenizer.json +2 -2
README.md CHANGED
@@ -13,7 +13,7 @@ Structural comparison with `Qwen/Qwen3.8-2.4T-A95B`:
13
  | Input modalities | Text | Same |
14
  | Vocabulary | 248,320 | Same; special-token IDs preserved |
15
  | Backbone layers | 92 | 8 |
16
- | Hidden size | 8,192 | 128 |
17
  | Attention Q/KV heads; head dim | 64/4; 256 | 32/2; 128 |
18
  | Attention cycle | 3 linear + 1 full | Same; two complete cycles |
19
  | Linear-attention key/value heads | 16/128 | 2/16 |
@@ -26,7 +26,7 @@ Structural comparison with `Qwen/Qwen3.8-2.4T-A95B`:
26
 
27
  | File path | Size |
28
  |------|------|
29
- | model.safetensors | 205.9MB |
30
 
31
 
32
  ### Example usage:
@@ -39,9 +39,11 @@ Structural comparison with `Qwen/Qwen3.8-2.4T-A95B`:
39
 
40
  ```bash
41
  model_id=tiny-random/qwen3.8-moe
42
- SGLANG_JIT_DEEPGEMM_FAST_WARMUP=1 sglang serve \
43
  --model-path $model_id \
44
  --tp-size 2 \
 
 
45
  --speculative-algorithm NEXTN \
46
  --speculative-num-steps 3 \
47
  --speculative-eagle-topk 1 \
@@ -83,7 +85,7 @@ import torch
83
  from huggingface_hub import hf_hub_download
84
  from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, GenerationConfig, set_seed
85
  # Creation helpers: pip install git+https://github.com/yujiepan/tiny-random.git
86
- from tiny_random.qwen_utils import add_qwen_mtp, save_random_qwen_checkpoint
87
 
88
  source_model_id = "Qwen/Qwen3.8-2.4T-A95B"
89
  save_folder = "/tmp/tiny-random/qwen38-moe"
@@ -93,7 +95,7 @@ folder = Path(save_folder)
93
  folder.mkdir(parents=True, exist_ok=True)
94
  raw = json.loads(Path(hf_hub_download(source_model_id, "config.json", revision=source_revision)).read_text())
95
  raw.update(
96
- hidden_size=128, head_dim=128, num_hidden_layers=8,
97
  layer_types=(["linear_attention"] * 3 + ["full_attention"]) * 2,
98
  num_attention_heads=32, num_key_value_heads=2,
99
  linear_num_key_heads=2, linear_num_value_heads=16,
@@ -107,6 +109,8 @@ add_qwen_mtp(model, model.model)
107
  save_random_qwen_checkpoint(model, folder)
108
  AutoTokenizer.from_pretrained(source_model_id, revision=source_revision).save_pretrained(folder)
109
  GenerationConfig.from_pretrained(source_model_id, revision=source_revision).save_pretrained(folder)
 
 
110
  ```
111
 
112
  </details>
@@ -116,7 +120,7 @@ GenerationConfig.from_pretrained(source_model_id, revision=source_revision).save
116
  <details><summary>Click to expand</summary>
117
 
118
  ```text
119
- Qwen3.8 MoE: 8 backbone layers + 1 MTP layer; hidden_size=128
120
  ```
121
 
122
  </details>
@@ -135,4 +139,5 @@ Qwen3.8 MoE: 8 backbone layers + 1 MTP layer; hidden_size=128
135
 
136
  ### Change log:
137
 
138
- - 2026-10-23: Initial version.
 
 
13
  | Input modalities | Text | Same |
14
  | Vocabulary | 248,320 | Same; special-token IDs preserved |
15
  | Backbone layers | 92 | 8 |
16
+ | Hidden size | 8,192 | 16 |
17
  | Attention Q/KV heads; head dim | 64/4; 256 | 32/2; 128 |
18
  | Attention cycle | 3 linear + 1 full | Same; two complete cycles |
19
  | Linear-attention key/value heads | 16/128 | 2/16 |
 
26
 
27
  | File path | Size |
28
  |------|------|
29
+ | model.safetensors | 25.9MB |
30
 
31
 
32
  ### Example usage:
 
39
 
40
  ```bash
41
  model_id=tiny-random/qwen3.8-moe
42
+ sglang serve \
43
  --model-path $model_id \
44
  --tp-size 2 \
45
+ --fp8-gemm-backend triton \
46
+ --moe-runner-backend triton \
47
  --speculative-algorithm NEXTN \
48
  --speculative-num-steps 3 \
49
  --speculative-eagle-topk 1 \
 
85
  from huggingface_hub import hf_hub_download
86
  from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, GenerationConfig, set_seed
87
  # Creation helpers: pip install git+https://github.com/yujiepan/tiny-random.git
88
+ from tiny_random.qwen_utils import add_qwen_mtp, save_random_qwen_checkpoint, compact_qwen_tokenizer, check_qwen_repo_size
89
 
90
  source_model_id = "Qwen/Qwen3.8-2.4T-A95B"
91
  save_folder = "/tmp/tiny-random/qwen38-moe"
 
95
  folder.mkdir(parents=True, exist_ok=True)
96
  raw = json.loads(Path(hf_hub_download(source_model_id, "config.json", revision=source_revision)).read_text())
97
  raw.update(
98
+ hidden_size=16, head_dim=128, num_hidden_layers=8,
99
  layer_types=(["linear_attention"] * 3 + ["full_attention"]) * 2,
100
  num_attention_heads=32, num_key_value_heads=2,
101
  linear_num_key_heads=2, linear_num_value_heads=16,
 
109
  save_random_qwen_checkpoint(model, folder)
110
  AutoTokenizer.from_pretrained(source_model_id, revision=source_revision).save_pretrained(folder)
111
  GenerationConfig.from_pretrained(source_model_id, revision=source_revision).save_pretrained(folder)
112
+ compact_qwen_tokenizer(folder)
113
+ check_qwen_repo_size(folder)
114
  ```
115
 
116
  </details>
 
120
  <details><summary>Click to expand</summary>
121
 
122
  ```text
123
+ Qwen3.8 MoE: 8 backbone layers + 1 MTP layer; hidden_size=16
124
  ```
125
 
126
  </details>
 
139
 
140
  ### Change log:
141
 
142
+ - 2026-10-23: Initial version.
143
+ - 2026-10-23: Reduced all repo files below 50 MB; GPU-validated TP=2, MTP and CUDA Graph.
config.json CHANGED
@@ -11,7 +11,7 @@
11
  "full_attention_interval": 4,
12
  "head_dim": 128,
13
  "hidden_act": "silu",
14
- "hidden_size": 128,
15
  "initializer_range": 0.02,
16
  "layer_types": [
17
  "linear_attention",
 
11
  "full_attention_interval": 4,
12
  "head_dim": 128,
13
  "hidden_act": "silu",
14
+ "hidden_size": 16,
15
  "initializer_range": 0.02,
16
  "layer_types": [
17
  "linear_attention",
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5f2d072be72ca068d6a2f1f7454b814ae4f8d7a33260c2c01f6e8e517a09fc5a
3
- size 205927360
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b014592253b65e71aac976e7e417c8d9705d0e085cb3b98281141b51bc6063fb
3
+ size 25859808
tokenizer.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a5cd9732badce41de57e6efce8302930ded1c1188c5f81feb2bd6c24c4a1941f
3
- size 19989339
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4d765ac5a92a75f240af39f9358a09a140216dce113e57754c91042ef8b9e4e8
3
+ size 10079700