feat(compressors): add JSONL training metrics logging with CLI controls

- Add write_training_metrics() in new compressors/training_metrics.py
  for appending epoch/step/lr/component rows as JSON Lines
- Wire --metrics-path and --log-every CLI options into train.py, passing
  them to the training loop so metrics rows are written every N steps
- Accept absolute metrics paths or paths relative to output directory
- Add quantization component to loss log alongside existing distill/contrastive
- Replace inline torch.device() with get_device() utility
- Add test_hash_training_metrics.py covering multi-row JSONL append

Infrastructure:
- Pin torch 2.7.1 + CUDA 12.8 index for Linux/Windows in pyproject.toml
- Add .justfile rsync upload recipe with .stignore exclusion
- Exclude **/__marimo__ from rsync in .stignore

Dependencies updated: numpy 2.4.5, pandas 3.0.3, black 26.5.0,
click 8.4.0, contourpy, etc.
This commit is contained in:
2026-05-17 14:18:51 +08:00
parent e8c890a69f
commit 4ea567adba
8 changed files with 864 additions and 531 deletions

View File

@@ -22,6 +22,9 @@ dependencies = [
"scikit-learn>=1.7.2",
"transformers>=5.0.0",
"typer>=0.24.1",
"torch==2.7.1",
"torchvision==0.22.1",
"torchaudio==2.7.1",
]
[dependency-groups]
@@ -38,6 +41,23 @@ dev = [
"cocotb-tools>=0.1.0",
]
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
[tool.uv.sources]
torch = [
{ index = "pytorch-cu128", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
]
torchvision = [
{ index = "pytorch-cu128", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
]
torchaudio = [
{ index = "pytorch-cu128", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
]
[tool.ty.environment]
python = "$UV_PROJECT_ENVIRONMENT"
root = ["./mini-nav", "./notebooks", "./hw/sim", "./scripts"]