Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
[submodule "_repos/ms-swift"]
path = _repos/ms-swift
url = https://github.com/modelscope/ms-swift.git
[submodule "_repos/vllm-ascend"]
path = _repos/vllm-ascend
url = https://github.com/vllm-project/vllm-ascend.git
branch = main
13 changes: 11 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ PROJECT_CONFIGS = \
_repos/verl/docs/ascend_tutorial:sources/verl \
_repos/VeOmni/docs:sources/VeOmni \
_repos/LLaMA-Factory/docs:sources/LLaMA-Factory \
_repos/ms-swift/docs:sources/ms-swift
_repos/ms-swift/docs:sources/ms-swift \
_repos/vllm-ascend/docs/source:sources/vllm-ascend # vllm-ascend 文档根在 docs/source/ 下

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

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


# Clean up submodules
clean-submodules:
@echo "Cleaning up submodules..."
Expand Down
1 change: 1 addition & 0 deletions _repos/vllm-ascend
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered updating the Commit ID to the latest release of vllm-ascend? vllm-project/vllm-ascend@e20f0b1

Submodule vllm-ascend added at 291660
Binary file added _static/images/vllm-ascend.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 24 additions & 17 deletions _templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
document.addEventListener('DOMContentLoaded', function() {
const mapping = {{ comm_config.get('sidebar_mapping', {}) | tojson | safe }};
const commId = '{{ current_community_id }}';

// 根目录文件的显式分组映射(filename → folder key)
const rootFiles = mapping['__root_files__'] || {};

// 获取数据源和目标容器
const globalMenu = document.getElementById('temp-menu-holder');
const targetContainer = document.getElementById('independent-sidebar');
Expand All @@ -38,14 +40,13 @@
if (activeL1) {
// 步骤 B: 找到属于这个社区的所有子页面 (<ul>)
const subMenu = activeL1.querySelector('ul');

if (subMenu && subMenu.children.length > 0) {
let currentGroup = null;
let currentUl = null;

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

const link = item.querySelector('a');
Expand All @@ -54,9 +55,9 @@
const fullUrl = link.href;
let matchedFolder = null;

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

// 如果有的文件放在根目录没匹配到,归入 default
// 步骤 D2: 对根目录文件(无子目录),通过文件名显式映射分组
// 先 split('#') 去掉 URL 片段:当用户处于当前页面时,Sphinx 生成
// href="#",浏览器解析后 link.href 会带 # 后缀(如 quick_start.html#),
// 不去掉会导致文件名变成 "quick_start#" 而无法匹配 __root_files__ 映射。
if (!matchedFolder) {
const filename = fullUrl.split('#')[0].split('/').pop().replace('.html', '');
if (rootFiles[filename]) {
matchedFolder = rootFiles[filename];
}
}

// 步骤 D3: 仍未匹配则归入当前分组(兜底)
if (!matchedFolder) {
matchedFolder = currentGroup || 'default';
}

// 步骤 D: 遇到新分组时,创建大标题和新的 <ul>
// 步骤 E: 遇到新分组时,创建大标题和新的 <ul>
if (currentGroup !== matchedFolder) {
if (mapping[matchedFolder]) {
const caption = document.createElement('p');
caption.className = 'caption custom-sidebar-caption';
caption.innerHTML = `<span class="caption-text">${mapping[matchedFolder]}</span>`;
targetContainer.appendChild(caption);
}

currentUl = document.createElement('ul');
targetContainer.appendChild(currentUl);
currentGroup = matchedFolder;
}

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

Expand All @@ -101,7 +108,7 @@
}
});

// 步骤 F: 彻底删除隐蔽的全局菜单
// 步骤 G: 彻底删除隐蔽的全局菜单
globalMenu.remove();
return;
}
Expand Down
17 changes: 16 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
'sphinx.ext.autodoc',
'sphinxext.remoteliteralinclude',
'sphinx_copybutton',
'sphinx_markdown_tables',
"sphinx_design",
'myst_parser',
]
Expand Down Expand Up @@ -214,6 +213,22 @@ def generate_api_doc():
'contribution_guide': '🔧 开源开发'
}
},
'vllm-ascend': {
'display_name': 'vllm-ascend',
'sidebar_mapping': {
'getting_started': 'Getting Started',
'user_guide': 'User Guide',
'developer_guide': 'Developer Guide',
'community': 'Community',
# __root_files__: 根目录下无子目录的文件需显式映射到所属分组
# 否则侧边栏无法按目录路径自动归类
'__root_files__': {
'quick_start': 'getting_started',
'installation': 'getting_started',
'faqs': 'getting_started',
},
}
},
}
}

Expand Down
8 changes: 8 additions & 0 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@
<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>
</div>

<!-- vllm-ascend -->
<div class="project-card">
<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>
<p class="card-desc">面向昇腾 NPU 的 vLLM 社区插件,支持主流大模型高性能推理加速。</p>
<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>
</div>

</div>

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

.. toctree::
:maxdepth: 1
Expand Down
177 changes: 177 additions & 0 deletions sources/vllm-ascend/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
vLLM-Ascend
============================================

.. raw:: html

<style>
/* 样式隔离:仅作用于 vllm-ascend 首页 */
#vllm-ascend-portal {
--va-primary: #0066cc;
--va-secondary: #00a86b;
--va-accent: #ff6b35;
--va-purple: #9d4edd;
--va-text-main: #1a1a1a;
--va-text-sub: #666666;
--va-border: #e1e4e8;
--va-bg-light: #f6f8fa;
font-family: -apple-system, system-ui, Segoe UI, Roboto, Helvetica;
}

/* 英雄区 */
.va-hero {
background: linear-gradient(135deg, var(--va-primary) 0%, #004a99 100%);
color: white;
padding: 60px 40px;
border-radius: 12px;
margin: 20px 0 40px 0;
text-align: center;
box-shadow: 0 8px 24px rgba(0, 102, 204, 0.15);
}
.va-hero h1 { color: white !important; border: none !important; margin: 0 0 15px 0 !important; font-size: 2.8rem !important; }
.va-hero-subtitle { font-size: 1.2rem; opacity: 0.95; margin-bottom: 30px; }
.va-hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.va-btn {
padding: 12px 30px; border-radius: 6px; text-decoration: none !important;
font-weight: 600; transition: all 0.3s ease; border: 2px solid white;
}
.va-btn-primary { background: white; color: var(--va-primary) !important; }
.va-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.2); }

/* 快速开始卡片 */
.va-section-title { text-align: center; color: var(--va-primary); margin: 50px 0 30px 0; font-size: 2rem; border: none !important; }
.va-quick-grid {
display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px; margin-top: 30px;
}
.va-quick-card {
text-decoration: none !important; border: 1px solid var(--va-border);
padding: 25px; border-radius: 10px; text-align: center; transition: 0.3s; background: white;
}
.va-quick-card:hover { border-color: var(--va-primary); transform: scale(1.03); box-shadow: 0 10px 20px rgba(0,102,204,0.1); }
.va-quick-card h4 { color: var(--va-primary); margin: 12px 0 6px 0 !important; border: none !important; font-size: 1.05rem !important; }
.va-quick-card p { color: var(--va-text-sub); font-size: 0.85rem; margin: 0; }

/* 核心特性标签 */
.va-features-wrapper {
background: var(--va-bg-light); border-radius: 12px;
padding: 35px 25px; margin: 50px 0 20px 0; text-align: center;
}
.va-feature-tags {
display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px;
}
.va-feature-tag {
display: inline-flex; align-items: center; gap: 6px;
background: white; border: 1px solid var(--va-border); border-radius: 20px;
padding: 8px 18px; font-size: 0.9rem; color: var(--va-text-main);
transition: all 0.3s ease;
}
.va-feature-tag:hover { border-color: var(--va-primary); box-shadow: 0 4px 8px rgba(0,102,204,0.1); }

@media (max-width: 768px) {
.va-hero h1 { font-size: 2rem !important; }
.va-quick-grid { grid-template-columns: 1fr 1fr; }
}
</style>

<div id="vllm-ascend-portal">

<!-- 英雄区:仅 GitHub 按钮 -->
<div class="va-hero">
<h1>vllm-ascend</h1>
<p class="va-hero-subtitle">
面向昇腾 NPU 的 vLLM 社区插件 · 高性能 LLM 推理加速
</p>
<div class="va-hero-buttons">
<a href="https://github.com/vllm-project/vllm-ascend" class="va-btn va-btn-primary" target="_blank">📖 GitHub 仓库</a>
</div>
</div>

<!-- 快速开始:第一视觉,4 张卡片 -->
<h2 class="va-section-title">🚀 快速开始</h2>
<div class="va-quick-grid">
<a href="../_generated/sources/vllm-ascend/installation.html" class="va-quick-card">
<div style="font-size: 2rem;">📦</div>
<h4>安装指南</h4>
<p>环境准备与安装步骤</p>
</a>
<a href="../_generated/sources/vllm-ascend/quick_start.html" class="va-quick-card">
<div style="font-size: 2rem;">🚀</div>
<h4>快速上手</h4>
<p>5 分钟跑通推理任务</p>
</a>
<a href="../_generated/sources/vllm-ascend/user_guide/feature_guide/index.html" class="va-quick-card">
<div style="font-size: 2rem;">📖</div>
<h4>用户指南</h4>
<p>特性配置与部署方案</p>
</a>
<a href="../_generated/sources/vllm-ascend/developer_guide/contribution/index.html" class="va-quick-card">
<div style="font-size: 2rem;">👨‍💻</div>
<h4>开发者指南</h4>
<p>贡献代码与特性开发</p>
</a>
</div>

<!-- 核心特性:标签式一行展示 -->
<div class="va-features-wrapper">
<h2 style="text-align:center; color:var(--va-primary); margin: 0 0 5px 0; border:none !important;">✨ 核心特性</h2>
<div class="va-feature-tags">
<span class="va-feature-tag">🔌 硬件插件化架构</span>
<span class="va-feature-tag">⚡ 高性能推理加速</span>
<span class="va-feature-tag">🧩 丰富模型支持</span>
<span class="va-feature-tag">🌐 分布式推理</span>
<span class="va-feature-tag">🔧 完整工具链</span>
<span class="va-feature-tag">🤝 社区共建</span>
</div>
</div>

</div>

----

.. 以下 toctree 直接引用 upstream submodule 的子目录 index 文件(如 tutorials/models/index),
.. 无需额外的 nav RST 包装文件。路径从 sources/vllm-ascend/ 出发,
.. 通过 ../_generated/sources/vllm-ascend/ 指向 make copy-docs 生成的内容。
.. Makefile 仅删除 upstream 根目录 index(避免与本文件冲突),子目录 index 完整保留。

.. toctree::
:maxdepth: 2
:hidden:
:caption: Getting Started

../_generated/sources/vllm-ascend/quick_start
../_generated/sources/vllm-ascend/installation
../_generated/sources/vllm-ascend/tutorials/models/index
../_generated/sources/vllm-ascend/tutorials/features/index
../_generated/sources/vllm-ascend/tutorials/hardwares/index
../_generated/sources/vllm-ascend/faqs

.. toctree::
:maxdepth: 2
:hidden:
:caption: User Guide

../_generated/sources/vllm-ascend/user_guide/support_matrix/index
../_generated/sources/vllm-ascend/user_guide/configuration/index
../_generated/sources/vllm-ascend/user_guide/feature_guide/index
../_generated/sources/vllm-ascend/user_guide/deployment_guide/index
../_generated/sources/vllm-ascend/user_guide/release_notes

.. toctree::
:maxdepth: 2
:hidden:
:caption: Developer Guide

../_generated/sources/vllm-ascend/developer_guide/contribution/index
../_generated/sources/vllm-ascend/developer_guide/feature_guide/index
../_generated/sources/vllm-ascend/developer_guide/evaluation/index
../_generated/sources/vllm-ascend/developer_guide/performance_and_debug/index

.. toctree::
:maxdepth: 1
:hidden:
:caption: Community

../_generated/sources/vllm-ascend/community/governance
../_generated/sources/vllm-ascend/community/contributors
../_generated/sources/vllm-ascend/community/versioning_policy
../_generated/sources/vllm-ascend/community/user_stories/index
Loading