Safe mode breaks Tinker training, loopback-only hosts crash at deploy, checkpoints unusable from stock Tinker SDK
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 30/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- docker, python
调研方向
Three separate problems are reported, so split them before starting. Begin with check_unsafe in src/twinkle/infra/init.py near line 573 and the TWINKLE_TRUST_REMOTE_CODE path, then find_node_ip() in src/twinkle/utils/network.py and the MASTER_ADDR use in ray_helper.py, then checkpoint_manager.py for the twinkle:// paths. Done means forward_backward works with trust off, a loopback-only host deploys, and returned sampler paths are usable by the stock SDK.
由索引模型根据 Issue 内容生成。
描述
- I have searched existing issues, and this is a new bug report.
Bug Description
Three problems when running Twinkle 0.5.1 in an isolated container and using it from the stock Tinker SDK (source links at v0.5.1):
- Safe mode breaks Tinker training.
- With
TWINKLE_TRUST_REMOTE_CODE=0, everyforward_backwardfails withTwinkle does not support Callable or Type inputs in safe mode.The check ischeck_unsafeon the remote-call path (infra/init.py#L573). - So operators can't turn remote-code trust off, and it defaults to on.
- With
- Loopback-only hosts crash at deploy.
- Under e.g.
docker run --network none,find_node_ip()skips every127.*address and returnsNone(utils/network.py#L15-L28). - That
NonebecomesMASTER_ADDR(ray_helper.py#L336), and the deployment fails withTypeError: runtime_env['env_vars'] must be of type Dict[str, str]. - Also,
.locksis created in the CWD (utils/parallel.py#L9), which fails when the CWD is read-only.
- Under e.g.
- Checkpoints can't be used from the stock Tinker SDK.
save_weights_for_sampler()returnstwinkle://...paths, which the unpatched SDK rejects (ValueError: Invalid tinker path). There's also no archive/download endpoint.nameis ignored, and each save deletes the previous sampler weights (checkpoint_manager.py#L241-L285), so earlier returned paths go stale.
How to Reproduce
- Set
TWINKLE_TRUST_REMOTE_CODE: "0"in the model deployment'senv_vars, then callforward_backward(data, "cross_entropy"). - Start
ray start --head --node-ip-address=127.0.0.1andtwinkle-server launchinside a--network nonecontainer. - With
tinker==0.16.1, callget_checkpoint_archive_url_from_tinker_path(tc.save_weights_for_sampler(name="x").result().path).
Additional Information
Suggested fixes:
- Exempt Twinkle's built-in loss and template classes from
check_unsafe. - In
find_node_ip(), fall back to127.0.0.1(or the Ray node IP), and put.locksunderTWINKLE_HOMEor the temp dir. - Return
tinker://-compatible paths, add the Tinker archive endpoint, and honourname. That would let separate evaluators load trained adapters without patching the SDK.
Environment: twinkle-kit 0.5.1, ray 2.58.0, Ubuntu 24.04 container, tinker 0.16.1.
- 主要语言
- Python
- 星标
- 260
- 派生
- 55
- 平均合并
- 1 天 11 小时
- 30 天内合并 PR
- 15
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
modelscope/twinkle 的其他 Issue
-
bug
难度 4/5 3-5 天 新手友好度 15/100
modelscope/twinkle#319 · 5 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
modelscope/twinkle#279 · 3 条评论 ·
维护者通常 1 天内回复
查看 modelscope/twinkle 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
-
[Device Support Request] HOBEIAN ZG-204ZL (Tuya PIR motion sensor with illuminance)可能已有人在做 @lenucksi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
zigpy/zha-device-handlers#5493 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
drevendev/BeautifulRepo#42 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
writerslogic/holographic-memory#93 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
antoine-tena/kiln#47 ·
维护者通常 1 天内回复