Skip to content

Commit 8015533

Browse files
feat(vllm-ascend): add vllm-ascend community sub-site (#118)
1 parent 1fdc48d commit 8015533

File tree

8 files changed

+241
-20
lines changed

8 files changed

+241
-20
lines changed

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@
1111
[submodule "_repos/ms-swift"]
1212
path = _repos/ms-swift
1313
url = https://github.com/modelscope/ms-swift.git
14+
[submodule "_repos/vllm-ascend"]
15+
path = _repos/vllm-ascend
16+
url = https://github.com/vllm-project/vllm-ascend.git
17+
branch = main

Makefile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ PROJECT_CONFIGS = \
1313
_repos/verl/docs/ascend_tutorial:sources/verl \
1414
_repos/VeOmni/docs:sources/VeOmni \
1515
_repos/LLaMA-Factory/docs:sources/LLaMA-Factory \
16-
_repos/ms-swift/docs:sources/ms-swift
16+
_repos/ms-swift/docs:sources/ms-swift \
17+
_repos/vllm-ascend/docs/source:sources/vllm-ascend # vllm-ascend 文档根在 docs/source/ 下
1718

1819
# Configure all subprojects generated path
1920
GENERATED_DOCS := sources/_generated
@@ -68,6 +69,9 @@ copy-docs: init-submodules
6869
@echo "Preparing generated docs directory..."
6970
@mkdir -p $(GENERATED_DOCS)
7071

72+
# vllm-ascend: 仅删除根 index(避免与 sources/vllm-ascend/index.rst 冲突),
73+
# 保留子目录 index(如 tutorials/models/index.md)供 toctree 直接引用。
74+
# 其他社区: 递归删除所有 index,导航由各社区 sources/<comm>/index.rst 独立定义。
7175
@echo "Copying project documentation..."
7276
@for config in $(PROJECT_CONFIGS); do \
7377
src=$$(echo $$config | cut -d: -f1); \
@@ -76,11 +80,16 @@ copy-docs: init-submodules
7680
echo "Copying $$src -> $$dst"; \
7781
rm -rf $$dst; \
7882
mkdir -p $$dst; \
79-
find $$src -name 'index.*' -delete 2>/dev/null || true; \
8083
echo "Copying $$src to $$dst"; \
8184
cp -r "$$src"/* "$$dst"/ 2>/dev/null || echo " [WARN] Source directory does not exist or is empty: $$src"; \
85+
if [ "$$rel_dst" = "sources/vllm-ascend" ]; then \
86+
rm -f "$$dst/index.md" "$$dst/index.rst" "$$dst/index.html" 2>/dev/null || true; \
87+
else \
88+
find "$$dst" -name 'index.*' -delete 2>/dev/null || true; \
89+
fi; \
8290
done
8391

92+
8493
# Clean up submodules
8594
clean-submodules:
8695
@echo "Cleaning up submodules..."

_repos/vllm-ascend

Submodule vllm-ascend added at 2916601

_static/images/vllm-ascend.png

153 KB
Loading

_templates/layout.html

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
document.addEventListener('DOMContentLoaded', function() {
1515
const mapping = {{ comm_config.get('sidebar_mapping', {}) | tojson | safe }};
1616
const commId = '{{ current_community_id }}';
17-
17+
// 根目录文件的显式分组映射(filename → folder key)
18+
const rootFiles = mapping['__root_files__'] || {};
19+
1820
// 获取数据源和目标容器
1921
const globalMenu = document.getElementById('temp-menu-holder');
2022
const targetContainer = document.getElementById('independent-sidebar');
@@ -38,14 +40,13 @@
3840
if (activeL1) {
3941
// 步骤 B: 找到属于这个社区的所有子页面 (<ul>)
4042
const subMenu = activeL1.querySelector('ul');
41-
43+
4244
if (subMenu && subMenu.children.length > 0) {
4345
let currentGroup = null;
4446
let currentUl = null;
4547

4648
// 步骤 C: 遍历所有的子页面,将它们分组并插入到独立侧边栏中
47-
const items = Array.from(subMenu.children);
48-
items.forEach(item => {
49+
Array.from(subMenu.children).forEach(item => {
4950
if (item.tagName.toLowerCase() !== 'li') return;
5051

5152
const link = item.querySelector('a');
@@ -54,9 +55,9 @@
5455
const fullUrl = link.href;
5556
let matchedFolder = null;
5657

57-
// 匹配 conf.py 中配置的文件夹路径
58-
// 使用更精确的匹配:sources/{commId}/{folder}/ 或 sources/_generated/sources/{commId}/{folder}/
58+
// 步骤 D1: 通过 URL 文件夹路径匹配分组(针对有子目录的页面)
5959
for (const folder in mapping) {
60+
if (folder === '__root_files__') continue;
6061
const pattern1 = `/sources/${commId}/${folder}/`;
6162
const pattern2 = `/sources/_generated/sources/${commId}/${folder}/`;
6263
if (fullUrl.includes(pattern1) || fullUrl.includes(pattern2)) {
@@ -65,33 +66,39 @@
6566
}
6667
}
6768

68-
// 如果有的文件放在根目录没匹配到,归入 default
69+
// 步骤 D2: 对根目录文件(无子目录),通过文件名显式映射分组
70+
// 先 split('#') 去掉 URL 片段:当用户处于当前页面时,Sphinx 生成
71+
// href="#",浏览器解析后 link.href 会带 # 后缀(如 quick_start.html#),
72+
// 不去掉会导致文件名变成 "quick_start#" 而无法匹配 __root_files__ 映射。
73+
if (!matchedFolder) {
74+
const filename = fullUrl.split('#')[0].split('/').pop().replace('.html', '');
75+
if (rootFiles[filename]) {
76+
matchedFolder = rootFiles[filename];
77+
}
78+
}
79+
80+
// 步骤 D3: 仍未匹配则归入当前分组(兜底)
6981
if (!matchedFolder) {
7082
matchedFolder = currentGroup || 'default';
7183
}
7284

73-
// 步骤 D: 遇到新分组时,创建大标题和新的 <ul>
85+
// 步骤 E: 遇到新分组时,创建大标题和新的 <ul>
7486
if (currentGroup !== matchedFolder) {
7587
if (mapping[matchedFolder]) {
7688
const caption = document.createElement('p');
7789
caption.className = 'caption custom-sidebar-caption';
7890
caption.innerHTML = `<span class="caption-text">${mapping[matchedFolder]}</span>`;
7991
targetContainer.appendChild(caption);
8092
}
81-
8293
currentUl = document.createElement('ul');
8394
targetContainer.appendChild(currentUl);
8495
currentGroup = matchedFolder;
8596
}
8697

87-
// 步骤 E: 智能动态提升整棵树的级数,完美支持长文档的内部 H2/H3 目录显示
88-
// 找出该节点及其内部所有的级联列表项
89-
const allTocItems = [item, ...item.querySelectorAll('[class*="toctree-l"]')];
90-
allTocItems.forEach(el => {
91-
// 将 toctree-l(X) 动态替换为 toctree-l(X-1)
98+
// 步骤 F: 智能动态提升整棵树的级数,完美支持长文档的内部 H2/H3 目录显示
99+
[item, ...item.querySelectorAll('[class*="toctree-l"]')].forEach(el => {
92100
el.className = el.className.replace(/toctree-l(\d+)/g, function(match, level) {
93-
const newLevel = parseInt(level, 10) - 1;
94-
return 'toctree-l' + newLevel;
101+
return 'toctree-l' + (parseInt(level, 10) - 1);
95102
});
96103
});
97104

@@ -101,7 +108,7 @@
101108
}
102109
});
103110

104-
// 步骤 F: 彻底删除隐蔽的全局菜单
111+
// 步骤 G: 彻底删除隐蔽的全局菜单
105112
globalMenu.remove();
106113
return;
107114
}

conf.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
'sphinx.ext.autodoc',
3434
'sphinxext.remoteliteralinclude',
3535
'sphinx_copybutton',
36-
'sphinx_markdown_tables',
3736
"sphinx_design",
3837
'myst_parser',
3938
]
@@ -214,6 +213,22 @@ def generate_api_doc():
214213
'contribution_guide': '🔧 开源开发'
215214
}
216215
},
216+
'vllm-ascend': {
217+
'display_name': 'vllm-ascend',
218+
'sidebar_mapping': {
219+
'getting_started': 'Getting Started',
220+
'user_guide': 'User Guide',
221+
'developer_guide': 'Developer Guide',
222+
'community': 'Community',
223+
# __root_files__: 根目录下无子目录的文件需显式映射到所属分组
224+
# 否则侧边栏无法按目录路径自动归类
225+
'__root_files__': {
226+
'quick_start': 'getting_started',
227+
'installation': 'getting_started',
228+
'faqs': 'getting_started',
229+
},
230+
}
231+
},
217232
}
218233
}
219234

index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@
257257
<div class="card-footer"><a href="https://github.com/pytorch/torchchat">官方链接</a><span class="split">|</span><a href="sources/torchchat/install.html">安装指南</a><span class="split">|</span><a href="sources/torchchat/quick_start.html">快速上手</a></div>
258258
</div>
259259

260+
<!-- vllm-ascend -->
261+
<div class="project-card">
262+
<div class="card-top"><div class="card-icon" style="background-image: url('_static/images/vllm-ascend.png')"></div><h3 class="card-title">vLLM-Ascend</h3></div>
263+
<p class="card-desc">面向昇腾 NPU 的 vLLM 社区插件,支持主流大模型高性能推理加速。</p>
264+
<div class="card-footer"><a href="https://github.com/vllm-project/vllm-ascend">官方链接</a><span class="split">|</span><a href="sources/_generated/sources/vllm-ascend/installation.html">安装指南</a><span class="split">|</span><a href="sources/_generated/sources/vllm-ascend/quick_start.html">快速上手</a></div>
265+
</div>
266+
260267
</div>
261268

262269
<h2 class="scene-header">🎨 多模态应用、评测与工具</h2>
@@ -373,6 +380,7 @@
373380
sources/sentence_transformers/index.rst
374381
sources/sglang/index.rst
375382
sources/torchchat/index.rst
383+
sources/vllm-ascend/index.rst
376384

377385
.. toctree::
378386
:maxdepth: 1

sources/vllm-ascend/index.rst

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
vLLM-Ascend
2+
============================================
3+
4+
.. raw:: html
5+
6+
<style>
7+
/* 样式隔离:仅作用于 vllm-ascend 首页 */
8+
#vllm-ascend-portal {
9+
--va-primary: #0066cc;
10+
--va-secondary: #00a86b;
11+
--va-accent: #ff6b35;
12+
--va-purple: #9d4edd;
13+
--va-text-main: #1a1a1a;
14+
--va-text-sub: #666666;
15+
--va-border: #e1e4e8;
16+
--va-bg-light: #f6f8fa;
17+
font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica;
18+
}
19+
20+
/* 英雄区 */
21+
.va-hero {
22+
background: linear-gradient(135deg, var(--va-primary) 0%, #004a99 100%);
23+
color: white;
24+
padding: 60px 40px;
25+
border-radius: 12px;
26+
margin: 20px 0 40px 0;
27+
text-align: center;
28+
box-shadow: 0 8px 24px rgba(0, 102, 204, 0.15);
29+
}
30+
.va-hero h1 { color: white !important; border: none !important; margin: 0 0 15px 0 !important; font-size: 2.8rem !important; }
31+
.va-hero-subtitle { font-size: 1.2rem; opacity: 0.95; margin-bottom: 30px; }
32+
.va-hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
33+
.va-btn {
34+
padding: 12px 30px; border-radius: 6px; text-decoration: none !important;
35+
font-weight: 600; transition: all 0.3s ease; border: 2px solid white;
36+
}
37+
.va-btn-primary { background: white; color: var(--va-primary) !important; }
38+
.va-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.2); }
39+
40+
/* 快速开始卡片 */
41+
.va-section-title { text-align: center; color: var(--va-primary); margin: 50px 0 30px 0; font-size: 2rem; border: none !important; }
42+
.va-quick-grid {
43+
display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
44+
gap: 20px; margin-top: 30px;
45+
}
46+
.va-quick-card {
47+
text-decoration: none !important; border: 1px solid var(--va-border);
48+
padding: 25px; border-radius: 10px; text-align: center; transition: 0.3s; background: white;
49+
}
50+
.va-quick-card:hover { border-color: var(--va-primary); transform: scale(1.03); box-shadow: 0 10px 20px rgba(0,102,204,0.1); }
51+
.va-quick-card h4 { color: var(--va-primary); margin: 12px 0 6px 0 !important; border: none !important; font-size: 1.05rem !important; }
52+
.va-quick-card p { color: var(--va-text-sub); font-size: 0.85rem; margin: 0; }
53+
54+
/* 核心特性标签 */
55+
.va-features-wrapper {
56+
background: var(--va-bg-light); border-radius: 12px;
57+
padding: 35px 25px; margin: 50px 0 20px 0; text-align: center;
58+
}
59+
.va-feature-tags {
60+
display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px;
61+
}
62+
.va-feature-tag {
63+
display: inline-flex; align-items: center; gap: 6px;
64+
background: white; border: 1px solid var(--va-border); border-radius: 20px;
65+
padding: 8px 18px; font-size: 0.9rem; color: var(--va-text-main);
66+
transition: all 0.3s ease;
67+
}
68+
.va-feature-tag:hover { border-color: var(--va-primary); box-shadow: 0 4px 8px rgba(0,102,204,0.1); }
69+
70+
@media (max-width: 768px) {
71+
.va-hero h1 { font-size: 2rem !important; }
72+
.va-quick-grid { grid-template-columns: 1fr 1fr; }
73+
}
74+
</style>
75+
76+
<div id="vllm-ascend-portal">
77+
78+
<!-- 英雄区:仅 GitHub 按钮 -->
79+
<div class="va-hero">
80+
<h1>vllm-ascend</h1>
81+
<p class="va-hero-subtitle">
82+
面向昇腾 NPU 的 vLLM 社区插件 · 高性能 LLM 推理加速
83+
</p>
84+
<div class="va-hero-buttons">
85+
<a href="https://github.com/vllm-project/vllm-ascend" class="va-btn va-btn-primary" target="_blank">📖 GitHub 仓库</a>
86+
</div>
87+
</div>
88+
89+
<!-- 快速开始:第一视觉,4 张卡片 -->
90+
<h2 class="va-section-title">🚀 快速开始</h2>
91+
<div class="va-quick-grid">
92+
<a href="../_generated/sources/vllm-ascend/installation.html" class="va-quick-card">
93+
<div style="font-size: 2rem;">📦</div>
94+
<h4>安装指南</h4>
95+
<p>环境准备与安装步骤</p>
96+
</a>
97+
<a href="../_generated/sources/vllm-ascend/quick_start.html" class="va-quick-card">
98+
<div style="font-size: 2rem;">🚀</div>
99+
<h4>快速上手</h4>
100+
<p>5 分钟跑通推理任务</p>
101+
</a>
102+
<a href="../_generated/sources/vllm-ascend/user_guide/feature_guide/index.html" class="va-quick-card">
103+
<div style="font-size: 2rem;">📖</div>
104+
<h4>用户指南</h4>
105+
<p>特性配置与部署方案</p>
106+
</a>
107+
<a href="../_generated/sources/vllm-ascend/developer_guide/contribution/index.html" class="va-quick-card">
108+
<div style="font-size: 2rem;">👨‍💻</div>
109+
<h4>开发者指南</h4>
110+
<p>贡献代码与特性开发</p>
111+
</a>
112+
</div>
113+
114+
<!-- 核心特性:标签式一行展示 -->
115+
<div class="va-features-wrapper">
116+
<h2 style="text-align:center; color:var(--va-primary); margin: 0 0 5px 0; border:none !important;">✨ 核心特性</h2>
117+
<div class="va-feature-tags">
118+
<span class="va-feature-tag">🔌 硬件插件化架构</span>
119+
<span class="va-feature-tag">⚡ 高性能推理加速</span>
120+
<span class="va-feature-tag">🧩 丰富模型支持</span>
121+
<span class="va-feature-tag">🌐 分布式推理</span>
122+
<span class="va-feature-tag">🔧 完整工具链</span>
123+
<span class="va-feature-tag">🤝 社区共建</span>
124+
</div>
125+
</div>
126+
127+
</div>
128+
129+
----
130+
131+
.. 以下 toctree 直接引用 upstream submodule 的子目录 index 文件(如 tutorials/models/index),
132+
.. 无需额外的 nav RST 包装文件。路径从 sources/vllm-ascend/ 出发,
133+
.. 通过 ../_generated/sources/vllm-ascend/ 指向 make copy-docs 生成的内容。
134+
.. Makefile 仅删除 upstream 根目录 index(避免与本文件冲突),子目录 index 完整保留。
135+
136+
.. toctree::
137+
:maxdepth: 2
138+
:hidden:
139+
:caption: Getting Started
140+
141+
../_generated/sources/vllm-ascend/quick_start
142+
../_generated/sources/vllm-ascend/installation
143+
../_generated/sources/vllm-ascend/tutorials/models/index
144+
../_generated/sources/vllm-ascend/tutorials/features/index
145+
../_generated/sources/vllm-ascend/tutorials/hardwares/index
146+
../_generated/sources/vllm-ascend/faqs
147+
148+
.. toctree::
149+
:maxdepth: 2
150+
:hidden:
151+
:caption: User Guide
152+
153+
../_generated/sources/vllm-ascend/user_guide/support_matrix/index
154+
../_generated/sources/vllm-ascend/user_guide/configuration/index
155+
../_generated/sources/vllm-ascend/user_guide/feature_guide/index
156+
../_generated/sources/vllm-ascend/user_guide/deployment_guide/index
157+
../_generated/sources/vllm-ascend/user_guide/release_notes
158+
159+
.. toctree::
160+
:maxdepth: 2
161+
:hidden:
162+
:caption: Developer Guide
163+
164+
../_generated/sources/vllm-ascend/developer_guide/contribution/index
165+
../_generated/sources/vllm-ascend/developer_guide/feature_guide/index
166+
../_generated/sources/vllm-ascend/developer_guide/evaluation/index
167+
../_generated/sources/vllm-ascend/developer_guide/performance_and_debug/index
168+
169+
.. toctree::
170+
:maxdepth: 1
171+
:hidden:
172+
:caption: Community
173+
174+
../_generated/sources/vllm-ascend/community/governance
175+
../_generated/sources/vllm-ascend/community/contributors
176+
../_generated/sources/vllm-ascend/community/versioning_policy
177+
../_generated/sources/vllm-ascend/community/user_stories/index

0 commit comments

Comments
 (0)