docs: 同步 architecture/inference/training 文档至实际代码,CLI 补充 fsdp 选项

- 修正 ProtocolHandler 架构:concrete + ResponseBuilder(ABC) 策略模式
- 修正训练循环 scheduler.step() 在 sync_gradients 块内
- 修正组合/聚合关系:注入组件改为 o--,删除不持有引用的关联
- --parallel_mode CLI choices 加入 fsdp
- nprocs > 1 且 parallel_mode=none 时 raise error
This commit is contained in:
2026-05-26 19:37:00 +08:00
parent b558e61f63
commit 836e02a166
6 changed files with 80 additions and 66 deletions
+2 -2
View File
@@ -33,14 +33,14 @@ Both support shared memory via `.share_memory_()`.
## Dataset Architecture
```
DatasetFactory.load(train_type, path, window_size, stride)
DatasetFactory.load(train_type, path, window_size, stride, storage_type, tokenizer)
→ StorageFactory.create(detect_format(path))
→ MultiSegmentFetcher(BaseSegmentFetcher per key)
→ BaseDataset.__getitem__(idx)
→ sliding window [begin, end) via get_index(idx)
```
`window_size` = max input length, `stride` = step between consecutive samples.
`window_size` = max input length, `stride` = step between consecutive samples (defaults to `window_size`).
## Sampler