Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

TorchTitan's October update is out. I fixed 2 bugs in its quick-start script

说明与用途

在 TorchTitan 2026 年 10 月更新中,修复了 download_hf_assets.py 的两个错误:脚本现在会复制输入列表以避免变异,并生成单字符串错误信息。所有测试通过,脚本在多次调用和资产类型拼写错误时更可靠。

问题

The quick‑start script scripts/download_hf_assets.py in TorchTitan had two bugs: it mutated the caller’s asset list and produced an error message as a tuple, causing hidden failures when the script was called twice or when an asset type was misspelled.

结果

The two bugs were fixed, improving script reliability and error readability. All tests passed, and the quick‑start script now behaves predictably when called multiple times or with misspelled asset types.

工作流

  • 1. Identify bugs by reproducing failures with a shared asset list and a misspelled asset type.
  • 2. Open PR #5621 on GitHub.
  • 3. Modify scripts/download_hf_assets.py to copy the list (list(asset_types)) before appending additional_patterns and to build a single string error message.
  • 4. Update tests: assert single exception argument and verify list immutability across calls.
  • 5. Run full test suite on Windows 11 with Python 3.11 and torch 2.16.0.dev20261024+cpu.
  • 6. Merge PR after maintainer approval.
  • 7. Verify all tests pass (13 total).

证据

The download function was handed a list of what to fetch and wrote into that list instead of its own copy, so the caller's list came back one entry longer.

来源

The error is now one message built from one string, so it prints as three readable lines.

来源

I ran everything on Windows 11 with Python 3.11 and torch 2.16.0.dev20261024+cpu.

来源

  • 记录日期: 2026-11-01T03:14:02.736Z