rubentium commited on
Commit
42955b0
·
verified ·
1 Parent(s): 9feea84

EPFL ALiBi and training provenance 751-800 of 1184

Browse files
Files changed (50) hide show
  1. epfl_final/train_logs/dense30k365m_s43.run.log.INTERRUPTED_STEP40_20260722T225915Z +181 -0
  2. epfl_final/train_logs/dense30k365m_s43.supervisor.log +0 -0
  3. epfl_final/train_logs/dense30k365m_s43.watch.log +14 -0
  4. epfl_final/train_logs/dense30k365m_s43.watchdog.log +0 -0
  5. epfl_final/train_logs/dense30k365m_s44.run.log.INTERRUPTED_STEP40_20260722T225915Z +181 -0
  6. epfl_final/train_logs/dense30k365m_s44.supervisor.log +0 -0
  7. epfl_final/train_logs/dense30k365m_s44.watch.log +14 -0
  8. epfl_final/train_logs/dense8k365m_s43.run.log +0 -0
  9. epfl_final/train_logs/dense8k365m_s43.supervisor.log +0 -0
  10. epfl_final/train_logs/dense8k365m_s43.watch.log +3 -0
  11. epfl_final/train_logs/dense8k365m_s44.run.log +0 -0
  12. epfl_final/train_logs/dense8k365m_s44.run.log.NAN_20260722T222304Z +216 -0
  13. epfl_final/train_logs/dense8k365m_s44.run.log.REPRO_NAN_20260722T222840Z +214 -0
  14. epfl_final/train_logs/dense8k365m_s44.supervisor.log +0 -0
  15. epfl_final/train_logs/dense8k365m_s44.watch.log +7 -0
  16. epfl_final/train_logs/dense8k365m_s44.watchdog.log +0 -0
  17. epfl_final/train_logs/dense8k365m_s45.run.log +0 -0
  18. epfl_final/train_logs/dense8k365m_s45.supervisor.log +0 -0
  19. epfl_final/train_logs/dense8k365m_s45.watch.log +3 -0
  20. epfl_final/train_logs/dense8k365m_s46.run.log +0 -0
  21. epfl_final/train_logs/dense8k365m_s46.run.log.GPU1_NAN_20260722T223303Z +214 -0
  22. epfl_final/train_logs/dense8k365m_s46.watch.log +6 -0
  23. epfl_final/train_logs/dense8k365m_s46.watchdog.log +0 -0
  24. epfl_final/train_logs/launch_3b_dense_resume.sh +34 -0
  25. epfl_final/train_logs/launch_3b_mixed.sh +34 -0
  26. epfl_final/train_logs/mixed30k1p2b_s42.run.log +0 -0
  27. epfl_final/train_logs/mixed30k1p2b_s42.supervisor.log +0 -0
  28. epfl_final/train_logs/mixed30k1p2b_s42.watch.log +19 -0
  29. epfl_final/train_logs/mixed30k365m_s43.run.log.INTERRUPTED_STEP40_20260722T225915Z +196 -0
  30. epfl_final/train_logs/mixed30k365m_s43.supervisor.log +0 -0
  31. epfl_final/train_logs/mixed30k365m_s43.watch.log +14 -0
  32. epfl_final/train_logs/mixed30k365m_s44.run.log.INTERRUPTED_STEP40_20260722T225915Z +196 -0
  33. epfl_final/train_logs/mixed30k365m_s44.supervisor.log +0 -0
  34. epfl_final/train_logs/mixed30k365m_s44.watch.log +14 -0
  35. epfl_final/train_logs/mixed8k365m_s44.run.log +0 -0
  36. epfl_final/train_logs/mixed8k365m_s44.supervisor.log +0 -0
  37. epfl_final/train_logs/mixed8k365m_s44.watch.log +3 -0
  38. epfl_final/train_logs/mixed8k365m_s45.run.log +0 -0
  39. epfl_final/train_logs/mixed8k365m_s45.watch.log +3 -0
  40. epfl_final/train_logs/mixed8k365m_s45.watchdog.log +0 -0
  41. epfl_final/train_logs/mixed8k365m_s46.run.log +0 -0
  42. epfl_final/train_logs/mixed8k365m_s46.watch.log +3 -0
  43. epfl_final/train_logs/mixed8k365m_s46.watchdog.log +0 -0
  44. epfl_final/train_logs/mixed8k3b_60b.run.log +0 -0
  45. epfl_final/train_logs/mixed8k3b_60b.supervisor.log +0 -0
  46. epfl_final/train_logs/mixed8k3b_60b.watch.log +16 -0
  47. epfl_final/train_logs/mixed8k3b_prepare.log +1 -0
  48. epfl_final/train_logs/prebuild_mixed_mask_layers.py +72 -0
  49. epfl_final/train_logs/prepare_365m_seed_matrix.py +110 -0
  50. epfl_final/train_logs/prepare_then_launch_3b_mixed.sh +32 -0
epfl_final/train_logs/dense30k365m_s43.run.log.INTERRUPTED_STEP40_20260722T225915Z ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ New run: Checkpoints will be saved to /mloscratch/homes/navasard/sparse/checkpoints/l30k365m_dense_seed43/run_20260722_221751
2
+ Running config:
3
+ {
4
+ "model_path": "/mloscratch/homes/navasard/qwen3_06b_base",
5
+ "model_dtype": "bfloat16",
6
+ "init_from_scratch": true,
7
+ "train_path": "/mloscratch/homes/navasard/data/longctx30k/tokenized",
8
+ "val_path": null,
9
+ "max_seq_length": 30720,
10
+ "num_workers": 8,
11
+ "output_dir": "/mloscratch/homes/navasard/sparse/checkpoints/l30k365m_dense_seed43/run_20260722_221751",
12
+ "resume_from_checkpoint": null,
13
+ "force_new_run": false,
14
+ "num_epochs": 1,
15
+ "max_steps": 11700,
16
+ "per_device_batch_size": 1,
17
+ "gradient_accumulation_steps": 20,
18
+ "learning_rate": 0.0005,
19
+ "weight_decay": 0.01,
20
+ "warmup_steps": 750,
21
+ "lr_scheduler": "cosine",
22
+ "max_grad_norm": 1.0,
23
+ "save_steps": 1000,
24
+ "eval_steps": 250,
25
+ "eval_batches": 50,
26
+ "logging_steps": 10,
27
+ "seed": 43,
28
+ "verbose": true,
29
+ "checkpoint_activations": false,
30
+ "strategy": "ddp",
31
+ "mixed_precision": "bf16",
32
+ "wandb_enabled": true,
33
+ "wandb_project": "stochastic_sparsity",
34
+ "wandb_name": "365m dense 30k seed43",
35
+ "wandb_tags": [
36
+ "qwen3",
37
+ "365m",
38
+ "30k",
39
+ "dense",
40
+ "native",
41
+ "seed43",
42
+ "multiseed"
43
+ ],
44
+ "hidden_size": 768,
45
+ "intermediate_size": 3072,
46
+ "num_attention_heads": 6,
47
+ "num_key_value_heads": 2,
48
+ "num_hidden_layers": 28,
49
+ "head_dim": null,
50
+ "attention_type": "sparse_stochastic",
51
+ "sparse_block_size": 128,
52
+ "sparse_num_random_blocks": 120,
53
+ "sparse_mask_pool_size": 1,
54
+ "sparse_val_dense_compare": false,
55
+ "sparse_layer_indices": null,
56
+ "sparse_mask_cache_dir": null,
57
+ "sparse_mask_seed": 0,
58
+ "sparse_mixed_nrb_set": null,
59
+ "dense_mode": true,
60
+ "dense_step_intervals": null,
61
+ "moba_block_size": 128,
62
+ "moba_top_k": 32,
63
+ "asentmax_alpha": 1.5,
64
+ "asentmax_learn_temp": true,
65
+ "asentmax_init_temp": 1.0
66
+ }
67
+ Loading tokenizer from /mloscratch/homes/navasard/qwen3_06b_base...
68
+ Initializing model from scratch (random weights)...
69
+ Checkpoint activations: False
70
+ dense_mode=True: sparse attention layers will use standard causal SDPA.
71
+
72
+
73
+ ================================================================================
74
+ MODEL ARCHITECTURE
75
+ ================================================================================
76
+ Model config:
77
+ vocab_size: 151936
78
+ hidden_size: 768
79
+ num_hidden_layers: 28
80
+ num_attention_heads: 6
81
+ num_key_value_heads: 2
82
+ head_dim: 128
83
+ intermediate_size: 3072
84
+ max_position_embeddings: 32768
85
+ rope_theta: 1000000
86
+ attention_type: sparse_stochastic
87
+ sparse_block_size: 128
88
+ sparse_num_random_blocks: 120
89
+ sparse_mask_pool_size: 1
90
+ sparse_max_seq_length: 30720
91
+
92
+ Parameter count:
93
+ Total parameters: 358,958,848
94
+ Trainable parameters: 358,958,848
95
+ Non-trainable parameters: 0
96
+ Model size (BF16): 0.72 GB
97
+
98
+ --------------------------------------------------------------------------------
99
+ LAYER-BY-LAYER SUMMARY
100
+ --------------------------------------------------------------------------------
101
+ ================================================================================================================================================================
102
+ Layer (type:depth-idx) Input Shape Output Shape Param # Trainable
103
+ ================================================================================================================================================================
104
+ Qwen3ForCausalLM [1, 30720] -- -- True
105
+ ├─Qwen3Model: 1-1 -- [1, 30720, 768] -- True
106
+ │ └─Embedding: 2-1 [1, 30720] [1, 30720, 768] 116,686,848 True
107
+ │ └─ModuleList: 2-2 -- -- -- True
108
+ │ │ └─Qwen3DecoderLayer: 3-1 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
109
+ │ │ └─Qwen3DecoderLayer: 3-2 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
110
+ │ │ └─Qwen3DecoderLayer: 3-3 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
111
+ │ │ └─Qwen3DecoderLayer: 3-4 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
112
+ │ │ └─Qwen3DecoderLayer: 3-5 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
113
+ │ │ └─Qwen3DecoderLayer: 3-6 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
114
+ │ │ └─Qwen3DecoderLayer: 3-7 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
115
+ │ │ └─Qwen3DecoderLayer: 3-8 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
116
+ │ │ └─Qwen3DecoderLayer: 3-9 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
117
+ │ │ └─Qwen3DecoderLayer: 3-10 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
118
+ │ │ └─Qwen3DecoderLayer: 3-11 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
119
+ │ │ └─Qwen3DecoderLayer: 3-12 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
120
+ │ │ └─Qwen3DecoderLayer: 3-13 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
121
+ │ │ └─Qwen3DecoderLayer: 3-14 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
122
+ │ │ └─Qwen3DecoderLayer: 3-15 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
123
+ │ │ └─Qwen3DecoderLayer: 3-16 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
124
+ │ │ └─Qwen3DecoderLayer: 3-17 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
125
+ │ │ └─Qwen3DecoderLayer: 3-18 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
126
+ │ │ └─Qwen3DecoderLayer: 3-19 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
127
+ │ │ └─Qwen3DecoderLayer: 3-20 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
128
+ │ │ └─Qwen3DecoderLayer: 3-21 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
129
+ │ │ └─Qwen3DecoderLayer: 3-22 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
130
+ │ │ └─Qwen3DecoderLayer: 3-23 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
131
+ │ │ └─Qwen3DecoderLayer: 3-24 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
132
+ │ │ └─Qwen3DecoderLayer: 3-25 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
133
+ │ │ └─Qwen3DecoderLayer: 3-26 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
134
+ │ │ └─Qwen3DecoderLayer: 3-27 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
135
+ │ │ └─Qwen3DecoderLayer: 3-28 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
136
+ │ └─Qwen3RMSNorm: 2-3 [1, 30720, 768] [1, 30720, 768] 768 True
137
+ ├─Linear: 1-2 [1, 30720, 768] [1, 30720, 151936] 116,686,848 True
138
+ ================================================================================================================================================================
139
+ Total params: 475,645,696
140
+ Trainable params: 475,645,696
141
+ Non-trainable params: 0
142
+ Total mult-adds (Units.MEGABYTES): 475.65
143
+ ================================================================================================================================================================
144
+ Input size (MB): 0.25
145
+ Forward/backward pass size (MB): 58494.81
146
+ Params size (MB): 951.29
147
+ Estimated Total Size (MB): 59446.35
148
+ ================================================================================================================================================================
149
+ NOTE: torchinfo double-counts tied embed_tokens/lm_head weight (116,686,848 params). True unique parameter count: 358,958,848 (359.0M)
150
+ ================================================================================
151
+
152
+ Loading dataset from /mloscratch/homes/navasard/data/longctx30k/tokenized...
153
+ Using pre-tokenized dataset (no runtime tokenization)
154
+ Loading pre-tokenized HF dataset from /mloscratch/homes/navasard/data/longctx30k/tokenized...
155
+ Loaded 788736 pre-tokenized examples (stored_len=30720, pack_factor=1, packed_examples=788736)
156
+ Dataset split: 749299 train, 39437 validation
157
+ Training examples (packed, train split): 749299
158
+ Validation examples (packed, val split): 39437
159
+ Per-device batch size: 1
160
+ World size (GPUs): 1
161
+ Gradient accumulation steps: 20
162
+ Effective batch size (seqs/step): 20
163
+ Sequence length: 30720
164
+ Tokens per optimizer step: 614,400
165
+ Micro-batches per epoch (per rank): 749299
166
+ Optimizer steps per epoch: 37464
167
+ Total optimizer steps: 11700 (capped by max_steps; 0.31 epochs)
168
+ wandb: [wandb.login()] Loaded credentials for https://api.wandb.ai from WANDB_API_KEY.
169
+ wandb: Currently logged in as: ruben-navasardyan4869 (ruben-navasardyan4869-epfl) to https://api.wandb.ai. Use `wandb login --relogin` to force relogin
170
+ wandb: Tracking run with wandb version 0.26.1
171
+ wandb: Run data is saved locally in /mloscratch/homes/navasard/sparse/SparseAtt-baselines/wandb/run-20260722_221844-g0u38cyr
172
+ wandb: Run `wandb offline` to turn off syncing.
173
+ wandb: Syncing run 365m dense 30k seed43
174
+ wandb: ⭐️ View project at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity
175
+ wandb: 🚀 View run at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity/runs/g0u38cyr
176
+ Starting training...
177
+ Switching attention mode for step 1: dense (dense step interval)
178
+ Step 10/11700 | Loss: 12.0652 | LR: 6.67e-06 | 32362.0ms/step | 0.6 samples/s
179
+ Step 20/11700 | Loss: 11.9952 | LR: 1.33e-05 | 24539.7ms/step | 0.8 samples/s
180
+ Step 30/11700 | Loss: 11.7724 | LR: 2.00e-05 | 24563.8ms/step | 0.8 samples/s
181
+ Step 40/11700 | Loss: 11.2788 | LR: 2.67e-05 | 24533.2ms/step | 0.8 samples/s
epfl_final/train_logs/dense30k365m_s43.supervisor.log ADDED
File without changes
epfl_final/train_logs/dense30k365m_s43.watch.log ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-22T22:17:37Z watchdog start pid=308
2
+ 2026-07-22T22:17:37Z launch GPUs=0 nproc=1 latest_step=
3
+ 2026-07-22T22:59:15Z watchdog start pid=184
4
+ 2026-07-22T22:59:15Z launch GPUs=0 nproc=1 latest_step=
5
+ 2026-07-24T07:03:34Z watchdog start pid=351
6
+ 2026-07-24T07:03:34Z launch GPUs=0 nproc=1 latest_step=
7
+ 2026-07-24T17:38:52Z watchdog start pid=198
8
+ 2026-07-24T17:38:52Z launch GPUs=0 nproc=1 latest_step=
9
+ 2026-07-25T06:17:28Z watchdog start pid=188
10
+ 2026-07-25T06:17:28Z launch GPUs=0 nproc=1 latest_step=
11
+ 2026-07-25T07:46:31Z process absent for 5 minutes; relaunching
12
+ 2026-07-25T07:46:31Z launch GPUs=0 nproc=1 latest_step=
13
+ 2026-07-25T07:51:31Z process absent for 5 minutes; relaunching
14
+ 2026-07-25T07:51:31Z launch GPUs=0 nproc=1 latest_step=
epfl_final/train_logs/dense30k365m_s43.watchdog.log ADDED
File without changes
epfl_final/train_logs/dense30k365m_s44.run.log.INTERRUPTED_STEP40_20260722T225915Z ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ New run: Checkpoints will be saved to /mloscratch/homes/navasard/sparse/checkpoints/l30k365m_dense_seed44/run_20260722_221751
2
+ Running config:
3
+ {
4
+ "model_path": "/mloscratch/homes/navasard/qwen3_06b_base",
5
+ "model_dtype": "bfloat16",
6
+ "init_from_scratch": true,
7
+ "train_path": "/mloscratch/homes/navasard/data/longctx30k/tokenized",
8
+ "val_path": null,
9
+ "max_seq_length": 30720,
10
+ "num_workers": 8,
11
+ "output_dir": "/mloscratch/homes/navasard/sparse/checkpoints/l30k365m_dense_seed44/run_20260722_221751",
12
+ "resume_from_checkpoint": null,
13
+ "force_new_run": false,
14
+ "num_epochs": 1,
15
+ "max_steps": 11700,
16
+ "per_device_batch_size": 1,
17
+ "gradient_accumulation_steps": 20,
18
+ "learning_rate": 0.0005,
19
+ "weight_decay": 0.01,
20
+ "warmup_steps": 750,
21
+ "lr_scheduler": "cosine",
22
+ "max_grad_norm": 1.0,
23
+ "save_steps": 1000,
24
+ "eval_steps": 250,
25
+ "eval_batches": 50,
26
+ "logging_steps": 10,
27
+ "seed": 44,
28
+ "verbose": true,
29
+ "checkpoint_activations": false,
30
+ "strategy": "ddp",
31
+ "mixed_precision": "bf16",
32
+ "wandb_enabled": true,
33
+ "wandb_project": "stochastic_sparsity",
34
+ "wandb_name": "365m dense 30k seed44",
35
+ "wandb_tags": [
36
+ "qwen3",
37
+ "365m",
38
+ "30k",
39
+ "dense",
40
+ "native",
41
+ "seed44",
42
+ "multiseed"
43
+ ],
44
+ "hidden_size": 768,
45
+ "intermediate_size": 3072,
46
+ "num_attention_heads": 6,
47
+ "num_key_value_heads": 2,
48
+ "num_hidden_layers": 28,
49
+ "head_dim": null,
50
+ "attention_type": "sparse_stochastic",
51
+ "sparse_block_size": 128,
52
+ "sparse_num_random_blocks": 120,
53
+ "sparse_mask_pool_size": 1,
54
+ "sparse_val_dense_compare": false,
55
+ "sparse_layer_indices": null,
56
+ "sparse_mask_cache_dir": null,
57
+ "sparse_mask_seed": 0,
58
+ "sparse_mixed_nrb_set": null,
59
+ "dense_mode": true,
60
+ "dense_step_intervals": null,
61
+ "moba_block_size": 128,
62
+ "moba_top_k": 32,
63
+ "asentmax_alpha": 1.5,
64
+ "asentmax_learn_temp": true,
65
+ "asentmax_init_temp": 1.0
66
+ }
67
+ Loading tokenizer from /mloscratch/homes/navasard/qwen3_06b_base...
68
+ Initializing model from scratch (random weights)...
69
+ Checkpoint activations: False
70
+ dense_mode=True: sparse attention layers will use standard causal SDPA.
71
+
72
+
73
+ ================================================================================
74
+ MODEL ARCHITECTURE
75
+ ================================================================================
76
+ Model config:
77
+ vocab_size: 151936
78
+ hidden_size: 768
79
+ num_hidden_layers: 28
80
+ num_attention_heads: 6
81
+ num_key_value_heads: 2
82
+ head_dim: 128
83
+ intermediate_size: 3072
84
+ max_position_embeddings: 32768
85
+ rope_theta: 1000000
86
+ attention_type: sparse_stochastic
87
+ sparse_block_size: 128
88
+ sparse_num_random_blocks: 120
89
+ sparse_mask_pool_size: 1
90
+ sparse_max_seq_length: 30720
91
+
92
+ Parameter count:
93
+ Total parameters: 358,958,848
94
+ Trainable parameters: 358,958,848
95
+ Non-trainable parameters: 0
96
+ Model size (BF16): 0.72 GB
97
+
98
+ --------------------------------------------------------------------------------
99
+ LAYER-BY-LAYER SUMMARY
100
+ --------------------------------------------------------------------------------
101
+ ================================================================================================================================================================
102
+ Layer (type:depth-idx) Input Shape Output Shape Param # Trainable
103
+ ================================================================================================================================================================
104
+ Qwen3ForCausalLM [1, 30720] -- -- True
105
+ ├─Qwen3Model: 1-1 -- [1, 30720, 768] -- True
106
+ │ └─Embedding: 2-1 [1, 30720] [1, 30720, 768] 116,686,848 True
107
+ │ └─ModuleList: 2-2 -- -- -- True
108
+ │ │ └─Qwen3DecoderLayer: 3-1 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
109
+ │ │ └─Qwen3DecoderLayer: 3-2 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
110
+ │ │ └─Qwen3DecoderLayer: 3-3 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
111
+ │ │ └─Qwen3DecoderLayer: 3-4 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
112
+ │ │ └─Qwen3DecoderLayer: 3-5 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
113
+ │ │ └─Qwen3DecoderLayer: 3-6 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
114
+ │ │ └─Qwen3DecoderLayer: 3-7 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
115
+ │ │ └─Qwen3DecoderLayer: 3-8 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
116
+ │ │ └─Qwen3DecoderLayer: 3-9 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
117
+ │ │ └─Qwen3DecoderLayer: 3-10 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
118
+ │ │ └─Qwen3DecoderLayer: 3-11 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
119
+ │ │ └─Qwen3DecoderLayer: 3-12 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
120
+ │ │ └─Qwen3DecoderLayer: 3-13 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
121
+ │ │ └─Qwen3DecoderLayer: 3-14 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
122
+ │ │ └─Qwen3DecoderLayer: 3-15 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
123
+ │ │ └─Qwen3DecoderLayer: 3-16 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
124
+ │ │ └─Qwen3DecoderLayer: 3-17 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
125
+ │ │ └─Qwen3DecoderLayer: 3-18 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
126
+ │ │ └─Qwen3DecoderLayer: 3-19 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
127
+ │ │ └─Qwen3DecoderLayer: 3-20 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
128
+ │ │ └─Qwen3DecoderLayer: 3-21 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
129
+ │ │ └─Qwen3DecoderLayer: 3-22 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
130
+ │ │ └─Qwen3DecoderLayer: 3-23 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
131
+ │ │ └─Qwen3DecoderLayer: 3-24 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
132
+ │ │ └─Qwen3DecoderLayer: 3-25 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
133
+ │ │ └─Qwen3DecoderLayer: 3-26 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
134
+ │ │ └─Qwen3DecoderLayer: 3-27 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
135
+ │ │ └─Qwen3DecoderLayer: 3-28 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
136
+ │ └─Qwen3RMSNorm: 2-3 [1, 30720, 768] [1, 30720, 768] 768 True
137
+ ├─Linear: 1-2 [1, 30720, 768] [1, 30720, 151936] 116,686,848 True
138
+ ================================================================================================================================================================
139
+ Total params: 475,645,696
140
+ Trainable params: 475,645,696
141
+ Non-trainable params: 0
142
+ Total mult-adds (Units.MEGABYTES): 475.65
143
+ ================================================================================================================================================================
144
+ Input size (MB): 0.25
145
+ Forward/backward pass size (MB): 58494.81
146
+ Params size (MB): 951.29
147
+ Estimated Total Size (MB): 59446.35
148
+ ================================================================================================================================================================
149
+ NOTE: torchinfo double-counts tied embed_tokens/lm_head weight (116,686,848 params). True unique parameter count: 358,958,848 (359.0M)
150
+ ================================================================================
151
+
152
+ Loading dataset from /mloscratch/homes/navasard/data/longctx30k/tokenized...
153
+ Using pre-tokenized dataset (no runtime tokenization)
154
+ Loading pre-tokenized HF dataset from /mloscratch/homes/navasard/data/longctx30k/tokenized...
155
+ Loaded 788736 pre-tokenized examples (stored_len=30720, pack_factor=1, packed_examples=788736)
156
+ Dataset split: 749299 train, 39437 validation
157
+ Training examples (packed, train split): 749299
158
+ Validation examples (packed, val split): 39437
159
+ Per-device batch size: 1
160
+ World size (GPUs): 1
161
+ Gradient accumulation steps: 20
162
+ Effective batch size (seqs/step): 20
163
+ Sequence length: 30720
164
+ Tokens per optimizer step: 614,400
165
+ Micro-batches per epoch (per rank): 749299
166
+ Optimizer steps per epoch: 37464
167
+ Total optimizer steps: 11700 (capped by max_steps; 0.31 epochs)
168
+ wandb: [wandb.login()] Loaded credentials for https://api.wandb.ai from WANDB_API_KEY.
169
+ wandb: Currently logged in as: ruben-navasardyan4869 (ruben-navasardyan4869-epfl) to https://api.wandb.ai. Use `wandb login --relogin` to force relogin
170
+ wandb: Tracking run with wandb version 0.26.1
171
+ wandb: Run data is saved locally in /mloscratch/homes/navasard/sparse/SparseAtt-baselines/wandb/run-20260722_221844-8dm0uevk
172
+ wandb: Run `wandb offline` to turn off syncing.
173
+ wandb: Syncing run 365m dense 30k seed44
174
+ wandb: ⭐️ View project at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity
175
+ wandb: 🚀 View run at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity/runs/8dm0uevk
176
+ Starting training...
177
+ Switching attention mode for step 1: dense (dense step interval)
178
+ Step 10/11700 | Loss: 12.0542 | LR: 6.67e-06 | 32412.1ms/step | 0.6 samples/s
179
+ Step 20/11700 | Loss: 11.9953 | LR: 1.33e-05 | 24631.0ms/step | 0.8 samples/s
180
+ Step 30/11700 | Loss: 11.7596 | LR: 2.00e-05 | 24615.4ms/step | 0.8 samples/s
181
+ Step 40/11700 | Loss: 11.2855 | LR: 2.67e-05 | 24588.6ms/step | 0.8 samples/s
epfl_final/train_logs/dense30k365m_s44.supervisor.log ADDED
File without changes
epfl_final/train_logs/dense30k365m_s44.watch.log ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-22T22:17:37Z watchdog start pid=310
2
+ 2026-07-22T22:17:37Z launch GPUs=1 nproc=1 latest_step=
3
+ 2026-07-22T22:59:15Z watchdog start pid=185
4
+ 2026-07-22T22:59:15Z launch GPUs=1 nproc=1 latest_step=
5
+ 2026-07-24T07:03:34Z watchdog start pid=352
6
+ 2026-07-24T07:03:34Z launch GPUs=1 nproc=1 latest_step=
7
+ 2026-07-24T17:38:52Z watchdog start pid=199
8
+ 2026-07-24T17:38:52Z launch GPUs=1 nproc=1 latest_step=
9
+ 2026-07-25T06:17:28Z watchdog start pid=190
10
+ 2026-07-25T06:17:28Z launch GPUs=1 nproc=1 latest_step=
11
+ 2026-07-25T07:47:01Z process absent for 5 minutes; relaunching
12
+ 2026-07-25T07:47:01Z launch GPUs=1 nproc=1 latest_step=
13
+ 2026-07-25T07:52:01Z process absent for 5 minutes; relaunching
14
+ 2026-07-25T07:52:01Z launch GPUs=1 nproc=1 latest_step=
epfl_final/train_logs/dense8k365m_s43.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/dense8k365m_s43.supervisor.log ADDED
File without changes
epfl_final/train_logs/dense8k365m_s43.watch.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 2026-07-22T22:17:37Z watchdog start pid=160
2
+ 2026-07-22T22:17:37Z launch GPUs=0 nproc=1 latest_step=
3
+ 2026-07-24T22:04:50Z complete latest_step=44000
epfl_final/train_logs/dense8k365m_s44.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/dense8k365m_s44.run.log.NAN_20260722T222304Z ADDED
@@ -0,0 +1,216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ New run: Checkpoints will be saved to /mloscratch/homes/navasard/sparse/checkpoints/l8k365m_dense_seed44/run_20260722_221755
2
+ Running config:
3
+ {
4
+ "model_path": "/mloscratch/homes/navasard/qwen3_06b_base",
5
+ "model_dtype": "bfloat16",
6
+ "init_from_scratch": true,
7
+ "train_path": "/mloscratch/homes/navasard/data/fineweb_large/tokenized",
8
+ "val_path": null,
9
+ "max_seq_length": 8192,
10
+ "num_workers": 8,
11
+ "output_dir": "/mloscratch/homes/navasard/sparse/checkpoints/l8k365m_dense_seed44/run_20260722_221755",
12
+ "resume_from_checkpoint": null,
13
+ "force_new_run": false,
14
+ "num_epochs": 1,
15
+ "max_steps": 44000,
16
+ "per_device_batch_size": 2,
17
+ "gradient_accumulation_steps": 10,
18
+ "learning_rate": 0.0005,
19
+ "weight_decay": 0.01,
20
+ "warmup_steps": 750,
21
+ "lr_scheduler": "cosine",
22
+ "max_grad_norm": 1.0,
23
+ "save_steps": 1000,
24
+ "eval_steps": 250,
25
+ "eval_batches": 50,
26
+ "logging_steps": 10,
27
+ "seed": 44,
28
+ "verbose": true,
29
+ "checkpoint_activations": false,
30
+ "strategy": "ddp",
31
+ "mixed_precision": "bf16",
32
+ "wandb_enabled": true,
33
+ "wandb_project": "stochastic_sparsity",
34
+ "wandb_name": "365m dense 8k seed44",
35
+ "wandb_tags": [
36
+ "qwen3",
37
+ "365m",
38
+ "8k",
39
+ "dense",
40
+ "seed44",
41
+ "multiseed"
42
+ ],
43
+ "hidden_size": 768,
44
+ "intermediate_size": 3072,
45
+ "num_attention_heads": 6,
46
+ "num_key_value_heads": 2,
47
+ "num_hidden_layers": 28,
48
+ "head_dim": null,
49
+ "attention_type": "sparse_stochastic",
50
+ "sparse_block_size": 128,
51
+ "sparse_num_random_blocks": 31,
52
+ "sparse_mask_pool_size": 1,
53
+ "sparse_val_dense_compare": false,
54
+ "sparse_layer_indices": null,
55
+ "sparse_mask_cache_dir": null,
56
+ "sparse_mask_seed": 0,
57
+ "sparse_mixed_nrb_set": null,
58
+ "dense_mode": true,
59
+ "dense_step_intervals": null,
60
+ "moba_block_size": 128,
61
+ "moba_top_k": 32,
62
+ "asentmax_alpha": 1.5,
63
+ "asentmax_learn_temp": true,
64
+ "asentmax_init_temp": 1.0
65
+ }
66
+ Loading tokenizer from /mloscratch/homes/navasard/qwen3_06b_base...
67
+ Initializing model from scratch (random weights)...
68
+ Checkpoint activations: False
69
+ dense_mode=True: sparse attention layers will use standard causal SDPA.
70
+
71
+
72
+ ================================================================================
73
+ MODEL ARCHITECTURE
74
+ ================================================================================
75
+ Model config:
76
+ vocab_size: 151936
77
+ hidden_size: 768
78
+ num_hidden_layers: 28
79
+ num_attention_heads: 6
80
+ num_key_value_heads: 2
81
+ head_dim: 128
82
+ intermediate_size: 3072
83
+ max_position_embeddings: 32768
84
+ rope_theta: 1000000
85
+ attention_type: sparse_stochastic
86
+ sparse_block_size: 128
87
+ sparse_num_random_blocks: 31
88
+ sparse_mask_pool_size: 1
89
+ sparse_max_seq_length: 8192
90
+
91
+ Parameter count:
92
+ Total parameters: 358,958,848
93
+ Trainable parameters: 358,958,848
94
+ Non-trainable parameters: 0
95
+ Model size (BF16): 0.72 GB
96
+
97
+ --------------------------------------------------------------------------------
98
+ LAYER-BY-LAYER SUMMARY
99
+ --------------------------------------------------------------------------------
100
+ ================================================================================================================================================================
101
+ Layer (type:depth-idx) Input Shape Output Shape Param # Trainable
102
+ ================================================================================================================================================================
103
+ Qwen3ForCausalLM [2, 8192] -- -- True
104
+ ├─Qwen3Model: 1-1 -- [2, 8192, 768] -- True
105
+ │ └─Embedding: 2-1 [2, 8192] [2, 8192, 768] 116,686,848 True
106
+ │ └─ModuleList: 2-2 -- -- -- True
107
+ │ │ └─Qwen3DecoderLayer: 3-1 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
108
+ │ │ └─Qwen3DecoderLayer: 3-2 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
109
+ │ │ └─Qwen3DecoderLayer: 3-3 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
110
+ │ │ └─Qwen3DecoderLayer: 3-4 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
111
+ │ │ └─Qwen3DecoderLayer: 3-5 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
112
+ │ │ └─Qwen3DecoderLayer: 3-6 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
113
+ │ │ └─Qwen3DecoderLayer: 3-7 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
114
+ │ │ └─Qwen3DecoderLayer: 3-8 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
115
+ │ │ └─Qwen3DecoderLayer: 3-9 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
116
+ │ │ └─Qwen3DecoderLayer: 3-10 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
117
+ │ │ └─Qwen3DecoderLayer: 3-11 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
118
+ │ │ └─Qwen3DecoderLayer: 3-12 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
119
+ │ │ └─Qwen3DecoderLayer: 3-13 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
120
+ │ │ └─Qwen3DecoderLayer: 3-14 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
121
+ │ │ └─Qwen3DecoderLayer: 3-15 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
122
+ │ │ └─Qwen3DecoderLayer: 3-16 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
123
+ │ │ └─Qwen3DecoderLayer: 3-17 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
124
+ │ │ └─Qwen3DecoderLayer: 3-18 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
125
+ │ │ └─Qwen3DecoderLayer: 3-19 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
126
+ │ │ └─Qwen3DecoderLayer: 3-20 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
127
+ │ │ └─Qwen3DecoderLayer: 3-21 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
128
+ │ │ └─Qwen3DecoderLayer: 3-22 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
129
+ │ │ └─Qwen3DecoderLayer: 3-23 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
130
+ │ │ └─Qwen3DecoderLayer: 3-24 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
131
+ │ │ └─Qwen3DecoderLayer: 3-25 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
132
+ │ │ └─Qwen3DecoderLayer: 3-26 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
133
+ │ │ └─Qwen3DecoderLayer: 3-27 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
134
+ │ │ └─Qwen3DecoderLayer: 3-28 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
135
+ │ └─Qwen3RMSNorm: 2-3 [2, 8192, 768] [2, 8192, 768] 768 True
136
+ ├─Linear: 1-2 [2, 8192, 768] [2, 8192, 151936] 116,686,848 True
137
+ ================================================================================================================================================================
138
+ Total params: 475,645,696
139
+ Trainable params: 475,645,696
140
+ Non-trainable params: 0
141
+ Total mult-adds (Units.MEGABYTES): 951.29
142
+ ================================================================================================================================================================
143
+ Input size (MB): 0.13
144
+ Forward/backward pass size (MB): 31197.23
145
+ Params size (MB): 951.29
146
+ Estimated Total Size (MB): 32148.66
147
+ ================================================================================================================================================================
148
+ NOTE: torchinfo double-counts tied embed_tokens/lm_head weight (116,686,848 params). True unique parameter count: 358,958,848 (359.0M)
149
+ ================================================================================
150
+
151
+ Loading dataset from /mloscratch/homes/navasard/data/fineweb_large/tokenized...
152
+ Using pre-tokenized dataset (no runtime tokenization)
153
+ Loading pre-tokenized HF dataset from /mloscratch/homes/navasard/data/fineweb_large/tokenized...
154
+ Loaded 12748481 pre-tokenized examples (stored_len=2048, pack_factor=4, packed_examples=3187120)
155
+ Dataset split: 3027764 train, 159356 validation
156
+ Training examples (packed, train split): 3027764
157
+ Validation examples (packed, val split): 159356
158
+ Per-device batch size: 2
159
+ World size (GPUs): 1
160
+ Gradient accumulation steps: 10
161
+ Effective batch size (seqs/step): 20
162
+ Sequence length: 8192
163
+ Tokens per optimizer step: 163,840
164
+ Micro-batches per epoch (per rank): 1513882
165
+ Optimizer steps per epoch: 151388
166
+ Total optimizer steps: 44000 (capped by max_steps; 0.29 epochs)
167
+ wandb: [wandb.login()] Loaded credentials for https://api.wandb.ai from WANDB_API_KEY.
168
+ wandb: Currently logged in as: ruben-navasardyan4869 (ruben-navasardyan4869-epfl) to https://api.wandb.ai. Use `wandb login --relogin` to force relogin
169
+ wandb: setting up run 62sdl4ys
170
+ wandb: Tracking run with wandb version 0.26.1
171
+ wandb: Run data is saved locally in /mloscratch/homes/navasard/sparse/SparseAtt-baselines/wandb/run-20260722_221828-62sdl4ys
172
+ wandb: Run `wandb offline` to turn off syncing.
173
+ wandb: Syncing run 365m dense 8k seed44
174
+ wandb: ⭐️ View project at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity
175
+ wandb: 🚀 View run at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity/runs/62sdl4ys
176
+ Starting training...
177
+ Switching attention mode for step 1: dense (dense step interval)
178
+ Step 10/44000 | Loss: nan | LR: 6.67e-06 | 11545.3ms/step | 1.7 samples/s
179
+ Step 20/44000 | Loss: nan | LR: 1.33e-05 | 3436.3ms/step | 5.8 samples/s
180
+ Step 30/44000 | Loss: nan | LR: 2.00e-05 | 3431.8ms/step | 5.8 samples/s
181
+ Step 40/44000 | Loss: nan | LR: 2.67e-05 | 3424.7ms/step | 5.8 samples/s
182
+ Step 50/44000 | Loss: nan | LR: 3.33e-05 | 3426.9ms/step | 5.8 samples/s
183
+ W0722 22:22:59.300000 237 site-packages/torch/distributed/elastic/agent/server/api.py:739] Received 15 death signal, shutting down workers
184
+ W0722 22:22:59.302000 237 site-packages/torch/distributed/elastic/multiprocessing/api.py:1012] Sending process 535 closing signal SIGTERM
185
+ Traceback (most recent call last):
186
+ File "/mloscratch/homes/navasard/conda/bin/torchrun", line 6, in <module>
187
+ sys.exit(main())
188
+ ~~~~^^
189
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 362, in wrapper
190
+ return f(*args, **kwargs)
191
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/run.py", line 990, in main
192
+ run(args)
193
+ ~~~^^^^^^
194
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/run.py", line 981, in run
195
+ elastic_launch(
196
+ ~~~~~~~~~~~~~~~
197
+ config=config,
198
+ ~~~~~~~~~~~~~~
199
+ entrypoint=cmd,
200
+ ~~~~~~~~~~~~~~~
201
+ )(*cmd_args)
202
+ ~^^^^^^^^^^^
203
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/launcher/api.py", line 170, in __call__
204
+ return launch_agent(self._config, self._entrypoint, list(args))
205
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/launcher/api.py", line 308, in launch_agent
206
+ result = agent.run()
207
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/metrics/api.py", line 134, in wrapper
208
+ result = f(*args, **kwargs)
209
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/agent/server/api.py", line 731, in run
210
+ result = self._invoke_run(role)
211
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/agent/server/api.py", line 908, in _invoke_run
212
+ time.sleep(monitor_interval)
213
+ ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
214
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/multiprocessing/api.py", line 86, in _terminate_process_handler
215
+ raise SignalException(f"Process {os.getpid()} got signal: {sigval}", sigval=sigval)
216
+ torch.distributed.elastic.multiprocessing.api.SignalException: Process 237 got signal: 15
epfl_final/train_logs/dense8k365m_s44.run.log.REPRO_NAN_20260722T222840Z ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ New run: Checkpoints will be saved to /mloscratch/homes/navasard/sparse/checkpoints/l8k365m_dense_seed44/run_20260722_222547
2
+ Running config:
3
+ {
4
+ "model_path": "/mloscratch/homes/navasard/qwen3_06b_base",
5
+ "model_dtype": "bfloat16",
6
+ "init_from_scratch": true,
7
+ "train_path": "/mloscratch/homes/navasard/data/fineweb_large/tokenized",
8
+ "val_path": null,
9
+ "max_seq_length": 8192,
10
+ "num_workers": 8,
11
+ "output_dir": "/mloscratch/homes/navasard/sparse/checkpoints/l8k365m_dense_seed44/run_20260722_222547",
12
+ "resume_from_checkpoint": null,
13
+ "force_new_run": false,
14
+ "num_epochs": 1,
15
+ "max_steps": 44000,
16
+ "per_device_batch_size": 2,
17
+ "gradient_accumulation_steps": 10,
18
+ "learning_rate": 0.0005,
19
+ "weight_decay": 0.01,
20
+ "warmup_steps": 750,
21
+ "lr_scheduler": "cosine",
22
+ "max_grad_norm": 1.0,
23
+ "save_steps": 1000,
24
+ "eval_steps": 250,
25
+ "eval_batches": 50,
26
+ "logging_steps": 10,
27
+ "seed": 44,
28
+ "verbose": true,
29
+ "checkpoint_activations": false,
30
+ "strategy": "ddp",
31
+ "mixed_precision": "bf16",
32
+ "wandb_enabled": true,
33
+ "wandb_project": "stochastic_sparsity",
34
+ "wandb_name": "365m dense 8k seed44",
35
+ "wandb_tags": [
36
+ "qwen3",
37
+ "365m",
38
+ "8k",
39
+ "dense",
40
+ "seed44",
41
+ "multiseed"
42
+ ],
43
+ "hidden_size": 768,
44
+ "intermediate_size": 3072,
45
+ "num_attention_heads": 6,
46
+ "num_key_value_heads": 2,
47
+ "num_hidden_layers": 28,
48
+ "head_dim": null,
49
+ "attention_type": "sparse_stochastic",
50
+ "sparse_block_size": 128,
51
+ "sparse_num_random_blocks": 31,
52
+ "sparse_mask_pool_size": 1,
53
+ "sparse_val_dense_compare": false,
54
+ "sparse_layer_indices": null,
55
+ "sparse_mask_cache_dir": null,
56
+ "sparse_mask_seed": 0,
57
+ "sparse_mixed_nrb_set": null,
58
+ "dense_mode": true,
59
+ "dense_step_intervals": null,
60
+ "moba_block_size": 128,
61
+ "moba_top_k": 32,
62
+ "asentmax_alpha": 1.5,
63
+ "asentmax_learn_temp": true,
64
+ "asentmax_init_temp": 1.0
65
+ }
66
+ Loading tokenizer from /mloscratch/homes/navasard/qwen3_06b_base...
67
+ Initializing model from scratch (random weights)...
68
+ Checkpoint activations: False
69
+ dense_mode=True: sparse attention layers will use standard causal SDPA.
70
+
71
+
72
+ ================================================================================
73
+ MODEL ARCHITECTURE
74
+ ================================================================================
75
+ Model config:
76
+ vocab_size: 151936
77
+ hidden_size: 768
78
+ num_hidden_layers: 28
79
+ num_attention_heads: 6
80
+ num_key_value_heads: 2
81
+ head_dim: 128
82
+ intermediate_size: 3072
83
+ max_position_embeddings: 32768
84
+ rope_theta: 1000000
85
+ attention_type: sparse_stochastic
86
+ sparse_block_size: 128
87
+ sparse_num_random_blocks: 31
88
+ sparse_mask_pool_size: 1
89
+ sparse_max_seq_length: 8192
90
+
91
+ Parameter count:
92
+ Total parameters: 358,958,848
93
+ Trainable parameters: 358,958,848
94
+ Non-trainable parameters: 0
95
+ Model size (BF16): 0.72 GB
96
+
97
+ --------------------------------------------------------------------------------
98
+ LAYER-BY-LAYER SUMMARY
99
+ --------------------------------------------------------------------------------
100
+ ================================================================================================================================================================
101
+ Layer (type:depth-idx) Input Shape Output Shape Param # Trainable
102
+ ================================================================================================================================================================
103
+ Qwen3ForCausalLM [2, 8192] -- -- True
104
+ ├─Qwen3Model: 1-1 -- [2, 8192, 768] -- True
105
+ │ └─Embedding: 2-1 [2, 8192] [2, 8192, 768] 116,686,848 True
106
+ │ └─ModuleList: 2-2 -- -- -- True
107
+ │ │ └─Qwen3DecoderLayer: 3-1 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
108
+ │ │ └─Qwen3DecoderLayer: 3-2 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
109
+ │ │ └─Qwen3DecoderLayer: 3-3 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
110
+ │ │ └─Qwen3DecoderLayer: 3-4 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
111
+ │ │ └─Qwen3DecoderLayer: 3-5 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
112
+ │ │ └─Qwen3DecoderLayer: 3-6 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
113
+ │ │ └─Qwen3DecoderLayer: 3-7 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
114
+ │ │ └─Qwen3DecoderLayer: 3-8 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
115
+ │ │ └─Qwen3DecoderLayer: 3-9 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
116
+ │ │ └─Qwen3DecoderLayer: 3-10 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
117
+ │ │ └─Qwen3DecoderLayer: 3-11 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
118
+ │ │ └─Qwen3DecoderLayer: 3-12 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
119
+ │ │ └─Qwen3DecoderLayer: 3-13 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
120
+ │ │ └─Qwen3DecoderLayer: 3-14 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
121
+ │ │ └─Qwen3DecoderLayer: 3-15 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
122
+ │ │ └─Qwen3DecoderLayer: 3-16 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
123
+ │ │ └─Qwen3DecoderLayer: 3-17 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
124
+ │ │ └─Qwen3DecoderLayer: 3-18 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
125
+ │ │ └─Qwen3DecoderLayer: 3-19 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
126
+ │ │ └─Qwen3DecoderLayer: 3-20 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
127
+ │ │ └─Qwen3DecoderLayer: 3-21 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
128
+ │ │ └─Qwen3DecoderLayer: 3-22 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
129
+ │ │ └─Qwen3DecoderLayer: 3-23 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
130
+ │ │ └─Qwen3DecoderLayer: 3-24 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
131
+ │ │ └─Qwen3DecoderLayer: 3-25 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
132
+ │ │ └─Qwen3DecoderLayer: 3-26 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
133
+ │ │ └─Qwen3DecoderLayer: 3-27 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
134
+ │ │ └─Qwen3DecoderLayer: 3-28 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
135
+ │ └─Qwen3RMSNorm: 2-3 [2, 8192, 768] [2, 8192, 768] 768 True
136
+ ├─Linear: 1-2 [2, 8192, 768] [2, 8192, 151936] 116,686,848 True
137
+ ================================================================================================================================================================
138
+ Total params: 475,645,696
139
+ Trainable params: 475,645,696
140
+ Non-trainable params: 0
141
+ Total mult-adds (Units.MEGABYTES): 951.29
142
+ ================================================================================================================================================================
143
+ Input size (MB): 0.13
144
+ Forward/backward pass size (MB): 31197.23
145
+ Params size (MB): 951.29
146
+ Estimated Total Size (MB): 32148.66
147
+ ================================================================================================================================================================
148
+ NOTE: torchinfo double-counts tied embed_tokens/lm_head weight (116,686,848 params). True unique parameter count: 358,958,848 (359.0M)
149
+ ================================================================================
150
+
151
+ Loading dataset from /mloscratch/homes/navasard/data/fineweb_large/tokenized...
152
+ Using pre-tokenized dataset (no runtime tokenization)
153
+ Loading pre-tokenized HF dataset from /mloscratch/homes/navasard/data/fineweb_large/tokenized...
154
+ Loaded 12748481 pre-tokenized examples (stored_len=2048, pack_factor=4, packed_examples=3187120)
155
+ Dataset split: 3027764 train, 159356 validation
156
+ Training examples (packed, train split): 3027764
157
+ Validation examples (packed, val split): 159356
158
+ Per-device batch size: 2
159
+ World size (GPUs): 1
160
+ Gradient accumulation steps: 10
161
+ Effective batch size (seqs/step): 20
162
+ Sequence length: 8192
163
+ Tokens per optimizer step: 163,840
164
+ Micro-batches per epoch (per rank): 1513882
165
+ Optimizer steps per epoch: 151388
166
+ Total optimizer steps: 44000 (capped by max_steps; 0.29 epochs)
167
+ wandb: [wandb.login()] Loaded credentials for https://api.wandb.ai from WANDB_API_KEY.
168
+ wandb: Currently logged in as: ruben-navasardyan4869 (ruben-navasardyan4869-epfl) to https://api.wandb.ai. Use `wandb login --relogin` to force relogin
169
+ wandb: setting up run yus9oo3t
170
+ wandb: Tracking run with wandb version 0.26.1
171
+ wandb: Run data is saved locally in /mloscratch/homes/navasard/sparse/SparseAtt-baselines/wandb/run-20260722_222615-yus9oo3t
172
+ wandb: Run `wandb offline` to turn off syncing.
173
+ wandb: Syncing run 365m dense 8k seed44
174
+ wandb: ⭐️ View project at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity
175
+ wandb: 🚀 View run at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity/runs/yus9oo3t
176
+ Starting training...
177
+ Switching attention mode for step 1: dense (dense step interval)
178
+ Step 10/44000 | Loss: nan | LR: 6.67e-06 | 4618.6ms/step | 4.3 samples/s
179
+ Step 20/44000 | Loss: nan | LR: 1.33e-05 | 3682.9ms/step | 5.4 samples/s
180
+ Step 30/44000 | Loss: nan | LR: 2.00e-05 | 3687.9ms/step | 5.4 samples/s
181
+ W0722 22:28:35.485000 3997 site-packages/torch/distributed/elastic/agent/server/api.py:739] Received 15 death signal, shutting down workers
182
+ W0722 22:28:35.502000 3997 site-packages/torch/distributed/elastic/multiprocessing/api.py:1012] Sending process 4071 closing signal SIGTERM
183
+ Traceback (most recent call last):
184
+ File "/mloscratch/homes/navasard/conda/bin/torchrun", line 6, in <module>
185
+ sys.exit(main())
186
+ ~~~~^^
187
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 362, in wrapper
188
+ return f(*args, **kwargs)
189
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/run.py", line 990, in main
190
+ run(args)
191
+ ~~~^^^^^^
192
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/run.py", line 981, in run
193
+ elastic_launch(
194
+ ~~~~~~~~~~~~~~~
195
+ config=config,
196
+ ~~~~~~~~~~~~~~
197
+ entrypoint=cmd,
198
+ ~~~~~~~~~~~~~~~
199
+ )(*cmd_args)
200
+ ~^^^^^^^^^^^
201
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/launcher/api.py", line 170, in __call__
202
+ return launch_agent(self._config, self._entrypoint, list(args))
203
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/launcher/api.py", line 308, in launch_agent
204
+ result = agent.run()
205
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/metrics/api.py", line 134, in wrapper
206
+ result = f(*args, **kwargs)
207
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/agent/server/api.py", line 731, in run
208
+ result = self._invoke_run(role)
209
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/agent/server/api.py", line 908, in _invoke_run
210
+ time.sleep(monitor_interval)
211
+ ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
212
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/multiprocessing/api.py", line 86, in _terminate_process_handler
213
+ raise SignalException(f"Process {os.getpid()} got signal: {sigval}", sigval=sigval)
214
+ torch.distributed.elastic.multiprocessing.api.SignalException: Process 3997 got signal: 15
epfl_final/train_logs/dense8k365m_s44.supervisor.log ADDED
File without changes
epfl_final/train_logs/dense8k365m_s44.watch.log ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ 2026-07-22T22:17:37Z watchdog start pid=162
2
+ 2026-07-22T22:17:37Z launch GPUs=1 nproc=1 latest_step=
3
+ 2026-07-22T22:25:38Z watchdog start pid=3978
4
+ 2026-07-22T22:25:38Z launch GPUs=1 nproc=1 latest_step=
5
+ 2026-07-22T22:39:25Z watchdog start pid=143
6
+ 2026-07-22T22:39:25Z launch GPUs=0 nproc=1 latest_step=
7
+ 2026-07-24T22:15:31Z complete latest_step=44000
epfl_final/train_logs/dense8k365m_s44.watchdog.log ADDED
File without changes
epfl_final/train_logs/dense8k365m_s45.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/dense8k365m_s45.supervisor.log ADDED
File without changes
epfl_final/train_logs/dense8k365m_s45.watch.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 2026-07-22T22:17:37Z watchdog start pid=164
2
+ 2026-07-22T22:17:37Z launch GPUs=2 nproc=1 latest_step=
3
+ 2026-07-24T22:38:52Z complete latest_step=44000
epfl_final/train_logs/dense8k365m_s46.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/dense8k365m_s46.run.log.GPU1_NAN_20260722T223303Z ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ New run: Checkpoints will be saved to /mloscratch/homes/navasard/sparse/checkpoints/l8k365m_dense_seed46/run_20260722_222917
2
+ Running config:
3
+ {
4
+ "model_path": "/mloscratch/homes/navasard/qwen3_06b_base",
5
+ "model_dtype": "bfloat16",
6
+ "init_from_scratch": true,
7
+ "train_path": "/mloscratch/homes/navasard/data/fineweb_large/tokenized",
8
+ "val_path": null,
9
+ "max_seq_length": 8192,
10
+ "num_workers": 8,
11
+ "output_dir": "/mloscratch/homes/navasard/sparse/checkpoints/l8k365m_dense_seed46/run_20260722_222917",
12
+ "resume_from_checkpoint": null,
13
+ "force_new_run": false,
14
+ "num_epochs": 1,
15
+ "max_steps": 44000,
16
+ "per_device_batch_size": 2,
17
+ "gradient_accumulation_steps": 10,
18
+ "learning_rate": 0.0005,
19
+ "weight_decay": 0.01,
20
+ "warmup_steps": 750,
21
+ "lr_scheduler": "cosine",
22
+ "max_grad_norm": 1.0,
23
+ "save_steps": 1000,
24
+ "eval_steps": 250,
25
+ "eval_batches": 50,
26
+ "logging_steps": 10,
27
+ "seed": 46,
28
+ "verbose": true,
29
+ "checkpoint_activations": false,
30
+ "strategy": "ddp",
31
+ "mixed_precision": "bf16",
32
+ "wandb_enabled": true,
33
+ "wandb_project": "stochastic_sparsity",
34
+ "wandb_name": "365m dense 8k seed46",
35
+ "wandb_tags": [
36
+ "qwen3",
37
+ "365m",
38
+ "8k",
39
+ "dense",
40
+ "seed46",
41
+ "multiseed",
42
+ "replacement"
43
+ ],
44
+ "hidden_size": 768,
45
+ "intermediate_size": 3072,
46
+ "num_attention_heads": 6,
47
+ "num_key_value_heads": 2,
48
+ "num_hidden_layers": 28,
49
+ "head_dim": null,
50
+ "attention_type": "sparse_stochastic",
51
+ "sparse_block_size": 128,
52
+ "sparse_num_random_blocks": 31,
53
+ "sparse_mask_pool_size": 1,
54
+ "sparse_val_dense_compare": false,
55
+ "sparse_layer_indices": null,
56
+ "sparse_mask_cache_dir": null,
57
+ "sparse_mask_seed": 0,
58
+ "sparse_mixed_nrb_set": null,
59
+ "dense_mode": true,
60
+ "dense_step_intervals": null,
61
+ "moba_block_size": 128,
62
+ "moba_top_k": 32,
63
+ "asentmax_alpha": 1.5,
64
+ "asentmax_learn_temp": true,
65
+ "asentmax_init_temp": 1.0
66
+ }
67
+ Loading tokenizer from /mloscratch/homes/navasard/qwen3_06b_base...
68
+ Initializing model from scratch (random weights)...
69
+ Checkpoint activations: False
70
+ dense_mode=True: sparse attention layers will use standard causal SDPA.
71
+
72
+
73
+ ================================================================================
74
+ MODEL ARCHITECTURE
75
+ ================================================================================
76
+ Model config:
77
+ vocab_size: 151936
78
+ hidden_size: 768
79
+ num_hidden_layers: 28
80
+ num_attention_heads: 6
81
+ num_key_value_heads: 2
82
+ head_dim: 128
83
+ intermediate_size: 3072
84
+ max_position_embeddings: 32768
85
+ rope_theta: 1000000
86
+ attention_type: sparse_stochastic
87
+ sparse_block_size: 128
88
+ sparse_num_random_blocks: 31
89
+ sparse_mask_pool_size: 1
90
+ sparse_max_seq_length: 8192
91
+
92
+ Parameter count:
93
+ Total parameters: 358,958,848
94
+ Trainable parameters: 358,958,848
95
+ Non-trainable parameters: 0
96
+ Model size (BF16): 0.72 GB
97
+
98
+ --------------------------------------------------------------------------------
99
+ LAYER-BY-LAYER SUMMARY
100
+ --------------------------------------------------------------------------------
101
+ ================================================================================================================================================================
102
+ Layer (type:depth-idx) Input Shape Output Shape Param # Trainable
103
+ ================================================================================================================================================================
104
+ Qwen3ForCausalLM [2, 8192] -- -- True
105
+ ├─Qwen3Model: 1-1 -- [2, 8192, 768] -- True
106
+ │ └─Embedding: 2-1 [2, 8192] [2, 8192, 768] 116,686,848 True
107
+ │ └─ModuleList: 2-2 -- -- -- True
108
+ │ │ └─Qwen3DecoderLayer: 3-1 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
109
+ │ │ └─Qwen3DecoderLayer: 3-2 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
110
+ │ │ └─Qwen3DecoderLayer: 3-3 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
111
+ │ │ └─Qwen3DecoderLayer: 3-4 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
112
+ │ │ └─Qwen3DecoderLayer: 3-5 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
113
+ │ │ └─Qwen3DecoderLayer: 3-6 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
114
+ │ │ └─Qwen3DecoderLayer: 3-7 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
115
+ │ │ └─Qwen3DecoderLayer: 3-8 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
116
+ │ │ └─Qwen3DecoderLayer: 3-9 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
117
+ │ │ └─Qwen3DecoderLayer: 3-10 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
118
+ │ │ └─Qwen3DecoderLayer: 3-11 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
119
+ │ │ └─Qwen3DecoderLayer: 3-12 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
120
+ │ │ └─Qwen3DecoderLayer: 3-13 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
121
+ │ │ └─Qwen3DecoderLayer: 3-14 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
122
+ │ │ └─Qwen3DecoderLayer: 3-15 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
123
+ │ │ └─Qwen3DecoderLayer: 3-16 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
124
+ │ │ └─Qwen3DecoderLayer: 3-17 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
125
+ │ │ └─Qwen3DecoderLayer: 3-18 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
126
+ │ │ └─Qwen3DecoderLayer: 3-19 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
127
+ │ │ └─Qwen3DecoderLayer: 3-20 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
128
+ │ │ └─Qwen3DecoderLayer: 3-21 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
129
+ │ │ └─Qwen3DecoderLayer: 3-22 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
130
+ │ │ └─Qwen3DecoderLayer: 3-23 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
131
+ │ │ └─Qwen3DecoderLayer: 3-24 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
132
+ │ │ └─Qwen3DecoderLayer: 3-25 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
133
+ │ │ └─Qwen3DecoderLayer: 3-26 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
134
+ │ │ └─Qwen3DecoderLayer: 3-27 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
135
+ │ │ └─Qwen3DecoderLayer: 3-28 [2, 8192, 768] [2, 8192, 768] 8,652,544 True
136
+ │ └─Qwen3RMSNorm: 2-3 [2, 8192, 768] [2, 8192, 768] 768 True
137
+ ├─Linear: 1-2 [2, 8192, 768] [2, 8192, 151936] 116,686,848 True
138
+ ================================================================================================================================================================
139
+ Total params: 475,645,696
140
+ Trainable params: 475,645,696
141
+ Non-trainable params: 0
142
+ Total mult-adds (Units.MEGABYTES): 951.29
143
+ ================================================================================================================================================================
144
+ Input size (MB): 0.13
145
+ Forward/backward pass size (MB): 31197.23
146
+ Params size (MB): 951.29
147
+ Estimated Total Size (MB): 32148.66
148
+ ================================================================================================================================================================
149
+ NOTE: torchinfo double-counts tied embed_tokens/lm_head weight (116,686,848 params). True unique parameter count: 358,958,848 (359.0M)
150
+ ================================================================================
151
+
152
+ Loading dataset from /mloscratch/homes/navasard/data/fineweb_large/tokenized...
153
+ Using pre-tokenized dataset (no runtime tokenization)
154
+ Loading pre-tokenized HF dataset from /mloscratch/homes/navasard/data/fineweb_large/tokenized...
155
+ Loaded 12748481 pre-tokenized examples (stored_len=2048, pack_factor=4, packed_examples=3187120)
156
+ Dataset split: 3027764 train, 159356 validation
157
+ Training examples (packed, train split): 3027764
158
+ Validation examples (packed, val split): 159356
159
+ Per-device batch size: 2
160
+ World size (GPUs): 1
161
+ Gradient accumulation steps: 10
162
+ Effective batch size (seqs/step): 20
163
+ Sequence length: 8192
164
+ Tokens per optimizer step: 163,840
165
+ Micro-batches per epoch (per rank): 1513882
166
+ Optimizer steps per epoch: 151388
167
+ Total optimizer steps: 44000 (capped by max_steps; 0.29 epochs)
168
+ wandb: [wandb.login()] Loaded credentials for https://api.wandb.ai from WANDB_API_KEY.
169
+ wandb: Currently logged in as: ruben-navasardyan4869 (ruben-navasardyan4869-epfl) to https://api.wandb.ai. Use `wandb login --relogin` to force relogin
170
+ wandb: Tracking run with wandb version 0.26.1
171
+ wandb: Run data is saved locally in /mloscratch/homes/navasard/sparse/SparseAtt-baselines/wandb/run-20260722_222942-xnsczozs
172
+ wandb: Run `wandb offline` to turn off syncing.
173
+ wandb: Syncing run 365m dense 8k seed46
174
+ wandb: ⭐️ View project at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity
175
+ wandb: 🚀 View run at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity/runs/xnsczozs
176
+ Starting training...
177
+ Switching attention mode for step 1: dense (dense step interval)
178
+ Step 10/44000 | Loss: nan | LR: 6.67e-06 | 4519.0ms/step | 4.4 samples/s
179
+ Step 20/44000 | Loss: nan | LR: 1.33e-05 | 3693.3ms/step | 5.4 samples/s
180
+ Step 30/44000 | Loss: nan | LR: 2.00e-05 | 3699.0ms/step | 5.4 samples/s
181
+ W0722 22:31:55.321000 4881 site-packages/torch/distributed/elastic/agent/server/api.py:739] Received 15 death signal, shutting down workers
182
+ W0722 22:31:55.324000 4881 site-packages/torch/distributed/elastic/multiprocessing/api.py:1012] Sending process 4988 closing signal SIGTERM
183
+ Traceback (most recent call last):
184
+ File "/mloscratch/homes/navasard/conda/bin/torchrun", line 6, in <module>
185
+ sys.exit(main())
186
+ ~~~~^^
187
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/multiprocessing/errors/__init__.py", line 362, in wrapper
188
+ return f(*args, **kwargs)
189
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/run.py", line 990, in main
190
+ run(args)
191
+ ~~~^^^^^^
192
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/run.py", line 981, in run
193
+ elastic_launch(
194
+ ~~~~~~~~~~~~~~~
195
+ config=config,
196
+ ~~~~~~~~~~~~~~
197
+ entrypoint=cmd,
198
+ ~~~~~~~~~~~~~~~
199
+ )(*cmd_args)
200
+ ~^^^^^^^^^^^
201
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/launcher/api.py", line 170, in __call__
202
+ return launch_agent(self._config, self._entrypoint, list(args))
203
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/launcher/api.py", line 308, in launch_agent
204
+ result = agent.run()
205
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/metrics/api.py", line 134, in wrapper
206
+ result = f(*args, **kwargs)
207
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/agent/server/api.py", line 731, in run
208
+ result = self._invoke_run(role)
209
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/agent/server/api.py", line 908, in _invoke_run
210
+ time.sleep(monitor_interval)
211
+ ~~~~~~~~~~^^^^^^^^^^^^^^^^^^
212
+ File "/mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/distributed/elastic/multiprocessing/api.py", line 86, in _terminate_process_handler
213
+ raise SignalException(f"Process {os.getpid()} got signal: {sigval}", sigval=sigval)
214
+ torch.distributed.elastic.multiprocessing.api.SignalException: Process 4881 got signal: 15
epfl_final/train_logs/dense8k365m_s46.watch.log ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ 2026-07-22T22:29:06Z watchdog start pid=4862
2
+ 2026-07-22T22:29:06Z launch GPUs=1 nproc=1 latest_step=
3
+ 2026-07-22T22:29:29Z watchdog start pid=5132
4
+ 2026-07-22T22:39:25Z watchdog start pid=144
5
+ 2026-07-22T22:39:25Z launch GPUs=1 nproc=1 latest_step=
6
+ 2026-07-24T22:43:33Z complete latest_step=44000
epfl_final/train_logs/dense8k365m_s46.watchdog.log ADDED
File without changes
epfl_final/train_logs/launch_3b_dense_resume.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -eu
3
+
4
+ GPU_COUNT="${1:?usage: launch_3b_dense_resume.sh <4|5|6>}"
5
+ BASE=/mloscratch/homes/navasard/sparse
6
+ WATCHDOG="$BASE/train_logs/watchdog_mixed_training.sh"
7
+
8
+ case "$GPU_COUNT" in
9
+ 4)
10
+ CFG=configs/ladder8k/dense_3b_60b.json
11
+ GPUSET=0,1,2,3
12
+ ;;
13
+ 5)
14
+ CFG=configs/ladder8k/dense_3b_60b_5gpu.json
15
+ GPUSET=0,1,2,3,4
16
+ ;;
17
+ 6)
18
+ CFG=configs/ladder8k/dense_3b_60b_6gpu.json
19
+ GPUSET=0,1,2,3,4,5
20
+ ;;
21
+ *)
22
+ echo "GPU count must be 4, 5, or 6" >&2
23
+ exit 2
24
+ ;;
25
+ esac
26
+
27
+ rm -f "$BASE/train_logs/dense8k3b_60b.lock"
28
+ nohup "$WATCHDOG" dense8k3b_60b \
29
+ "$CFG" \
30
+ "$BASE/checkpoints/l8k3b_dense_60b" \
31
+ 122070 "$GPUSET" "$GPU_COUNT" \
32
+ > "$BASE/train_logs/dense8k3b_60b.supervisor.log" 2>&1 < /dev/null &
33
+
34
+ echo "dense8k3b_60b resume watchdog pid=$! GPUs=$GPU_COUNT config=$CFG"
epfl_final/train_logs/launch_3b_mixed.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -eu
3
+
4
+ GPU_COUNT="${1:?usage: launch_3b_mixed.sh <4|5|6>}"
5
+ BASE=/mloscratch/homes/navasard/sparse
6
+ WATCHDOG="$BASE/train_logs/watchdog_mixed_training.sh"
7
+
8
+ case "$GPU_COUNT" in
9
+ 4)
10
+ CFG=configs/ladder8k/mixed_3b_60b.json
11
+ GPUSET=0,1,2,3
12
+ ;;
13
+ 5)
14
+ CFG=configs/ladder8k/mixed_3b_60b_5gpu.json
15
+ GPUSET=0,1,2,3,4
16
+ ;;
17
+ 6)
18
+ CFG=configs/ladder8k/mixed_3b_60b_6gpu.json
19
+ GPUSET=0,1,2,3,4,5
20
+ ;;
21
+ *)
22
+ echo "GPU count must be 4, 5, or 6" >&2
23
+ exit 2
24
+ ;;
25
+ esac
26
+
27
+ rm -f "$BASE/train_logs/mixed8k3b_60b.lock"
28
+ nohup "$WATCHDOG" mixed8k3b_60b \
29
+ "$CFG" \
30
+ "$BASE/checkpoints/l8k3b_mixed_60b" \
31
+ 122070 "$GPUSET" "$GPU_COUNT" \
32
+ > "$BASE/train_logs/mixed8k3b_60b.supervisor.log" 2>&1 < /dev/null &
33
+
34
+ echo "mixed8k3b_60b watchdog pid=$! GPUs=$GPU_COUNT config=$CFG"
epfl_final/train_logs/mixed30k1p2b_s42.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/mixed30k1p2b_s42.supervisor.log ADDED
File without changes
epfl_final/train_logs/mixed30k1p2b_s42.watch.log ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-21T05:57:01Z watchdog start pid=15034
2
+ 2026-07-21T05:57:01Z launch GPUs=0,1,2,3 nproc=4 latest_step=
3
+ 2026-07-21T18:02:27Z watchdog start pid=128
4
+ 2026-07-21T18:02:27Z launch GPUs=0,1,2,3 nproc=4 latest_step=2700
5
+ 2026-07-22T01:28:12Z watchdog start pid=144
6
+ 2026-07-22T01:28:12Z launch GPUs=0,1,2,3 nproc=4 latest_step=5100
7
+ 2026-07-24T17:55:47Z watchdog start pid=167
8
+ 2026-07-24T17:55:47Z launch GPUs=0,1,2,3 nproc=4 latest_step=29400
9
+ 2026-07-25T05:52:00Z watchdog start pid=153
10
+ 2026-07-25T05:52:01Z launch GPUs=0,1,2,3 nproc=4 latest_step=33600
11
+ 2026-07-25T06:02:32Z watchdog start pid=3407
12
+ 2026-07-25T06:02:32Z launch GPUs=0,1,2,3 nproc=4 latest_step=33600
13
+ 2026-07-25T06:24:56Z watchdog start pid=142
14
+ 2026-07-25T06:24:56Z launch GPUs=0,1,2,3 nproc=4 latest_step=33600
15
+ 2026-07-25T07:48:02Z process absent for 5 minutes; relaunching
16
+ 2026-07-25T07:48:02Z launch GPUs=0,1,2,3 nproc=4 latest_step=33600
17
+ 2026-07-25T17:20:50Z watchdog start pid=145
18
+ 2026-07-25T17:20:51Z launch GPUs=0,1,2,3 nproc=4 latest_step=36900
19
+ 2026-07-25T19:01:58Z complete latest_step=37465
epfl_final/train_logs/mixed30k365m_s43.run.log.INTERRUPTED_STEP40_20260722T225915Z ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ New run: Checkpoints will be saved to /mloscratch/homes/navasard/sparse/checkpoints/l30k365m_mixed_seed43/run_20260722_221751
2
+ Running config:
3
+ {
4
+ "model_path": "/mloscratch/homes/navasard/qwen3_06b_base",
5
+ "model_dtype": "bfloat16",
6
+ "init_from_scratch": true,
7
+ "train_path": "/mloscratch/homes/navasard/data/longctx30k/tokenized",
8
+ "val_path": null,
9
+ "max_seq_length": 30720,
10
+ "num_workers": 8,
11
+ "output_dir": "/mloscratch/homes/navasard/sparse/checkpoints/l30k365m_mixed_seed43/run_20260722_221751",
12
+ "resume_from_checkpoint": null,
13
+ "force_new_run": false,
14
+ "num_epochs": 1,
15
+ "max_steps": 11700,
16
+ "per_device_batch_size": 1,
17
+ "gradient_accumulation_steps": 20,
18
+ "learning_rate": 0.0005,
19
+ "weight_decay": 0.01,
20
+ "warmup_steps": 750,
21
+ "lr_scheduler": "cosine",
22
+ "max_grad_norm": 1.0,
23
+ "save_steps": 1000,
24
+ "eval_steps": 250,
25
+ "eval_batches": 50,
26
+ "logging_steps": 10,
27
+ "seed": 43,
28
+ "verbose": true,
29
+ "checkpoint_activations": false,
30
+ "strategy": "ddp",
31
+ "mixed_precision": "bf16",
32
+ "wandb_enabled": true,
33
+ "wandb_project": "stochastic_sparsity",
34
+ "wandb_name": "365m mixed 30k seed43",
35
+ "wandb_tags": [
36
+ "qwen3",
37
+ "365m",
38
+ "30k",
39
+ "mixed",
40
+ "native",
41
+ "seed43",
42
+ "multiseed"
43
+ ],
44
+ "hidden_size": 768,
45
+ "intermediate_size": 3072,
46
+ "num_attention_heads": 6,
47
+ "num_key_value_heads": 2,
48
+ "num_hidden_layers": 28,
49
+ "head_dim": null,
50
+ "attention_type": "sparse_stochastic",
51
+ "sparse_block_size": 128,
52
+ "sparse_num_random_blocks": 120,
53
+ "sparse_mask_pool_size": 1000,
54
+ "sparse_val_dense_compare": false,
55
+ "sparse_layer_indices": null,
56
+ "sparse_mask_cache_dir": "/mloscratch/homes/navasard/sparse/mask_cache_30k_365m_mixed_seed42",
57
+ "sparse_mask_seed": 42,
58
+ "sparse_mixed_nrb_set": [
59
+ 239,
60
+ 179,
61
+ 120,
62
+ 79,
63
+ 39
64
+ ],
65
+ "dense_mode": false,
66
+ "dense_step_intervals": null,
67
+ "moba_block_size": 128,
68
+ "moba_top_k": 32,
69
+ "asentmax_alpha": 1.5,
70
+ "asentmax_learn_temp": true,
71
+ "asentmax_init_temp": 1.0
72
+ }
73
+ Loading tokenizer from /mloscratch/homes/navasard/qwen3_06b_base...
74
+ Initializing model from scratch (random weights)...
75
+ Checkpoint activations: False
76
+
77
+
78
+ ================================================================================
79
+ MODEL ARCHITECTURE
80
+ ================================================================================
81
+ Model config:
82
+ vocab_size: 151936
83
+ hidden_size: 768
84
+ num_hidden_layers: 28
85
+ num_attention_heads: 6
86
+ num_key_value_heads: 2
87
+ head_dim: 128
88
+ intermediate_size: 3072
89
+ max_position_embeddings: 32768
90
+ rope_theta: 1000000
91
+ attention_type: sparse_stochastic
92
+ sparse_block_size: 128
93
+ sparse_num_random_blocks: 120
94
+ sparse_mask_pool_size: 1000
95
+ sparse_max_seq_length: 30720
96
+
97
+ Parameter count:
98
+ Total parameters: 358,958,848
99
+ Trainable parameters: 358,958,848
100
+ Non-trainable parameters: 0
101
+ Model size (BF16): 0.72 GB
102
+
103
+ --------------------------------------------------------------------------------
104
+ LAYER-BY-LAYER SUMMARY
105
+ --------------------------------------------------------------------------------
106
+ /mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/nn/attention/flex_attention.py:1704: UserWarning: flex_attention called without torch.compile() - this will use an unfused implementation that materializes the full scores matrix instead of generating a fused kernel.
107
+
108
+ SOLUTION: Use torch.compile(flex_attention)(...)
109
+
110
+ If you want to debug your score_mod/mask_mod, you can set:
111
+ torch.nn.attention.flex_attention._FLEX_ATTENTION_DISABLE_COMPILE_DEBUG = True
112
+
113
+ This will allow you to use print statements or breakpoints. Note: This doesn't work with the backwards pass and may produce incorrect results.
114
+ _warn_once(
115
+ ================================================================================================================================================================
116
+ Layer (type:depth-idx) Input Shape Output Shape Param # Trainable
117
+ ================================================================================================================================================================
118
+ Qwen3ForCausalLM [1, 30720] -- -- True
119
+ ├─Qwen3Model: 1-1 -- [1, 30720, 768] -- True
120
+ │ └─Embedding: 2-1 [1, 30720] [1, 30720, 768] 116,686,848 True
121
+ │ └─ModuleList: 2-2 -- -- -- True
122
+ │ │ └─Qwen3DecoderLayer: 3-1 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
123
+ │ │ └─Qwen3DecoderLayer: 3-2 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
124
+ │ │ └─Qwen3DecoderLayer: 3-3 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
125
+ │ │ └─Qwen3DecoderLayer: 3-4 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
126
+ │ │ └─Qwen3DecoderLayer: 3-5 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
127
+ │ │ └─Qwen3DecoderLayer: 3-6 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
128
+ │ │ └─Qwen3DecoderLayer: 3-7 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
129
+ │ │ └─Qwen3DecoderLayer: 3-8 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
130
+ │ │ └─Qwen3DecoderLayer: 3-9 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
131
+ │ │ └─Qwen3DecoderLayer: 3-10 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
132
+ │ │ └─Qwen3DecoderLayer: 3-11 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
133
+ │ │ └─Qwen3DecoderLayer: 3-12 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
134
+ │ │ └─Qwen3DecoderLayer: 3-13 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
135
+ │ │ └─Qwen3DecoderLayer: 3-14 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
136
+ │ │ └─Qwen3DecoderLayer: 3-15 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
137
+ │ │ └─Qwen3DecoderLayer: 3-16 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
138
+ │ │ └─Qwen3DecoderLayer: 3-17 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
139
+ │ │ └─Qwen3DecoderLayer: 3-18 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
140
+ │ │ └─Qwen3DecoderLayer: 3-19 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
141
+ │ │ └─Qwen3DecoderLayer: 3-20 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
142
+ │ │ └─Qwen3DecoderLayer: 3-21 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
143
+ │ │ └─Qwen3DecoderLayer: 3-22 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
144
+ │ │ └─Qwen3DecoderLayer: 3-23 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
145
+ │ │ └─Qwen3DecoderLayer: 3-24 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
146
+ │ │ └─Qwen3DecoderLayer: 3-25 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
147
+ │ │ └─Qwen3DecoderLayer: 3-26 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
148
+ │ │ └─Qwen3DecoderLayer: 3-27 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
149
+ │ │ └─Qwen3DecoderLayer: 3-28 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
150
+ │ └─Qwen3RMSNorm: 2-3 [1, 30720, 768] [1, 30720, 768] 768 True
151
+ ├─Linear: 1-2 [1, 30720, 768] [1, 30720, 151936] 116,686,848 True
152
+ ================================================================================================================================================================
153
+ Total params: 475,645,696
154
+ Trainable params: 475,645,696
155
+ Non-trainable params: 0
156
+ Total mult-adds (Units.MEGABYTES): 475.65
157
+ ================================================================================================================================================================
158
+ Input size (MB): 0.25
159
+ Forward/backward pass size (MB): 58494.81
160
+ Params size (MB): 951.29
161
+ Estimated Total Size (MB): 59446.35
162
+ ================================================================================================================================================================
163
+ NOTE: torchinfo double-counts tied embed_tokens/lm_head weight (116,686,848 params). True unique parameter count: 358,958,848 (359.0M)
164
+ ================================================================================
165
+
166
+ Loading dataset from /mloscratch/homes/navasard/data/longctx30k/tokenized...
167
+ Using pre-tokenized dataset (no runtime tokenization)
168
+ Loading pre-tokenized HF dataset from /mloscratch/homes/navasard/data/longctx30k/tokenized...
169
+ Loaded 788736 pre-tokenized examples (stored_len=30720, pack_factor=1, packed_examples=788736)
170
+ Dataset split: 749299 train, 39437 validation
171
+ Training examples (packed, train split): 749299
172
+ Validation examples (packed, val split): 39437
173
+ Per-device batch size: 1
174
+ World size (GPUs): 1
175
+ Gradient accumulation steps: 20
176
+ Effective batch size (seqs/step): 20
177
+ Sequence length: 30720
178
+ Tokens per optimizer step: 614,400
179
+ Micro-batches per epoch (per rank): 749299
180
+ Optimizer steps per epoch: 37464
181
+ Total optimizer steps: 11700 (capped by max_steps; 0.31 epochs)
182
+ wandb: [wandb.login()] Loaded credentials for https://api.wandb.ai from WANDB_API_KEY.
183
+ wandb: Currently logged in as: ruben-navasardyan4869 (ruben-navasardyan4869-epfl) to https://api.wandb.ai. Use `wandb login --relogin` to force relogin
184
+ wandb: setting up run x6bzdeb3
185
+ wandb: Tracking run with wandb version 0.26.1
186
+ wandb: Run data is saved locally in /mloscratch/homes/navasard/sparse/SparseAtt-baselines/wandb/run-20260722_221947-x6bzdeb3
187
+ wandb: Run `wandb offline` to turn off syncing.
188
+ wandb: Syncing run 365m mixed 30k seed43
189
+ wandb: ⭐️ View project at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity
190
+ wandb: 🚀 View run at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity/runs/x6bzdeb3
191
+ Starting training...
192
+ Switching attention mode for step 1: sparse_stochastic (configured sparse attention)
193
+ Step 10/11700 | Loss: 12.0641 | LR: 6.67e-06 | 29622.4ms/step | 0.7 samples/s
194
+ Step 20/11700 | Loss: 11.9864 | LR: 1.33e-05 | 23511.1ms/step | 0.9 samples/s
195
+ Step 30/11700 | Loss: 11.7461 | LR: 2.00e-05 | 23295.2ms/step | 0.9 samples/s
196
+ Step 40/11700 | Loss: 11.2480 | LR: 2.67e-05 | 23382.1ms/step | 0.9 samples/s
epfl_final/train_logs/mixed30k365m_s43.supervisor.log ADDED
File without changes
epfl_final/train_logs/mixed30k365m_s43.watch.log ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-22T22:17:37Z watchdog start pid=312
2
+ 2026-07-22T22:17:37Z launch GPUs=2 nproc=1 latest_step=
3
+ 2026-07-22T22:59:15Z watchdog start pid=186
4
+ 2026-07-22T22:59:15Z launch GPUs=2 nproc=1 latest_step=
5
+ 2026-07-24T07:03:34Z watchdog start pid=353
6
+ 2026-07-24T07:03:34Z launch GPUs=2 nproc=1 latest_step=
7
+ 2026-07-24T17:38:52Z watchdog start pid=200
8
+ 2026-07-24T17:38:52Z launch GPUs=2 nproc=1 latest_step=
9
+ 2026-07-25T06:17:28Z watchdog start pid=192
10
+ 2026-07-25T06:17:28Z launch GPUs=2 nproc=1 latest_step=
11
+ 2026-07-25T07:50:01Z process absent for 5 minutes; relaunching
12
+ 2026-07-25T07:50:01Z launch GPUs=2 nproc=1 latest_step=
13
+ 2026-07-25T07:55:02Z process absent for 5 minutes; relaunching
14
+ 2026-07-25T07:55:02Z launch GPUs=2 nproc=1 latest_step=
epfl_final/train_logs/mixed30k365m_s44.run.log.INTERRUPTED_STEP40_20260722T225915Z ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ New run: Checkpoints will be saved to /mloscratch/homes/navasard/sparse/checkpoints/l30k365m_mixed_seed44/run_20260722_221751
2
+ Running config:
3
+ {
4
+ "model_path": "/mloscratch/homes/navasard/qwen3_06b_base",
5
+ "model_dtype": "bfloat16",
6
+ "init_from_scratch": true,
7
+ "train_path": "/mloscratch/homes/navasard/data/longctx30k/tokenized",
8
+ "val_path": null,
9
+ "max_seq_length": 30720,
10
+ "num_workers": 8,
11
+ "output_dir": "/mloscratch/homes/navasard/sparse/checkpoints/l30k365m_mixed_seed44/run_20260722_221751",
12
+ "resume_from_checkpoint": null,
13
+ "force_new_run": false,
14
+ "num_epochs": 1,
15
+ "max_steps": 11700,
16
+ "per_device_batch_size": 1,
17
+ "gradient_accumulation_steps": 20,
18
+ "learning_rate": 0.0005,
19
+ "weight_decay": 0.01,
20
+ "warmup_steps": 750,
21
+ "lr_scheduler": "cosine",
22
+ "max_grad_norm": 1.0,
23
+ "save_steps": 1000,
24
+ "eval_steps": 250,
25
+ "eval_batches": 50,
26
+ "logging_steps": 10,
27
+ "seed": 44,
28
+ "verbose": true,
29
+ "checkpoint_activations": false,
30
+ "strategy": "ddp",
31
+ "mixed_precision": "bf16",
32
+ "wandb_enabled": true,
33
+ "wandb_project": "stochastic_sparsity",
34
+ "wandb_name": "365m mixed 30k seed44",
35
+ "wandb_tags": [
36
+ "qwen3",
37
+ "365m",
38
+ "30k",
39
+ "mixed",
40
+ "native",
41
+ "seed44",
42
+ "multiseed"
43
+ ],
44
+ "hidden_size": 768,
45
+ "intermediate_size": 3072,
46
+ "num_attention_heads": 6,
47
+ "num_key_value_heads": 2,
48
+ "num_hidden_layers": 28,
49
+ "head_dim": null,
50
+ "attention_type": "sparse_stochastic",
51
+ "sparse_block_size": 128,
52
+ "sparse_num_random_blocks": 120,
53
+ "sparse_mask_pool_size": 1000,
54
+ "sparse_val_dense_compare": false,
55
+ "sparse_layer_indices": null,
56
+ "sparse_mask_cache_dir": "/mloscratch/homes/navasard/sparse/mask_cache_30k_365m_mixed_seed42",
57
+ "sparse_mask_seed": 42,
58
+ "sparse_mixed_nrb_set": [
59
+ 239,
60
+ 179,
61
+ 120,
62
+ 79,
63
+ 39
64
+ ],
65
+ "dense_mode": false,
66
+ "dense_step_intervals": null,
67
+ "moba_block_size": 128,
68
+ "moba_top_k": 32,
69
+ "asentmax_alpha": 1.5,
70
+ "asentmax_learn_temp": true,
71
+ "asentmax_init_temp": 1.0
72
+ }
73
+ Loading tokenizer from /mloscratch/homes/navasard/qwen3_06b_base...
74
+ Initializing model from scratch (random weights)...
75
+ Checkpoint activations: False
76
+
77
+
78
+ ================================================================================
79
+ MODEL ARCHITECTURE
80
+ ================================================================================
81
+ Model config:
82
+ vocab_size: 151936
83
+ hidden_size: 768
84
+ num_hidden_layers: 28
85
+ num_attention_heads: 6
86
+ num_key_value_heads: 2
87
+ head_dim: 128
88
+ intermediate_size: 3072
89
+ max_position_embeddings: 32768
90
+ rope_theta: 1000000
91
+ attention_type: sparse_stochastic
92
+ sparse_block_size: 128
93
+ sparse_num_random_blocks: 120
94
+ sparse_mask_pool_size: 1000
95
+ sparse_max_seq_length: 30720
96
+
97
+ Parameter count:
98
+ Total parameters: 358,958,848
99
+ Trainable parameters: 358,958,848
100
+ Non-trainable parameters: 0
101
+ Model size (BF16): 0.72 GB
102
+
103
+ --------------------------------------------------------------------------------
104
+ LAYER-BY-LAYER SUMMARY
105
+ --------------------------------------------------------------------------------
106
+ /mloscratch/homes/navasard/conda/lib/python3.13/site-packages/torch/nn/attention/flex_attention.py:1704: UserWarning: flex_attention called without torch.compile() - this will use an unfused implementation that materializes the full scores matrix instead of generating a fused kernel.
107
+
108
+ SOLUTION: Use torch.compile(flex_attention)(...)
109
+
110
+ If you want to debug your score_mod/mask_mod, you can set:
111
+ torch.nn.attention.flex_attention._FLEX_ATTENTION_DISABLE_COMPILE_DEBUG = True
112
+
113
+ This will allow you to use print statements or breakpoints. Note: This doesn't work with the backwards pass and may produce incorrect results.
114
+ _warn_once(
115
+ ================================================================================================================================================================
116
+ Layer (type:depth-idx) Input Shape Output Shape Param # Trainable
117
+ ================================================================================================================================================================
118
+ Qwen3ForCausalLM [1, 30720] -- -- True
119
+ ├─Qwen3Model: 1-1 -- [1, 30720, 768] -- True
120
+ │ └─Embedding: 2-1 [1, 30720] [1, 30720, 768] 116,686,848 True
121
+ │ └─ModuleList: 2-2 -- -- -- True
122
+ │ │ └─Qwen3DecoderLayer: 3-1 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
123
+ │ │ └─Qwen3DecoderLayer: 3-2 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
124
+ │ │ └─Qwen3DecoderLayer: 3-3 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
125
+ │ │ └─Qwen3DecoderLayer: 3-4 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
126
+ │ │ └─Qwen3DecoderLayer: 3-5 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
127
+ │ │ └─Qwen3DecoderLayer: 3-6 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
128
+ │ │ └─Qwen3DecoderLayer: 3-7 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
129
+ │ │ └─Qwen3DecoderLayer: 3-8 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
130
+ │ │ └─Qwen3DecoderLayer: 3-9 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
131
+ │ │ └─Qwen3DecoderLayer: 3-10 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
132
+ │ │ └─Qwen3DecoderLayer: 3-11 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
133
+ │ │ └─Qwen3DecoderLayer: 3-12 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
134
+ │ │ └─Qwen3DecoderLayer: 3-13 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
135
+ │ │ └─Qwen3DecoderLayer: 3-14 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
136
+ │ │ └─Qwen3DecoderLayer: 3-15 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
137
+ │ │ └─Qwen3DecoderLayer: 3-16 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
138
+ │ │ └─Qwen3DecoderLayer: 3-17 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
139
+ │ │ └─Qwen3DecoderLayer: 3-18 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
140
+ │ │ └─Qwen3DecoderLayer: 3-19 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
141
+ │ │ └─Qwen3DecoderLayer: 3-20 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
142
+ │ │ └─Qwen3DecoderLayer: 3-21 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
143
+ │ │ └─Qwen3DecoderLayer: 3-22 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
144
+ │ │ └─Qwen3DecoderLayer: 3-23 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
145
+ │ │ └─Qwen3DecoderLayer: 3-24 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
146
+ │ │ └─Qwen3DecoderLayer: 3-25 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
147
+ │ │ └─Qwen3DecoderLayer: 3-26 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
148
+ │ │ └─Qwen3DecoderLayer: 3-27 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
149
+ │ │ └─Qwen3DecoderLayer: 3-28 [1, 30720, 768] [1, 30720, 768] 8,652,544 True
150
+ │ └─Qwen3RMSNorm: 2-3 [1, 30720, 768] [1, 30720, 768] 768 True
151
+ ├─Linear: 1-2 [1, 30720, 768] [1, 30720, 151936] 116,686,848 True
152
+ ================================================================================================================================================================
153
+ Total params: 475,645,696
154
+ Trainable params: 475,645,696
155
+ Non-trainable params: 0
156
+ Total mult-adds (Units.MEGABYTES): 475.65
157
+ ================================================================================================================================================================
158
+ Input size (MB): 0.25
159
+ Forward/backward pass size (MB): 58494.81
160
+ Params size (MB): 951.29
161
+ Estimated Total Size (MB): 59446.35
162
+ ================================================================================================================================================================
163
+ NOTE: torchinfo double-counts tied embed_tokens/lm_head weight (116,686,848 params). True unique parameter count: 358,958,848 (359.0M)
164
+ ================================================================================
165
+
166
+ Loading dataset from /mloscratch/homes/navasard/data/longctx30k/tokenized...
167
+ Using pre-tokenized dataset (no runtime tokenization)
168
+ Loading pre-tokenized HF dataset from /mloscratch/homes/navasard/data/longctx30k/tokenized...
169
+ Loaded 788736 pre-tokenized examples (stored_len=30720, pack_factor=1, packed_examples=788736)
170
+ Dataset split: 749299 train, 39437 validation
171
+ Training examples (packed, train split): 749299
172
+ Validation examples (packed, val split): 39437
173
+ Per-device batch size: 1
174
+ World size (GPUs): 1
175
+ Gradient accumulation steps: 20
176
+ Effective batch size (seqs/step): 20
177
+ Sequence length: 30720
178
+ Tokens per optimizer step: 614,400
179
+ Micro-batches per epoch (per rank): 749299
180
+ Optimizer steps per epoch: 37464
181
+ Total optimizer steps: 11700 (capped by max_steps; 0.31 epochs)
182
+ wandb: [wandb.login()] Loaded credentials for https://api.wandb.ai from WANDB_API_KEY.
183
+ wandb: Currently logged in as: ruben-navasardyan4869 (ruben-navasardyan4869-epfl) to https://api.wandb.ai. Use `wandb login --relogin` to force relogin
184
+ wandb: setting up run 3id6yvxn
185
+ wandb: Tracking run with wandb version 0.26.1
186
+ wandb: Run data is saved locally in /mloscratch/homes/navasard/sparse/SparseAtt-baselines/wandb/run-20260722_221947-3id6yvxn
187
+ wandb: Run `wandb offline` to turn off syncing.
188
+ wandb: Syncing run 365m mixed 30k seed44
189
+ wandb: ⭐️ View project at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity
190
+ wandb: 🚀 View run at https://wandb.ai/ruben-navasardyan4869-epfl/stochastic_sparsity/runs/3id6yvxn
191
+ Starting training...
192
+ Switching attention mode for step 1: sparse_stochastic (configured sparse attention)
193
+ Step 10/11700 | Loss: 12.0550 | LR: 6.67e-06 | 29814.3ms/step | 0.7 samples/s
194
+ Step 20/11700 | Loss: 11.9902 | LR: 1.33e-05 | 23570.5ms/step | 0.8 samples/s
195
+ Step 30/11700 | Loss: 11.7343 | LR: 2.00e-05 | 23561.8ms/step | 0.8 samples/s
196
+ Step 40/11700 | Loss: 11.2565 | LR: 2.67e-05 | 23593.3ms/step | 0.8 samples/s
epfl_final/train_logs/mixed30k365m_s44.supervisor.log ADDED
File without changes
epfl_final/train_logs/mixed30k365m_s44.watch.log ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-22T22:17:37Z watchdog start pid=315
2
+ 2026-07-22T22:17:37Z launch GPUs=3 nproc=1 latest_step=
3
+ 2026-07-22T22:59:15Z watchdog start pid=187
4
+ 2026-07-22T22:59:15Z launch GPUs=3 nproc=1 latest_step=
5
+ 2026-07-24T07:03:34Z watchdog start pid=354
6
+ 2026-07-24T07:03:34Z launch GPUs=3 nproc=1 latest_step=
7
+ 2026-07-24T17:38:52Z watchdog start pid=201
8
+ 2026-07-24T17:38:52Z launch GPUs=3 nproc=1 latest_step=
9
+ 2026-07-25T06:17:28Z watchdog start pid=195
10
+ 2026-07-25T06:17:28Z launch GPUs=3 nproc=1 latest_step=
11
+ 2026-07-25T07:50:31Z process absent for 5 minutes; relaunching
12
+ 2026-07-25T07:50:31Z launch GPUs=3 nproc=1 latest_step=
13
+ 2026-07-25T07:55:32Z process absent for 5 minutes; relaunching
14
+ 2026-07-25T07:55:32Z launch GPUs=3 nproc=1 latest_step=
epfl_final/train_logs/mixed8k365m_s44.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/mixed8k365m_s44.supervisor.log ADDED
File without changes
epfl_final/train_logs/mixed8k365m_s44.watch.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 2026-07-22T22:17:37Z watchdog start pid=168
2
+ 2026-07-22T22:17:37Z launch GPUs=3 nproc=1 latest_step=
3
+ 2026-07-24T20:54:14Z complete latest_step=44000
epfl_final/train_logs/mixed8k365m_s45.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/mixed8k365m_s45.watch.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 2026-07-22T22:39:25Z watchdog start pid=145
2
+ 2026-07-22T22:39:25Z launch GPUs=2 nproc=1 latest_step=
3
+ 2026-07-24T21:16:26Z complete latest_step=44000
epfl_final/train_logs/mixed8k365m_s45.watchdog.log ADDED
File without changes
epfl_final/train_logs/mixed8k365m_s46.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/mixed8k365m_s46.watch.log ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ 2026-07-22T22:39:25Z watchdog start pid=146
2
+ 2026-07-22T22:39:25Z launch GPUs=3 nproc=1 latest_step=
3
+ 2026-07-24T21:33:58Z complete latest_step=44000
epfl_final/train_logs/mixed8k365m_s46.watchdog.log ADDED
File without changes
epfl_final/train_logs/mixed8k3b_60b.run.log ADDED
The diff for this file is too large to render. See raw diff
 
epfl_final/train_logs/mixed8k3b_60b.supervisor.log ADDED
File without changes
epfl_final/train_logs/mixed8k3b_60b.watch.log ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 2026-07-22T07:59:55Z watchdog start pid=223898
2
+ 2026-07-22T07:59:55Z launch GPUs=0,1,2,3 nproc=4 latest_step=
3
+ 2026-07-22T08:42:15Z watchdog start pid=225027
4
+ 2026-07-22T08:42:15Z launch GPUs=0,1,2,3 nproc=4 latest_step=
5
+ 2026-07-23T07:31:40Z watchdog start pid=256637
6
+ 2026-07-23T07:31:40Z launch GPUs=0,1,2,3 nproc=4 latest_step=4250
7
+ 2026-07-23T07:45:57Z watchdog start pid=258463
8
+ 2026-07-23T07:45:57Z launch GPUs=0,1,2,3 nproc=4 latest_step=4250
9
+ 2026-07-24T17:11:14Z process absent for 5 minutes; relaunching
10
+ 2026-07-24T17:11:14Z launch GPUs=0,1,2,3 nproc=4 latest_step=11000
11
+ 2026-07-24T18:19:57Z watchdog start pid=307075
12
+ 2026-07-24T18:19:57Z launch GPUs=0,1,2,3 nproc=4 latest_step=11000
13
+ 2026-07-25T07:50:44Z process absent for 5 minutes; relaunching
14
+ 2026-07-25T07:50:44Z launch GPUs=0,1,2,3 nproc=4 latest_step=13500
15
+ 2026-07-25T16:57:06Z watchdog start pid=340455
16
+ 2026-07-25T16:57:06Z launch GPUs=0,1,2,3 nproc=4 latest_step=13500
epfl_final/train_logs/mixed8k3b_prepare.log ADDED
@@ -0,0 +1 @@
 
 
1
+ mixed8k3b_60b watchdog pid=225027 GPUs=4 config=configs/ladder8k/mixed_3b_60b.json
epfl_final/train_logs/prebuild_mixed_mask_layers.py ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build missing mixed-attention mask-cache files for selected layers."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import json
8
+ import sys
9
+ from pathlib import Path
10
+
11
+ import torch
12
+
13
+ REPO = Path("/mloscratch/homes/navasard/sparse/SparseAtt-baselines")
14
+ if str(REPO) not in sys.path:
15
+ sys.path.insert(0, str(REPO))
16
+
17
+ from sparseatt import Qwen3Config
18
+ from sparseatt.sparse_attention import Qwen3SparseStochasticAttention
19
+
20
+
21
+ def main():
22
+ parser = argparse.ArgumentParser()
23
+ parser.add_argument("--config", required=True)
24
+ parser.add_argument("--layers", nargs="+", type=int, required=True)
25
+ args = parser.parse_args()
26
+
27
+ raw = json.loads(Path(args.config).read_text())
28
+ model = raw["model"]
29
+ data = raw["data"]
30
+ attention = raw["attention"]
31
+ cache_dir = Path(attention["sparse_mask_cache_dir"])
32
+ cache_dir.mkdir(parents=True, exist_ok=True)
33
+
34
+ config_values = {
35
+ "hidden_size": model["hidden_size"],
36
+ "intermediate_size": model["intermediate_size"],
37
+ "num_hidden_layers": model["num_hidden_layers"],
38
+ "num_attention_heads": model["num_attention_heads"],
39
+ "num_key_value_heads": model["num_key_value_heads"],
40
+ "attention_type": attention["type"],
41
+ "sparse_block_size": attention["sparse_block_size"],
42
+ "sparse_num_random_blocks": attention["sparse_num_random_blocks"],
43
+ "sparse_mask_pool_size": attention["sparse_mask_pool_size"],
44
+ "sparse_max_seq_length": data["max_seq_length"],
45
+ "sparse_mask_cache_dir": str(cache_dir),
46
+ "sparse_mask_seed": attention["sparse_mask_seed"],
47
+ "sparse_mixed_nrb_set": attention["sparse_mixed_nrb_set"],
48
+ }
49
+ if model.get("head_dim") is not None:
50
+ config_values["head_dim"] = model["head_dim"]
51
+ config = Qwen3Config(**config_values)
52
+
53
+ for layer_index in args.layers:
54
+ cache_path = cache_dir / f"masks_layer_{layer_index}.pt"
55
+ if cache_path.is_file() and cache_path.stat().st_size > 0:
56
+ print(f"layer={layer_index} already complete bytes={cache_path.stat().st_size}")
57
+ continue
58
+ print(f"layer={layer_index} building", flush=True)
59
+ module = Qwen3SparseStochasticAttention(
60
+ config,
61
+ layer_index,
62
+ mask_cache_dir=str(cache_dir),
63
+ )
64
+ if not cache_path.is_file() or cache_path.stat().st_size == 0:
65
+ raise RuntimeError(f"Mask cache was not created: {cache_path}")
66
+ print(f"layer={layer_index} complete bytes={cache_path.stat().st_size}", flush=True)
67
+ del module
68
+ torch.cuda.empty_cache()
69
+
70
+
71
+ if __name__ == "__main__":
72
+ main()
epfl_final/train_logs/prepare_365m_seed_matrix.py ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+ import copy
4
+ import json
5
+ from pathlib import Path
6
+
7
+
8
+ REPO = Path("/mloscratch/homes/navasard/sparse/SparseAtt-baselines")
9
+ CONFIG_DIR = REPO / "configs/multiseed"
10
+
11
+
12
+ def write_config(base_path, output_name, output_dir, seed, wandb_name, tags, updates=None):
13
+ config = json.loads((REPO / base_path).read_text())
14
+ config = copy.deepcopy(config)
15
+ config["training"]["output_dir"] = output_dir
16
+ config["training"]["resume_from_checkpoint"] = None
17
+ config["training"]["force_new_run"] = False
18
+ config["training"]["seed"] = seed
19
+ config["wandb"]["name"] = wandb_name
20
+ config["wandb"]["tags"] = tags
21
+
22
+ for section, values in (updates or {}).items():
23
+ config[section].update(values)
24
+
25
+ CONFIG_DIR.mkdir(parents=True, exist_ok=True)
26
+ destination = CONFIG_DIR / output_name
27
+ temporary = destination.with_suffix(".json.tmp")
28
+ temporary.write_text(json.dumps(config, indent=2) + "\n")
29
+ temporary.replace(destination)
30
+ return destination
31
+
32
+
33
+ def prepare_30k():
34
+ jobs = []
35
+ for seed, gpu in ((43, 0), (44, 1)):
36
+ output_dir = f"/mloscratch/homes/navasard/sparse/checkpoints/l30k365m_dense_seed{seed}"
37
+ config = write_config(
38
+ "configs/ladder30k/dense.json",
39
+ f"dense_365m_30k_seed{seed}.json",
40
+ output_dir,
41
+ seed,
42
+ f"365m dense 30k seed{seed}",
43
+ ["qwen3", "365m", "30k", "dense", "native", f"seed{seed}", "multiseed"],
44
+ )
45
+ jobs.append((f"dense30k365m_s{seed}", config, output_dir, gpu))
46
+
47
+ for seed, gpu in ((43, 2), (44, 3)):
48
+ output_dir = f"/mloscratch/homes/navasard/sparse/checkpoints/l30k365m_mixed_seed{seed}"
49
+ config = write_config(
50
+ "configs/365m_mixed_30k_2gpu_seed42.json",
51
+ f"mixed_365m_30k_seed{seed}.json",
52
+ output_dir,
53
+ seed,
54
+ f"365m mixed 30k seed{seed}",
55
+ ["qwen3", "365m", "30k", "mixed", "native", f"seed{seed}", "multiseed"],
56
+ updates={"training": {"gradient_accumulation_steps": 20}},
57
+ )
58
+ jobs.append((f"mixed30k365m_s{seed}", config, output_dir, gpu))
59
+ return jobs
60
+
61
+
62
+ def prepare_8k():
63
+ jobs = []
64
+ for seed, gpu in ((43, 0), (44, 1), (45, 2)):
65
+ output_dir = f"/mloscratch/homes/navasard/sparse/checkpoints/l8k365m_dense_seed{seed}"
66
+ config = write_config(
67
+ "configs/ladder8k/dense.json",
68
+ f"dense_365m_8k_seed{seed}.json",
69
+ output_dir,
70
+ seed,
71
+ f"365m dense 8k seed{seed}",
72
+ ["qwen3", "365m", "8k", "dense", f"seed{seed}", "multiseed"],
73
+ )
74
+ jobs.append((f"dense8k365m_s{seed}", config, output_dir, gpu))
75
+
76
+ seed = 44
77
+ output_dir = f"/mloscratch/homes/navasard/sparse/checkpoints/l8k365m_mixed_seed{seed}"
78
+ config = write_config(
79
+ "configs/365m_mixed_8k_seed42.json",
80
+ f"mixed_365m_8k_seed{seed}.json",
81
+ output_dir,
82
+ seed,
83
+ f"365m mixed 8k seed{seed}",
84
+ ["qwen3", "365m", "8k", "mixed", f"seed{seed}", "multiseed"],
85
+ )
86
+ jobs.append((f"mixed8k365m_s{seed}", config, output_dir, 3))
87
+ return jobs
88
+
89
+
90
+ def main():
91
+ parser = argparse.ArgumentParser()
92
+ parser.add_argument("--matrix", choices=("8k", "30k"), required=True)
93
+ args = parser.parse_args()
94
+ jobs = prepare_8k() if args.matrix == "8k" else prepare_30k()
95
+ for job, config, output_dir, gpu in jobs:
96
+ print(
97
+ json.dumps(
98
+ {
99
+ "job": job,
100
+ "config": str(config.relative_to(REPO)),
101
+ "output_dir": output_dir,
102
+ "gpu": gpu,
103
+ "max_steps": 44000 if args.matrix == "8k" else 11700,
104
+ }
105
+ )
106
+ )
107
+
108
+
109
+ if __name__ == "__main__":
110
+ main()
epfl_final/train_logs/prepare_then_launch_3b_mixed.sh ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+
4
+ BASE=/mloscratch/homes/navasard/sparse
5
+ REPO="$BASE/SparseAtt-baselines"
6
+ PYTHON=/mloscratch/homes/navasard/conda/bin/python3.13
7
+ BUILDER="$BASE/train_logs/prebuild_mixed_mask_layers.py"
8
+ CONFIG=configs/ladder8k/mixed_3b_60b.json
9
+ LOGDIR="$BASE/train_logs/mixed8k3b_mask_build"
10
+
11
+ mkdir -p "$LOGDIR"
12
+ cd "$REPO"
13
+
14
+ pids=()
15
+ for spec in "0:28:32" "1:29:33" "2:30:34" "3:31:35"; do
16
+ IFS=: read -r gpu first second <<< "$spec"
17
+ CUDA_VISIBLE_DEVICES="$gpu" "$PYTHON" "$BUILDER" \
18
+ --config "$CONFIG" --layers "$first" "$second" \
19
+ > "$LOGDIR/gpu${gpu}.log" 2>&1 &
20
+ pids+=("$!")
21
+ done
22
+
23
+ for pid in "${pids[@]}"; do
24
+ wait "$pid"
25
+ done
26
+
27
+ for layer in $(seq 0 35); do
28
+ test -s "$BASE/mask_cache_8k_mixed/masks_layer_${layer}.pt"
29
+ done
30
+ touch "$BASE/mask_cache_8k_mixed/.BUILD_DONE_36"
31
+
32
+ "$BASE/train_logs/launch_3b_mixed.sh" 4