ViperEkura
84ed2327f5
feat: add --resume flag to decouple weight loading from training resumption
...
- Add --resume bool flag to train.py CLI
- --param_path always loads weights only by default
- --resume restores epoch, consumed_samples, optimizer & scheduler
- Checkpoint.load() now preserves full meta dict
- Update test_early_stopping to use new param_path/resume API
2026-07-16 14:23:23 +08:00
ViperEkura
aabb0d83e9
refactor : replace iteration with consumed_samples
...
- Replace context.iteration with consumed_samples (global sample count)
- Add optimizer_step property derived from consumed_samples
- Checkpoint meta.json stores consumed_samples, drops iteration
- CLI --start_batch renamed to --start_samples (per-rank samples)
- Checkpoint dir naming: epoch_X_step_Y instead of epoch_X_iter_Y
- Metric log entries use step and consumed_samples fields
- Backward compat removed (old iteration checkpoints unsupported)
2026-06-30 18:42:42 +08:00
ViperEkura
6ae1828449
refactor : 清理工厂和配置系统中的死代码与冗余抽象
...
- 删除 Registry 中未使用的 category/priority 字段,_entries 简化为直接存储类引用
- 修正 __init_subclass__ 避免叶子类(AutoRegressiveLM 等)创建空注册表
- 删除 5 个工厂的薄 create() 覆写,统一使用 BaseFactory.create(name, *args, **kwargs)
- 删除 3 处零调用的 available_types/available_strategies 别名死代码
- 删除零调用的 BaseModelConfig.to_file 死代码
- 将 BaseConfig.from_json/to_json 重命名为 from_file/to_file,消除与子类重复
- 移除两个 inference builder 中总是被覆写的 prompt_tokens=0
2026-06-07 11:39:50 +08:00
ViperEkura
4145d35e3c
refactor: 检查点加载重构,路径替代对象传递
...
- model: nn.Module -> model_fn 工厂函数,spawn 边界只传字符串
- Trainer.train(resume_dir=path) — Checkpoint 不再通过 pickle 传递
- TrainContextBuilder.with_resume_dir(path) — 自动检测 meta.json 分流 resume/from-scratch
- CheckpointCallback: 拆分 state_dict 收集(全 rank)与磁盘写入(rank-0),修复 FSDP 死锁
- serialization: load_torch 支持 broadcast,消除 _load_extra/_load_torch_broadcast
- optimizer/scheduler 恢复逻辑内联到 build(),在 executor.prepare() 之后执行
- pyproject.toml: ruff exclude build/ 避免 CI 扫描构建产物
2026-05-27 20:15:29 +08:00
ViperEkura
7fa69572c0
fix: 测试日志写入临时目录避免冗余文件
2026-05-24 20:54:59 +08:00
ViperEkura
d7a7f570ed
refactor: 训练循环改为两重迭代并统一参数命名
...
- 训练循环从三重(epoch→batched→batch)改为二重(epoch→batch)
- batch_size → batch_per_device, accumulation_steps → grad_accum_steps
- scheduler 移入 step block 对齐 optimizer 更新步
- GradientClippingCallback 改用 on_step_begin 避免零梯度裁剪
- 移除 _train_impl 误导性的 -> Checkpoint 标注
- total_steps 修除为向下取整并精简为一行
- warmup_steps 改为 warmup_ratio (默认0.05)
2026-05-16 21:27:35 +08:00
ViperEkura
bd9741dc5f
refactor: 从data 模块分离tokenizer
2026-04-04 16:12:58 +08:00
ViperEkura
b531232a9b
style: 修改为显式导入
2026-04-04 16:02:49 +08:00
ViperEkura
0852b852f8
refactor: 优化参数传递,清理导入样式
2026-04-03 22:06:32 +08:00
ViperEkura
2e009cf59a
chore: 更新项目名称
2026-03-31 09:34:11 +08:00
ViperEkura
426af2d75f
style: 使用ruff 工具优化代码风格
2026-03-30 23:32:28 +08:00
ViperEkura
345fd2f091
fix: 修复参数传递问题
2026-03-30 22:22:36 +08:00
ViperEkura
3e8f2eba81
fix: 修复路径问题
2026-03-20 21:14:02 +08:00
ViperEkura
6089a12cef
fix: 修复参数传递问题并更新测试单元
2026-02-28 19:01:16 +08:00
ViperEkura
4da70785b5
refactor(tests): 重构测试文件目录结构
2026-01-08 21:34:52 +08:00