Safe mode breaks Tinker training, loopback-only hosts crash at deploy, checkpoints unusable from stock Tinker SDK
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker, python
- Lĩnh vực
- backend, infrastructure, security
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- 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.
- Ngôn ngữ chính
- Python
- Star
- 260
- Fork
- 55
- Merge trung bình
- 1 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelscope/twinkle
-
魔搭托管的 Twinkle API 持续超时Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
modelscope/twinkle#319 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
modelscope/twinkle#279 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của modelscope/twinkle
Issue tương tự
-
Issue Triage-Needed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pulp/pulp_container#2581 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
521xueweihan/HelloGitHub#4040 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
ClanGenOfficial/clangen#6313 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(trainer): CustomTrainer func_args with non literal values fail inside the TrainJobCó thể đã có người làm @avanishkasar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
kubeflow/sdk#879 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày