{"id":28724,"date":"2025-03-16T18:27:19","date_gmt":"2025-03-16T10:27:19","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=28724"},"modified":"2025-03-16T18:27:19","modified_gmt":"2025-03-16T10:27:19","slug":"chitu","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/pt\/chitu\/","title":{"rendered":"Chitu\uff08\u8d64\u5154\uff09\uff1a\u6e05\u534e\u56e2\u961f\u63a8\u51fa\u7684\u9ad8\u6027\u80fd\u5927\u8bed\u8a00\u6a21\u578b\u63a8\u7406\u6846\u67b6"},"content":{"rendered":"<p>Chitu \u662f\u4e00\u4e2a\u7531\u6e05\u534e\u5927\u5b66 PACMAN \u56e2\u961f\u5f00\u53d1\u7684\u5f00\u6e90\u63a8\u7406\u6846\u67b6\uff0c\u5168\u540d\u53eb\u201c\u8d64\u5154\u201d\uff0c\u4e13\u95e8\u7528\u6765\u8dd1\u5927\u8bed\u8a00\u6a21\u578b\u3002\u5b83\u4e3b\u6253\u9ad8\u6548\u3001\u7075\u6d3b\u548c\u5b9e\u7528\uff0c\u80fd\u8ba9\u4f01\u4e1a\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u5feb\u901f\u90e8\u7f72\u5927\u6a21\u578b\u3002Chitu \u652f\u6301\u591a\u79cd\u786c\u4ef6\uff0c\u6bd4\u5982 NVIDIA \u7684 GPU \u548c\u56fd\u4ea7\u82af\u7247\uff0c\u8fd8\u80fd\u4ece\u5355\u673a\u7528\u5230\u5927\u89c4\u6a21\u96c6\u7fa4\u3002<strong>\u5b83\u7684\u4eae\u70b9\u662f\u7528 FP8 \u6a21\u578b\u63a8\u7406\uff0c\u80fd\u5927\u5e45\u964d\u4f4e\u6210\u672c\uff0c\u6bd4\u5982\u5728 A800 \u4e0a\u8dd1 DeepSeek-671B\uff0c\u6bd4 vLLM \u5c11\u7528\u4e00\u534a GPU\uff0c\u901f\u5ea6\u8fd8\u5feb\u4e86 3 \u500d\u591a\u3002<\/strong>\u4ee3\u7801\u5df2\u5728 GitHub \u4e0a\u516c\u5f00\uff0c\u4f01\u4e1a\u6216\u4e2a\u4eba\u90fd\u80fd\u514d\u8d39\u4e0b\u8f7d\u4f7f\u7528\u3002\u8fd9\u662f\u4e2a\u751f\u4ea7\u73af\u5883\u5f00\u7bb1\u5373\u7528\u7684\u5de5\u5177\uff0c\u9002\u5408\u60f3\u7701\u94b1\u53c8\u8981\u6027\u80fd\u7684\u56e2\u961f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-28725\" title=\"Chitu\uff08\u8d64\u5154\uff09\uff1a\u6e05\u534e\u56e2\u961f\u63a8\u51fa\u7684\u9ad8\u6027\u80fd\u5927\u8bed\u8a00\u6a21\u578b\u63a8\u7406\u6846\u67b6-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/05efe796492e575.jpg\" alt=\"Chitu\uff08\u8d64\u5154\uff09\uff1a\u6e05\u534e\u56e2\u961f\u63a8\u51fa\u7684\u9ad8\u6027\u80fd\u5927\u8bed\u8a00\u6a21\u578b\u63a8\u7406\u6846\u67b6-1\" width=\"626\" height=\"313\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/05efe796492e575.jpg 1200w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/05efe796492e575-768x384.jpg 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/05efe796492e575-18x9.jpg 18w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li>\u652f\u6301 FP8 \u548c BF16 \u6a21\u578b\u63a8\u7406\uff0c\u80fd\u5728\u8001\u6b3e GPU \u548c\u56fd\u4ea7\u82af\u7247\u4e0a\u8dd1\uff0c\u6210\u672c\u4f4e\u6027\u80fd\u9ad8\u3002<\/li>\n<li>\u9002\u914d\u591a\u79cd\u786c\u4ef6\uff0c\u4ece\u7eaf CPU \u5230 NVIDIA A800\u3001H20 \u7b49 GPU\uff0c\u518d\u5230\u5927\u89c4\u6a21\u96c6\u7fa4\u90fd\u884c\u3002<\/li>\n<li>\u7528 CUDA Graph \u4f18\u5316\u63a8\u7406\u901f\u5ea6\uff0c\u5355\u6b21\u8bf7\u6c42\u7684\u8f93\u51fa\u66f4\u5feb\u3002<\/li>\n<li>\u63d0\u4f9b\u670d\u52a1\u63a5\u53e3\uff0c\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7 HTTP \u8bf7\u6c42\u8c03\u7528\u6a21\u578b\u3002<\/li>\n<li>\u652f\u6301\u591a\u8282\u70b9\u5206\u5e03\u5f0f\u63a8\u7406\uff0c\u9002\u5408\u5927\u6279\u91cf\u4efb\u52a1\u5904\u7406\u3002<\/li>\n<li>\u5f00\u6e90\u4ee3\u7801\uff0c\u4f01\u4e1a\u53ef\u4ee5\u6309\u9700\u6539\u52a8\u6216\u4f18\u5316\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<p>Chitu \u7684\u5b89\u88c5\u4e0d\u7b97\u590d\u6742\uff0c\u4f46\u9700\u8981\u4e00\u4e9b\u51c6\u5907\u5de5\u4f5c\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li><strong>\u51c6\u5907\u73af\u5883<\/strong>\n<ul>\n<li>\u7cfb\u7edf\uff1a\u63a8\u8350 Ubuntu 22.04\uff0c\u5e26 NVIDIA GPU \u7684\u673a\u5668\uff08\u6bd4\u5982 A800 \u6216 H20\uff09\u3002<\/li>\n<li>\u8f6f\u4ef6\uff1a\u5b89\u88c5 Git\u3001Python 3.10\u3001CUDA 12.1\uff08\u6839\u636e\u4f60\u7684 GPU \u7248\u672c\u8c03\u6574\uff09\u3001PyTorch 2.1\u3002<\/li>\n<li>\u547d\u4ee4\u793a\u4f8b\uff1a\n<pre><code>sudo apt update &amp;&amp; sudo apt install -y git python3.10 python3-pip\r\npip install -U torch==2.1 --index-url https:\/\/download.pytorch.org\/whl\/cu121\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u4e0b\u8f7d\u4ee3\u7801<\/strong>\n<ul>\n<li>\u7528 Git \u628a Chitu \u7684\u4ee3\u7801\u514b\u9686\u5230\u672c\u5730\uff1a\n<pre><code>git clone --recursive https:\/\/github.com\/thu-pacman\/chitu\r\ncd chitu\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong>\n<ul>\n<li>\u5b89\u88c5\u9700\u8981\u7684 Python \u5305\u548c\u7f16\u8bd1\u73af\u5883\uff1a\n<pre><code>pip install -r requirements-build.txt\r\npip install flash-attn\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u7f16\u8bd1\u5b89\u88c5<\/strong>\n<ul>\n<li>\u8bbe\u7f6e\u7f16\u8bd1\u53c2\u6570\uff08\u6839\u636e\u4f60\u7684 GPU \u8c03\u6574 TORCH_CUDA_ARCH_LIST\uff0c\u6bd4\u5982 A800 \u7528 8.0\uff09\uff0c\u7136\u540e\u7f16\u8bd1\uff1a\n<pre><code>TORCH_CUDA_ARCH_LIST=8.0 CHITU_SETUP_JOBS=4 MAX_JOBS=4 pip install --no-build-isolation .\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u68c0\u67e5\u5b89\u88c5<\/strong>\n<ul>\n<li>\u8dd1\u4e2a\u6d4b\u8bd5\u786e\u8ba4\u6ca1\u95ee\u9898\uff1a\n<pre><code>torchrun --nproc_per_node 1 test\/single_req_test.py\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u5982\u4f55\u4f7f\u7528<\/h3>\n<p>Chitu \u88c5\u597d\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8\u670d\u52a1\uff0c\u6216\u8005\u8dd1\u5355\u6b21\u6d4b\u8bd5\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u64cd\u4f5c\uff1a<\/p>\n<h4>\u542f\u52a8\u63a8\u7406\u670d\u52a1<\/h4>\n<ol>\n<li><strong>\u914d\u7f6e\u6a21\u578b\u8def\u5f84<\/strong>\n<ul>\n<li>\u51c6\u5907\u597d\u6a21\u578b\u6587\u4ef6\uff0c\u6bd4\u5982 DeepSeek-R1\uff0c\u653e\u5728\u672c\u5730\u76ee\u5f55\uff08\u5982\u00a0<code>\/data\/DeepSeek-R1<\/code>\uff09\u3002<\/li>\n<li>\u7f16\u8f91\u547d\u4ee4\u91cc\u7684\u00a0<code>models.ckpt_dir<\/code>\u00a0\u53c2\u6570\u6307\u5411\u6a21\u578b\u8def\u5f84\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u542f\u52a8\u670d\u52a1<\/strong>\n<ul>\n<li>\u7528 torchrun \u542f\u52a8\u5355\u673a\u670d\u52a1\uff0c\u76d1\u542c 21002 \u7aef\u53e3\uff1a\n<pre><code>export WORLD_SIZE=1\r\ntorchrun --nproc_per_node 1 chitu\/serve.py \\\r\nserve.port=21002 \\\r\nmodels=DeepSeek-R1 \\\r\nmodels.ckpt_dir=\/data\/DeepSeek-R1 \\\r\ninfer.use_cuda_graph=True \\\r\nrequest.max_new_tokens=100\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u6d4b\u8bd5\u670d\u52a1<\/strong>\n<ul>\n<li>\u7528 curl \u53d1\u9001\u8bf7\u6c42\uff0c\u770b\u770b\u6a21\u578b\u80fd\u4e0d\u80fd\u6b63\u5e38\u56de\u7b54\uff1a\n<pre><code>curl localhost:21002\/v1\/chat\/completions \\\r\n-H \"Content-Type: application\/json\" \\\r\n-d '{\"messages\": [{\"role\": \"user\", \"content\": \"\u4f60\u597d\uff0cChitu \u662f\u4ec0\u4e48\uff1f\"}]}'\r\n<\/code><\/pre>\n<\/li>\n<li>\u8fd4\u56de\u7ed3\u679c\u4f1a\u662f JSON \u683c\u5f0f\uff0c\u5305\u542b\u6a21\u578b\u7684\u56de\u7b54\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h4>\u8dd1\u5355\u6b21\u63a8\u7406\u6d4b\u8bd5<\/h4>\n<ul>\n<li>\u5982\u679c\u4e0d\u60f3\u542f\u52a8\u670d\u52a1\uff0c\u53ef\u4ee5\u76f4\u63a5\u6d4b\u8bd5\u6a21\u578b\u8f93\u51fa\uff1a\n<pre><code>torchrun --nproc_per_node 1 test\/single_req_test.py \\\r\nmodels=DeepSeek-R1 \\\r\nmodels.ckpt_dir=\/data\/DeepSeek-R1 \\\r\nrequest.max_new_tokens=64<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>\u8f93\u51fa\u4f1a\u5728\u7ec8\u7aef\u663e\u793a\uff0c\u544a\u8bc9\u4f60\u6a21\u578b\u751f\u6210\u4e86\u4ec0\u4e48\u3002<\/li>\n<\/ul>\n<h4>\u591a\u8282\u70b9\u5206\u5e03\u5f0f\u63a8\u7406<\/h4>\n<ol>\n<li><strong>\u51c6\u5907\u591a\u53f0\u673a\u5668<\/strong>\n<ul>\n<li>\u786e\u4fdd\u6bcf\u53f0\u673a\u5668\u88c5\u597d Chitu \u548c\u4f9d\u8d56\uff0c\u6a21\u578b\u6587\u4ef6\u653e\u5728\u5171\u4eab\u5b58\u50a8\u4e0a\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u542f\u52a8\u5206\u5e03\u5f0f\u670d\u52a1<\/strong>\n<ul>\n<li>\u7528 2 \u53f0\u673a\u5668\uff0c\u6bcf\u53f0 8 \u4e2a GPU \u8dd1\uff1a\n<pre><code>torchrun --nnodes 2 --nproc_per_node 8 test\/single_req_test.py \\\r\nrequest.max_new_tokens=64 \\\r\ninfer.pp_size=2 \\\r\ninfer.tp_size=8 \\\r\nmodels=DeepSeek-R1 \\\r\nmodels.ckpt_dir=\/data\/DeepSeek-R1\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u68c0\u67e5\u6548\u679c<\/strong>\n<ul>\n<li>\u591a\u8282\u70b9\u8dd1\u5b8c\u540e\uff0c\u8f93\u51fa\u901f\u5ea6\u4f1a\u6bd4\u5355\u673a\u5feb\uff0c\u9002\u5408\u5904\u7406\u5927\u6279\u91cf\u8bf7\u6c42\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u7279\u8272\u529f\u80fd\u64cd\u4f5c<\/h3>\n<h4>\u7528 FP8 \u6a21\u578b\u7701\u94b1\u63d0\u901f<\/h4>\n<ul>\n<li>Chitu \u652f\u6301 FP8 \u683c\u5f0f\u6a21\u578b\uff0c\u6bd4 BF16 \u7528\u66f4\u5c11\u7684 GPU\uff0c\u901f\u5ea6\u8fd8\u66f4\u5feb\u3002<\/li>\n<li>\u64cd\u4f5c\uff1a\u542f\u52a8\u65f6\u52a0\u00a0<code>infer.soft_fp8=True<\/code>\uff0c\u786e\u4fdd\u6a21\u578b\u662f FP8 \u683c\u5f0f\u3002\u6bd4\u5982\uff1a\n<pre><code>torchrun --nproc_per_node 1 chitu\/serve.py \\\r\nserve.port=21002 \\\r\nmodels=DeepSeek-R1 \\\r\nmodels.ckpt_dir=\/data\/DeepSeek-R1 \\\r\ninfer.soft_fp8=True\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>\u7528 CUDA Graph \u52a0\u901f<\/h4>\n<ul>\n<li>\u5355\u6b21\u8bf7\u6c42\u53ef\u4ee5\u7528 CUDA Graph \u63d0\u901f\uff0c\u52a0\u53c2\u6570\u00a0<code>infer.use_cuda_graph=True<\/code>\u3002<\/li>\n<li>\u6d4b\u8bd5\u6548\u679c\uff1a\u8dd1\u5355\u6b21\u63a8\u7406\uff0c\u5bf9\u6bd4\u52a0\u548c\u4e0d\u52a0\u7684\u901f\u5ea6\u5dee\u522b\u3002<\/li>\n<\/ul>\n<h4>\u6027\u80fd\u6d4b\u8bd5<\/h4>\n<ul>\n<li>Chitu \u81ea\u5e26\u57fa\u51c6\u6d4b\u8bd5\u5de5\u5177\uff0c\u6d4b\u6d4b\u541e\u5410\u91cf\u548c\u5ef6\u8fdf\uff1a\n<pre><code>python benchmarks\/benchmark_serving.py \\\r\n--model \"<a href=\"https:\/\/www.kdjingpai.com\/de\/deepseek-r1nenglixiang\/\">deepseek-r1<\/a>\" \\\r\n--iterations 10 \\\r\n--seq-len 10 \\\r\n--base-url http:\/\/localhost:21002\r\n<\/code><\/pre>\n<\/li>\n<li>\u7ed3\u679c\u4f1a\u663e\u793a\u6bcf\u79d2\u5904\u7406\u7684 <a href=\"https:\/\/www.kdjingpai.com\/de\/tokenization\/\">token<\/a> \u6570\uff0c\u5e2e\u4f60\u4f18\u5316\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<ul>\n<li>\u5982\u679c\u7528\u591a\u8282\u70b9\uff0c\u7f51\u7edc\u5f97\u7a33\u5b9a\uff0c\u4e0d\u7136\u4f1a\u6389\u7ebf\u3002<\/li>\n<li>GPU \u663e\u5b58\u4e0d\u591f\u53ef\u80fd\u62a5 OOM \u9519\u8bef\uff0c\u8c03\u4f4e\u00a0<code>infer.max_seq_len<\/code>\u00a0\u6216\u7528\u66f4\u5c11\u8282\u70b9\u3002<\/li>\n<li>\u56fd\u4ea7\u82af\u7247\u652f\u6301\u8fd8\u5728\u4f18\u5316\u4e2d\uff0c\u53ef\u80fd\u9700\u8981\u6539\u4ee3\u7801\u9002\u914d\u3002<\/li>\n<\/ul>\n<p>Chitu \u7684\u64cd\u4f5c\u4e0d\u96be\uff0c\u8ddf\u7740\u6b65\u9aa4\u8d70\u5c31\u80fd\u4e0a\u624b\u3002\u5b83\u7684\u6587\u6863\u548c\u793e\u533a\u4e5f\u5728 GitHub \u4e0a\uff0c\u6709\u95ee\u9898\u53ef\u4ee5\u63d0 issue\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chitu \u662f\u4e00\u4e2a\u7531\u6e05\u534e\u5927\u5b66 PACMAN \u56e2\u961f\u5f00\u53d1\u7684\u5f00\u6e90\u63a8\u7406\u6846\u67b6\uff0c\u5168\u540d\u53eb\u201c\u8d64\u5154\u201d\uff0c\u4e13\u95e8\u7528\u6765\u8dd1\u5927\u8bed\u8a00\u6a21\u578b\u3002\u5b83\u4e3b\u6253\u9ad8\u6548\u3001\u7075\u6d3b\u548c\u5b9e\u7528\uff0c\u80fd\u8ba9\u4f01\u4e1a\u5728\u4e0d\u540c\u8bbe\u5907\u4e0a\u5feb\u901f\u90e8\u7f72\u5927\u6a21\u578b\u3002Chitu \u652f\u6301\u591a\u79cd\u786c\u4ef6\uff0c\u6bd4\u5982 NVIDIA \u7684 GPU \u548c\u56fd\u4ea7\u82af\u7247\uff0c\u8fd8\u80fd&#8230;<\/p>\n","protected":false},"author":1,"featured_media":62044,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[230],"class_list":["post-28724","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aikaiyuanxiangmu"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/posts\/28724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/comments?post=28724"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/posts\/28724\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/media\/62044"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/media?parent=28724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/categories?post=28724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/pt\/wp-json\/wp\/v2\/tags?post=28724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}