{"id":2543,"date":"2026-11-20T15:57:34","date_gmt":"2026-11-20T07:57:34","guid":{"rendered":"https:\/\/www.zhukaifu.cn\/?p=2543"},"modified":"2026-11-20T15:57:34","modified_gmt":"2026-11-20T07:57:34","slug":"pytorch-torchtitan-%c2%b7-%e4%b8%ad%e6%96%87%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.zhukaifu.cn\/?p=2543","title":{"rendered":"pytorch\/torchtitan \u00b7 \u4e2d\u6587\u4ecb\u7ecd"},"content":{"rendered":"<!-- gh-sync:repo:pytorch\/torchtitan -->\n\n<div id=\"gh-catalog\"><style>\/* \u4ec5\u4f5c\u7528\u4e8e\u540c\u6b65\u6587\u7ae0\uff1b\u4e0e Kai's Log \u6d45\u8272\u6587\u7ae0\u533a\u57df\u8854\u63a5\u3002 *\/\n#gh-catalog{color-scheme:light;--bg:#fff;--panel:#faf7fa;--line:#e7dee6;--text:#29252b;--muted:#69616b;--accent:#97447f;background:transparent;color:var(--text);font:inherit;line-height:1.8;min-height:0;width:100%;overflow-wrap:anywhere}\n#gh-catalog *,#gh-catalog *::before,#gh-catalog *::after{box-sizing:border-box}\n#gh-catalog main{width:100%;max-width:none;margin:0;padding:4px 0 20px}\n#gh-catalog h1,#gh-catalog h2,#gh-catalog h3{color:#29252b;font-family:inherit;font-weight:700;letter-spacing:normal;overflow-wrap:anywhere}\n#gh-catalog h1{font-size:clamp(24px,3.5vw,34px);line-height:1.4;margin:20px 0 12px}\n#gh-catalog h2{font-size:20px;line-height:1.55;margin:0 0 12px}\n#gh-catalog p{color:inherit;margin:12px 0}\n#gh-catalog a{color:var(--accent);text-decoration:none;box-shadow:none}\n#gh-catalog a:hover{text-decoration:underline;color:#753361}\n#gh-catalog .eyebrow{font-size:12px;letter-spacing:.14em;color:var(--accent);font-weight:700}\n#gh-catalog .meta,#gh-catalog .sort-note{color:var(--muted);font-size:13px}\n#gh-catalog article{background:#fff;border:1px solid var(--line);border-radius:12px;padding:24px;margin:18px 0;box-shadow:none;color:var(--text)}\n#gh-catalog article:hover{border-color:#cba8c3}\n#gh-catalog nav{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin:16px 0 0}\n#gh-catalog nav a{font-size:14px}\n#gh-catalog .rank{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:30px;border-radius:7px;background:#f3edf2;color:#715568;font-size:13px;margin-right:10px;font-variant-numeric:tabular-nums}\n#gh-catalog .top-rank{background:#f8efd9;color:#765516}\n#gh-catalog .search-panel{position:static;z-index:auto;padding:20px;background:#faf7fa;border:1px solid var(--line);border-radius:12px;margin:24px 0;box-shadow:none;backdrop-filter:none}\n#gh-catalog .search-panel label{color:var(--text);font-weight:600}\n#gh-catalog .search-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:10px}\n#gh-catalog .search-row input{flex:1 1 240px;width:auto}\n#gh-catalog input,#gh-catalog select,#gh-catalog button{border:1px solid #cdbfca;border-radius:8px;background:#fff;color:#29252b;font:inherit;line-height:1.5;max-width:100%;min-height:44px;box-shadow:none}\n#gh-catalog input{width:100%;min-width:0;padding:12px 14px}\n#gh-catalog input::placeholder{color:#756b76;opacity:1}\n#gh-catalog select{padding:11px 30px 11px 12px;width:auto}\n#gh-catalog button{padding:11px 16px;cursor:pointer;white-space:nowrap;background:#f2e6ef;color:#71345e}\n#gh-catalog button:hover{background:#ead5e5;border-color:#b98aab}\n#gh-catalog .sort-label{font-size:13px}\n#gh-catalog article nav a{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:9px 15px;border-radius:8px;font-size:13px;font-weight:600;border:1px solid #ddccda;background:#faf5f9;color:#80366a;text-decoration:none;box-shadow:none}\n#gh-catalog article nav a:first-child{background:#97447f;border-color:#97447f;color:#fff}\n#gh-catalog article nav a:hover{background:#f0e0eb;border-color:#b784a8;color:#71345e;text-decoration:none}\n#gh-catalog article nav a:first-child:hover{background:#7a3566;border-color:#7a3566;color:#fff}\n#gh-catalog .collected{display:inline-flex;gap:6px;flex-wrap:wrap;margin:10px 0 0;padding:4px 10px;background:#f8f4f7;border:1px solid var(--line);border-radius:6px;font-size:12px;color:#69616b}\n#gh-catalog ul,#gh-catalog ol{padding-left:1.5em;margin:14px 0;color:var(--text)}\n#gh-catalog li{margin:10px 0;color:inherit}\n#gh-catalog .empty{border:1px dashed #cdbfca;border-radius:12px;text-align:center;padding:32px 18px;color:var(--muted);background:#faf7fa}\n#gh-catalog footer{margin-top:28px;border-top:1px solid var(--line);padding-top:16px;color:var(--muted);font-size:12px}\n#gh-catalog [hidden]{display:none!important}\n#gh-catalog a:focus-visible,#gh-catalog button:focus-visible,#gh-catalog input:focus-visible,#gh-catalog select:focus-visible{outline:3px solid #97447f;outline-offset:3px}\n@media(max-width:600px){#gh-catalog main{padding:0 0 12px}#gh-catalog article{padding:18px 14px}#gh-catalog h2{font-size:18px}#gh-catalog .search-panel{padding:16px 14px}#gh-catalog .search-row input{flex-basis:100%}#gh-catalog article nav a{flex:1;padding:9px 10px}#gh-catalog .rank{min-width:32px;margin-right:8px}}\n<\/style><main><nav><a href=\"https:\/\/www.zhukaifu.cn\/?p=575\">\u2190 \u70ed\u95e8\u4ed3\u5e93\u5217\u8868<\/a><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https:\/\/github.com\/pytorch\/torchtitan\">\u6253\u5f00 GitHub \u4ed3\u5e93<\/a><\/nav><h1>pytorch\/torchtitan<\/h1><p class=\"meta\">\u2605 5,927 \u00b7 Forks 1,092<\/p><article class=\"rapid-understanding\"><p>TorchTitan \u662f\u9762\u5411\u5927\u89c4\u6a21\u751f\u6210\u5f0f AI \u8bad\u7ec3\u7684 PyTorch \u539f\u751f\u5e73\u53f0\u3002\u5b83\u5728\u540c\u4e00\u5957\u4ee3\u7801\u4e2d\u8986\u76d6\u9884\u8bad\u7ec3\u3001\u76d1\u7763\u5fae\u8c03\u548c\u5f3a\u5316\u5b66\u4e60\uff0c\u5e76\u5141\u8bb8\u7814\u7a76\u8005\u7ec4\u5408\u591a\u79cd\u5e76\u884c\u7b56\u7565\uff0c\u65e0\u9700\u4e3a\u6bcf\u79cd\u7ec4\u5408\u91cd\u5199\u6a21\u578b\u3002<\/p><section><h2>\u5e76\u884c\u7b56\u7565\u5982\u4f55\u7ec4\u5408<\/h2><p>\u6a21\u578b\u58f0\u660e\u5982\u4f55\u5206\u7247\uff0cTorchTitan \u901a\u8fc7 PyTorch \u7684 DeviceMesh \u548c DTensor\uff0c\u628a FSDP2\u3001\u5f20\u91cf\u5e76\u884c\u3001\u6d41\u6c34\u7ebf\u5e76\u884c\u3001\u4e0a\u4e0b\u6587\u5e76\u884c\u548c\u4e13\u5bb6\u5e76\u884c\u7ec4\u5408\u5230\u591a\u7ef4\u8bbe\u5907\u5e03\u5c40\u4e2d\u3002\u60f3\u7814\u7a76\u4e0d\u540c\u5e76\u884c\u7b56\u7565\u5982\u4f55\u914d\u5408\uff0c\u53ef\u4ee5\u4ece\u5206\u5e03\u5f0f\u6280\u672f\u6587\u6863\u5165\u624b\uff0c\u518d\u5bf9\u7167\u6a21\u578b\u7684\u5206\u7247\u5b9a\u4e49\u9605\u8bfb\u4ee3\u7801\u3002<\/p><\/section><section><h2>\u6309\u6a21\u578b\u548c\u8bad\u7ec3\u9636\u6bb5\u7b5b\u9009<\/h2><p>README \u7684\u6a21\u578b\u8868\u5206\u522b\u5217\u51fa\u652f\u6301\u7684\u89c4\u6a21\u3001\u6a21\u6001\u3001\u5df2\u9a8c\u8bc1\u914d\u65b9\u548c\u5f3a\u5316\u5b66\u4e60\u652f\u6301\u3002\u4f8b\u5982\uff0cLlama 3 \u548c Qwen3 \u90fd\u6807\u6709\u5f3a\u5316\u5b66\u4e60\u652f\u6301\uff0c\u5e76\u5206\u522b\u5217\u51fa llama3_8b\u3001llama3_70b \u548c qwen3_14b \u7b49\u5df2\u9a8c\u8bc1\u914d\u65b9\u3002\u6309 README \u7684\u8bf4\u660e\uff0c\u6bcf\u4e2a\u6a21\u578b\u90fd\u6709\u5728\u6301\u7eed\u96c6\u6210\u4e2d\u8fd0\u884c\u7684\u8c03\u8bd5\u914d\u7f6e\uff0c\u5df2\u9a8c\u8bc1\u914d\u65b9\u5219\u5728\u8bad\u7ec3\u3001\u6536\u655b\u6216\u6027\u80fd\u9a8c\u8bc1\u6d41\u7a0b\u4e2d\u8fd0\u884c\u8fc7\u3002<\/p><\/section><section><h2>\u4ece\u8c03\u8bd5\u6a21\u578b\u4e0a\u624b<\/h2><p>README \u7684\u5feb\u901f\u5165\u95e8\u4f7f\u7528 Python 3.11 \u6216\u66f4\u9ad8\u7248\u672c\u548c PyTorch nightly\uff0c\u4ece\u6e90\u7801\u5b89\u88c5\u3002\u53ef\u4ee5\u5148\u8fd0\u884c\u8c03\u8bd5\u6a21\u578b\uff0c\u5b83\u4f7f\u7528\u6d4b\u8bd5\u81ea\u5e26\u7684\u5206\u8bcd\u5668\uff0c\u7701\u53bb\u989d\u5916\u4e0b\u8f7d\u3002\u9009\u5b9a\u6b63\u5f0f\u6a21\u578b\u540e\uff0c\u53ef\u4ee5\u4ece\u5df2\u9a8c\u8bc1\u914d\u65b9\u5165\u624b\u3002\u6bcf\u4efd\u914d\u65b9\u90fd\u662f\u8fd4\u56de\u5b8c\u6574\u8fd0\u884c\u914d\u7f6e\u7684 Python \u51fd\u6570\uff0c\u53ef\u4ee5\u590d\u5236\u540e\u4fee\u6539\u3002\u82e5\u76ee\u6807\u662f\u5f3a\u5316\u5b66\u4e60\uff0c\u53ef\u4ee5\u76f4\u63a5\u770b TitanRL \u7684\u5feb\u901f\u5165\u95e8\uff0c\u5176\u4e2d\u5217\u51fa\u4e86\u5355\u72ec\u7684\u73af\u5883\u5b89\u88c5\u5165\u53e3\u3002<\/p><\/section><\/article><\/main><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u2190 \u70ed\u95e8\u4ed3\u5e93\u5217\u8868\u6253\u5f00 GitHub \u4ed3\u5e93 pytorch\/torchtitan &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2543","post","type-post","status-publish","format-standard","hentry","category-thinking"],"_links":{"self":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/2543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2543"}],"version-history":[{"count":2,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/2543\/revisions"}],"predecessor-version":[{"id":2873,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=\/wp\/v2\/posts\/2543\/revisions\/2873"}],"wp:attachment":[{"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhukaifu.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}