Partial eval-cache load appends regenerated batches to stale ones (ragged per-rank eval)
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- python
调研方向
从 angelspec/controller/eval.py 中的 setup_eval 开始,跟踪部分加载的重新生成路径,然后检查 angelspec/training/trainer.py 中的 cache_eval_samples。确保重新生成会在添加新 samples 之前丢弃所有部分加载的 eval shards,并验证每个 rank 生成的 cache 都一致且不包含过时的 batches。
由索引模型根据 Issue 内容生成。
描述
setup_eval loads the per-rank eval cache and regenerates it when any rank got nothing:
https://github.com/Tencent/AngelSpec/blob/main/angelspec/controller/eval.py#L195-L207
loaded = train_group.load_eval_cache(eval_cache_path)
if all(n > 0 for n in loaded):
eval_cache_loaded = True
...
else:
... # regenerate cache from inference
The cache save is fire-and-forget (async_save_eval_cache, one eval_rank_<r>.pt file per rank), so an interrupted previous run can leave a partial cache at the same dp_size: some ranks load n > 0, others 0. On the regeneration path, cache_eval_samples appends to whatever was loaded:
https://github.com/Tencent/AngelSpec/blob/main/angelspec/training/trainer.py#L363-L369
def cache_eval_samples(self, count: int) -> int:
for sample in itertools.islice(self._eval_data_fetcher, count):
...
self._eval_cache.append(cpu_sample)
Ranks that loaded stale shards end up with stale batches + freshly generated ones, so per-rank eval batch counts diverge. This is exactly the failure mode the comment at eval.py L182-L186 warns about ("ragged per-rank eval batch counts -> desynced FSDP all-gathers -> NCCL deadlock") — the dp_size cache key guards the cross-dp_size case but not the partial-save case at the same dp_size. Even without a deadlock, eval silently runs on a mix of stale and fresh hidden states.
Suggested fix: when the load is partial (regeneration path), explicitly clear every rank's loaded eval cache before regenerating, or have load_eval_cache roll back on partial loads.
- 主要语言
- Python
- 星标
- 460
- 派生
- 40
- 平均合并
- 1 小时 4 分钟
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Tencent/AngelSpec 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 52/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 3/5 1-2 天 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 55/100
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
查看 Tencent/AngelSpec 的全部 Issue
相似的 Issue
-
ui
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
accepted
难度 2/5 1-3 小时 新手友好度 68/100
future-agi/future-agi#5070 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
juandresrodca/AdminForge#69 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
deepset-ai/haystack-integrations#817 ·
维护者通常 12 天内回复
-
[Bug]: test_remote_realpath_uses_argument_vector fails on Windows with Python 3.13+ (ntpath.isabs)可能已有人在做 @gouyu-hou 今天认领。 未关闭triage/confirmed
难度 1/5 1 小时以内 新手友好度 90/100
agentscope-ai/agentscope#4397 ·
维护者通常 2 天内回复