docs: update TEST_REPORT.md and model/NOTES.md with audit log
Browse files- docs/TEST_REPORT.md +21 -0
- model/NOTES.md +1 -0
docs/TEST_REPORT.md
CHANGED
|
@@ -223,6 +223,27 @@ Har test ke baad yaha entry hogi: date, env, command, result, verdict.
|
|
| 223 |
- Screenshot verified (user-provided)
|
| 224 |
- Screenshot verified (user-provided)
|
| 225 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 226 |
## Template (next test ke liye)
|
| 227 |
```
|
| 228 |
## YYYY-MM-DD — <test naam> (<env>)
|
|
|
|
| 223 |
- Screenshot verified (user-provided)
|
| 224 |
- Screenshot verified (user-provided)
|
| 225 |
|
| 226 |
+
## 2026-09-18 — Full Codebase Audit & P0/P1 Fixes (Local smoke verify)
|
| 227 |
+
- Env: Windows, CPU, torch 2.13 (Python 3.13)
|
| 228 |
+
- Cmds:
|
| 229 |
+
- `python model/scripts/viu1_moe.py --config model/configs/viu1_moe_config.yaml`
|
| 230 |
+
- `python model/scripts/train.py --smoke`
|
| 231 |
+
- `python model/scripts/push_to_hf.py --repo ViuAI/ViuMini-MoE-242M --message "fix: audit fixes for multi-token alignment, weight decay groups, and MoE monitoring"`
|
| 232 |
+
- Audit Fixes Covered:
|
| 233 |
+
1. Multi-token prediction alignment: fixed off-by-one (`mt_tgt = targets[:, 1:]` + `h[:, :-1, :]`) so token t+2 (next-next) is predicted instead of t+3.
|
| 234 |
+
2. AdamW weight decay parameter grouping: decoupled 1D weights (RMSNorm scale, biases) from weight decay (0.0), applying 0.1 only to 2D matrices.
|
| 235 |
+
3. MoE routing monitoring: exported expert usages in `aux_info["usages"]` and added real-time `max_share` tracking with >60% router imbalance alert.
|
| 236 |
+
4. Attention mask caching: cached `_mask_cache` in `Attention` to eliminate 224 allocations per optimizer step.
|
| 237 |
+
5. RoPE dtype alignment: cast `cos`/`sin` to `x.dtype` in `apply_rope` to avoid half-precision upcasting.
|
| 238 |
+
6. Switch-gate modulation: routed gate to multiply attention output rather than cancelling out in softmax.
|
| 239 |
+
7. Evaluation AMP & Scaler checkpoints: wrapped `evaluate()` in AMP autocast and preserved `scaler.state_dict()` in checkpoints.
|
| 240 |
+
8. Sampling generation: added temperature (0.7) and top-k (40) sampling to eliminate repetition loops.
|
| 241 |
+
- Result:
|
| 242 |
+
- Param check: total 241,668,224 (241.7M) / active 166,158,464 (166.2M), MoE=9 dense=19 sliding=19 full=9, forward loss ~12.73, usages exported OK.
|
| 243 |
+
- Train smoke: 3 steps loss 6.32 -> 6.34, real-time `max_share` logged (0.383 -> 0.453 -> 0.461), ckpt/eval OK.
|
| 244 |
+
- HF push: pushed to `https://huggingface.co/ViuAI/ViuMini-MoE-242M` successfully.
|
| 245 |
+
- Verdict: PASS
|
| 246 |
+
|
| 247 |
## Template (next test ke liye)
|
| 248 |
```
|
| 249 |
## YYYY-MM-DD — <test naam> (<env>)
|
model/NOTES.md
CHANGED
|
@@ -15,3 +15,4 @@ model/
|
|
| 15 |
- 2026-09-15: `scripts/viu1_moe.py` + `configs/viu1_moe_config.yaml` (VIU-1 Frontier) — test: total 217.8M / active 147.3M (target 200/135, ~9% upar, quality ke liye OK), smoke OK (loss 12.05, moe_aux 0.21), MoE=8 dense=16 sliding=16 full=8, n_kv bug fix
|
| 16 |
- 2026-09-15: 28 layers LOCK — test: total 241.7M / active 166.2M, smoke OK (loss 12.18), MoE=9 dense=19 sliding=19 full=9
|
| 17 |
- 2026-09-15: `scripts/train.py` + `configs/train_config.yaml` — smoke OK CPU 3 steps (loss 6.18->6.01 down), ckpt/resume/eval/sample ready, warnings fix
|
|
|
|
|
|
| 15 |
- 2026-09-15: `scripts/viu1_moe.py` + `configs/viu1_moe_config.yaml` (VIU-1 Frontier) — test: total 217.8M / active 147.3M (target 200/135, ~9% upar, quality ke liye OK), smoke OK (loss 12.05, moe_aux 0.21), MoE=8 dense=16 sliding=16 full=8, n_kv bug fix
|
| 16 |
- 2026-09-15: 28 layers LOCK — test: total 241.7M / active 166.2M, smoke OK (loss 12.18), MoE=9 dense=19 sliding=19 full=9
|
| 17 |
- 2026-09-15: `scripts/train.py` + `configs/train_config.yaml` — smoke OK CPU 3 steps (loss 6.18->6.01 down), ckpt/resume/eval/sample ready, warnings fix
|
| 18 |
+
- 2026-09-18: Codebase audit & P0/P1 fixes (`viu1_moe.py`, `train.py`) — multi-token target alignment fix (predict t+2, not t+3), RoPE half-precision dtype alignment, causal/sliding mask caching in Attention, export expert usages in aux_info, switch_gate output gating, AdamW weight decay groups (0.1 on 2D weights, 0.0 on RMSNorm/biases), AMP autocast in evaluate, scaler save/restore in checkpoints, temperature+top-k sampling in sample_text, real-time MoE max_share monitoring. Tests pass (241.7M/166.2M verified, smoke OK), HF pushed.
|