This repository has been archived on 2026-11-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
radiance-sycl/REMAINING.md
T

53 lines
4.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# M2XFP ("MXFP4v2") on radiance — work record + resume runbook
_Updated: 2026-10-21 12:46 — HOST SHUTDOWN at user request. Three fine-tunes were interrupted mid-run and resume automatically._
## WHERE THE FINE-TUNES STOPPED (12:45)
| Run | Files | Meaning |
|---|---|---|
| MAIN (FOLD=kernel, seed 0) | **118/400** | layers 0–18 TRAINED (layer 18 landed 12:41 — the 13-hour blocker is solved) |
| EXACT (FOLD=exact) | 31/400 | layers 0–4 trained |
| SEED1 (seed 1) | 31/400 | layers 0–4 trained |
Resume is automatic and lossless (per-layer .pt files); each restart re-pays ~10–15 min capture + replay of finished layers (~2 min/layer).
## RESUME AFTER BOOT (in order)
```bash
cd /home/zee/code/llm && task stop-llama-swap # it cold-starts vLLM onto GPUs at boot
docker rm -f paro_stage2 paro_s2_exact paro_s2_seed1 2>/dev/null # stale names block relaunch
cd /home/zee/code/vllm/ggz14/paroquant
FORCE=1 PARO_HIP_VISIBLE=1 FT_EPOCHS=1 PARO_ROT_KERNEL=1 setsid nohup ./stage2-m2xfp4.sh finetune >> /tmp/ft-full.log 2>&1 &
FORCE=1 PARO_HIP_VISIBLE=0 FT_EPOCHS=1 PARO_ROT_KERNEL=1 M2XFP4_FOLD=exact PARO_NAME=paro_s2_exact \
FT_RESULTS=/media/zee/ai/paro-out-ft-m2xfp4-exact OUT=Qwen3.8-27B-PARO-M2XFP4-FT-EXACT setsid nohup ./stage2-m2xfp4.sh finetune >> /tmp/ft-exact.log 2>&1 &
FORCE=1 PARO_HIP_VISIBLE=3 FT_EPOCHS=1 PARO_ROT_KERNEL=1 PARO_SEED=1 PARO_NAME=paro_s2_seed1 \
FT_RESULTS=/media/zee/ai/paro-out-ft-m2xfp4-seed1 OUT=Qwen3.8-27B-PARO-M2XFP4-FT-SEED1 setsid nohup ./stage2-m2xfp4.sh finetune >> /tmp/ft-seed1.log 2>&1 &
setsid nohup /tmp/ft-watch9.sh >/dev/null 2>&1 & # watchdog (needs /tmp scripts — see below if wiped)
setsid nohup /tmp/ft-pipeline.sh >/dev/null 2>&1 & # auto convert→pack→serve→KL at 400 files
```
Watch: `watch -n 10 -c /tmp/ft-live.sh` (all three runs, files %, ALIVE/STALLED).
If /tmp scripts were wiped by the reboot, they are small: watchdog = poll files+loglines+logbytes+reads every 2 min, restart on 15 min frozen (45 min during the silent initial capture); pipeline = wait for /home/zee/models/Qwen3.8-27B-PARO-M2XFP4-FT/config.json → pack → serve :39475 GPU0 → KL vs kld-bf16.
## ROOT CAUSES FOUND TODAY (all evidence-backed — do not re-litigate)
1. **GPU wedges → driver resets** = LACT **−100 mV undervolt** under sustained load. Fixed by user at 11:00 (all R9700s 0 offset / 0 clock offset / 250 W). Zero resets since, across 3 concurrent FTs. **Do not re-undervolt while training.**
2. Rotation kernel is innocent: 2,597,710 isolated calls / 45 min / zero wedges (donor tensors, real shapes).
3. Fixed red herrings (real bugs, not the wedge): stale root-owned JIT cache (`docker run --rm -v /home/zee/.cache/paroquant:/c alpine rm -rf /c/torch_extensions`); `PARO_ROT_KERNEL`/`PARO_SEED` env now passed into docker (stage2.sh); container name parameterised (`PARO_NAME`); my leftover `attn_implementation: eager` in the staged config reverted to SDPA (it was a 2–5× brake); `rocm-smi` absent post-reboot → amd-smi fallback in gpu_guard.
## HARDWARE RULES
HIP devices **0, 1, 3 = R9700; 2 = W6600 (gfx1032, desktop) — never use**. amd-smi: same indices. LACT currently 0/0/250 W.
## COMPLETED AND VERIFIED (committed 12:46)
- m2xfp4 end-to-end: libquant quantiser (adaptive Sg-EM; `wide` is a no-op on real weights), gfx1201 WMMA kernels + host rows, arch wiring (`rad_block_dflash2.h:560`), spec/docs.
- RTN quality vs bf16 (32,367 pos): **KL 0.0348 / median 0.0121 / top-1 92.39 % / PPL 7.6976**; AWQ-MXFP4 0.0599/89.78 %; MXFP4-RTN excluded (kept).
- Stability: counters-in-scratch (m2/mx/fp8a8) + aql fences → 9,457-request soak, 0 faults.
- DFlash2 drafter m2xfp4: acceptance 62 % @2k → 52 % @32k; decode 156–160 tok/s; prefill ~2.5k tok/s.
- ParoQuant m2xfp4 grid (parity vs libquant), torch fallback rotation (≤1.6 ULP, never hangs), packer `tools/rad_pack_m2xfp4.py` + `Import::ParoM2`.
- Repos committed: radiance (codeberg hugypufy), vllm fork (github zedbytes), paroquant-src (local only — origin is upstream z-lab, no push rights).
## REMAINING
1. Finish the three FTs (MAIN ~5 h of layers left at ~5.8 min/layer after resume overhead; variants ~6.5 h).
2. Convert each at 400 files → pack (`tools/rad_pack_m2xfp4.py SRC --recipe data/recipes/q38-27b-paro-m2xfp4-df2.recipe --draft /home/zee/models/hf/Qwen3.8-27B-DFlash2 -o ...rad`) → serve → KL vs `kld-bf16` → pick winner (expect mean 0.030–0.032).
3. df2 re-bake with winner trunk; acceptance + 30–60 min abort soak; GSM8K 200 + concurrency sweep.
4. Long soak; MoE m2xfp4 (Flash-Next); activation Elem-EM (W4A4); block-parallel FT tooling (next FT ~2.5–3× faster).
## KEY PATHS
fp16 base /media/zee/ai/paro-stage/Qwen3.8-27B-fp16 (52 G, SDPA) · donor /home/zee/models/Qwen3.8-27B-PARO/model.safetensors · KL ref /home/zee/models/rad/kld-bf16 · containers /media/zee/ai · py-spy /src/.pyspy/bin/py-spy in-container