Repository navigation
Conversation
Use a per-user temporary directory, with TWINKLE_HOME as an override, and create it only when locks are used. Add real filesystem and cross-process regressions for read-only working directories. Signed-off-by: liuchenbing <[email protected]>
|
@Yunnglin could you please review this focused fix for the read-only working-directory part of #298? I reran the committed regression tests against the original base (
Rechecked on Linux/aarch64 with Python 3.12.13 and datasets 4.8.4, running as an unprivileged user so the read-only-directory cases really exercise This addresses only the lock-directory subproblem, not all of #298. Multi-host deployment and the full Tinker training workflow were not exercised in this rerun. Thanks! |
|
建议合入。本次独立复跑确认,它修复的是 #298 中仍存在的只读工作目录/跨 CWD 锁协调问题。 使用本 PR 已提交的同一套
main 的两个只读目录用例都在导入时触发 另外用真实只读挂载 合入仍需满足仓库 CI/审批门禁;核对时常规 lint 和 unittest 已成功,NPU unittest 仍在排队。多主机若需要协调共享缓存,应配置同一可写共享 本 PR 仅解决 lock-directory 子项,不包含 stock Tinker checkpoint URI/archive 下载兼容性。建议保留 #298,直到该剩余问题也完成修复与验收。 |
main carried 17 commits (#311..#291) over merge-base 96dab68. v5 had already ported everything up to #312 (a4ddc3b) and moved server/client to twinkle_cs, so: - server/client (src/twinkle/server, twinkle_cs/*, tests/server, tests/twinkle_client): kept the v5 tree; the legacy src/twinkle/server path and the old ci_container_test.sh stay removed on v5. - loss: #291 detached DFT weights, #335 Liger CE contract (delegates micro_batch_scale / batch_normalizer to CrossEntropyLoss), #334 chunked CE comments, #336 InfoNCE tests. - model: #343 Torch.empty_cache (auto-merged), #385 fused_lm_rl ported onto the v5 task registry (processor/tasks.py + model/tasks.py FusedRL + transformers postprocess), #386 NPU fused CE fast path in selective_log_softmax. - twinkle_agentic: #345 check kinds (hidden_python / sql_query / answer_one_of / answer_number / web_receipt / lean) adapted to the episode-scoped Env interface; AgenticChallenger gains the _verify_check / _proposal_reward hooks. Known: cookbook/rsi and tests/cookbook/rsi (#345) are written against main's stateless Env / AgenticChallenger API and do not run on v5 yet.
PR type
PR information
Importing
twinkle.utils.parallelcurrently creates.locksin the working directory, causingPermissionErrorwhen that directory is read-only.Move runtime locks to an absolute path under
TWINKLE_HOME, defaulting to<tempdir>/twinkle/<user>/.locks, and create the directory only when a processing lock or one-shot claim is used. Processes sharing this runtime directory coordinate across different working directories. Multi-host runs should setTWINKLE_HOMEto a writable shared filesystem.Addresses the read-only working-directory lock problem in #298. Add filesystem and subprocess regressions for both default/custom runtime paths, import without directory creation, cross-directory locking and claims, session rollover, and exception cleanup.
Experiment results
Validated on macOS arm64, CPython 3.12.13, datasets 5.1.0, filelock 4.1.1, and pytest 9.1.1:
ec8fd1f0660b09ed60938d02d2439533a5aa5c65: 5 failed, 1 passed, including real read-only-directoryPermissionErrorfailures.0de02dfe4103ef9033befdc72f90d1e4a1ce93b3: 6 passed, no skips.The tests load the real utility module directly and use real FileLock/filesystem/subprocess behavior. Read-only permission cases skip for root or non-POSIX environments. Validation covers this CPU utility; full training/SDK integration and hardware tests remain untested.
AI assistance: Codex assisted with the implementation and regression tests.