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
3 changes: 0 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- uses: actions/setup-python@v5
with:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ _build/*
.vscode
.DS_Store
sources/pytorch/api_doc.rst
sources/_generated_static/ascend_config.json
sources/_generated/
.tasks/
venv/
_repos/
_static/ascend_config.json
28 changes: 0 additions & 28 deletions .gitmodules

This file was deleted.

94 changes: 2 additions & 92 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,116 +8,26 @@ SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Configure all subprojects to process
# Format: "source_directory:target_directory"
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/vllm-ascend/docs/source:sources/vllm-ascend \
_repos/triton-ascend/docs/zh:sources/triton-ascend \
_repos/deepspeed/docs/_tutorials/accelerator-setup-guide.md:sources/deepspeed/quick_start.md \

# Configure all subprojects generated path
GENERATED_DOCS := sources/_generated

# Ascend config file path
ASCEND_CONFIG := _static/ascend_config.json

# Fetch script
FETCH_SCRIPT := scripts/fetch_ascend_data.py

# Official ONNX Runtime CANN EP quick start source
ONNXRUNTIME_CANN_MD_URL := https://raw.githubusercontent.com/microsoft/onnxruntime/gh-pages/docs/execution-providers/community-maintained/CANN-ExecutionProvider.md
ONNXRUNTIME_CANN_MD_LOCAL := sources/_generated/sources/onnxruntime/quick_start.md

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile copy-docs clean-submodules fetch-config sync-onnxruntime-doc init-submodules
.PHONY: help Makefile fetch-config

# Fetch ascend config (always run to ensure freshness)
.PHONY: $(ASCEND_CONFIG)
fetch-config:
@echo "Fetching ascend configuration data..."
@python3 $(FETCH_SCRIPT)

# Sync latest ONNX Runtime CANN EP doc from official gh-pages branch
sync-onnxruntime-doc:
@echo "Syncing ONNX Runtime CANN quick start from upstream..."
@mkdir -p $(dir $(ONNXRUNTIME_CANN_MD_LOCAL))
@curl -fsSL "$(ONNXRUNTIME_CANN_MD_URL)" -o "$(ONNXRUNTIME_CANN_MD_LOCAL).tmp"
@awk 'BEGIN{in_fm=0} \
{sub(/\r$$/, "", $$0)} \
NR==1 && $$0=="---" {in_fm=1; next} \
in_fm && $$0=="---" {in_fm=0; next} \
in_fm {next} \
$$0 ~ /^##[[:space:]]+Contents[[:space:]]*$$/ {next} \
$$0 ~ /^\{:[[:space:]]*\.no_toc[[:space:]]*\}$$/ {next} \
$$0 ~ /^\{:[[:space:]]*toc[[:space:]]*\}$$/ {next} \
$$0 ~ /^\*[[:space:]]*TOC[[:space:]]+placeholder[[:space:]]*$$/ {next} \
{print}' "$(ONNXRUNTIME_CANN_MD_LOCAL).tmp" > "$(ONNXRUNTIME_CANN_MD_LOCAL)"
@rm -f "$(ONNXRUNTIME_CANN_MD_LOCAL).tmp"
@echo "Synced to $(ONNXRUNTIME_CANN_MD_LOCAL)"

# Initialize submodules (always run to handle empty dirs left by git clone)
init-submodules:
@git submodule sync --recursive
@n=0; \
while [ $$n -lt 3 ]; do \
git submodule update --init --depth=1 --remote && exit 0; \
n=$$((n+1)); \
echo "git submodule update failed (attempt $$n/3), retrying in 8s..."; \
sleep 8; \
done; \
echo "git submodule update failed after 3 attempts"; \
exit 1

# Copy documentation from submodules
copy-docs: init-submodules
@echo "Preparing generated docs directory..."
@mkdir -p $(GENERATED_DOCS)

# vllm-ascend / triton-ascend: 仅删除根 index(避免与 sources/<comm>/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); \
rel_dst=$$(echo $$config | cut -d: -f2); \
dst="$(GENERATED_DOCS)/$$rel_dst"; \
echo "Copying $$src -> $$dst"; \
rm -rf "$$dst"; \
if [ -f "$$src" ]; then \
mkdir -p "$$(dirname "$$dst")"; \
echo "Copying $$src to $$dst"; \
cp "$$src" "$$dst" || echo " [WARN] Source file missing or copy failed: $$src"; \
elif [ -d "$$src" ]; then \
mkdir -p "$$dst"; \
echo "Copying $$src to $$dst"; \
cp -r "$$src"/* "$$dst"/ 2>/dev/null || echo " [WARN] Source directory does not exist or is empty: $$src"; \
else \
echo " [WARN] Source does not exist: $$src"; \
fi; \
if [ "$$rel_dst" = "sources/vllm-ascend" ] || [ "$$rel_dst" = "sources/triton-ascend" ]; then \
rm -f "$$dst/index.md" "$$dst/index.rst" "$$dst/index.html" 2>/dev/null || true; \
else \
if [ -d "$$dst" ]; then \
find "$$dst" -name 'index.*' -delete 2>/dev/null || true; \
fi; \
fi; \
done


# Clean up submodules
clean-submodules:
@echo "Cleaning up submodules..."
@git submodule deinit -f _repos/*

# Explicit build targets with prerequisites
html dirhtml singlehtml latex pdf: fetch-config copy-docs sync-onnxruntime-doc
html dirhtml singlehtml latex pdf: fetch-config
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target for other Sphinx targets (clean, help, etc.)
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ This repository is a collection of documentation for Ascend supported open sourc
- `tutorial.rst`: more complex than quickstart, help people learn about **products** and solve **real world problems** by guiding them through **the entire workflow to complete a task**. See also in [Github tutorial guide](https://docs.github.com/en/contributing/style-guide-and-content-model/tutorial-content-type).
- `faq.rst`: A frequently asked questions (FAQ) list.

## Documentation Available in Open Source Projects
## Documentation from Official Project Sites

- `index.rst`: the index of the opensource project doc.
- Additional source files will be automatically downloaded before running `make`. For details, see the `./Makefile`.
Some communities already maintain Ascend/NPU documentation on their own sites. Those projects are linked from the homepage cards in `index.rst` (with `target="_blank"`) instead of being built locally. Examples: verl, LLaMA-Factory, ms-swift, VeOmni, vllm-ascend, Triton-Ascend, DeepSpeed, and ONNX Runtime quick start.

Use the following command to add a subproject:
To add such a project, create a lightweight `sources/<project>/index.rst` with links to the official docs, and add it to the hidden toctree in `index.rst` so it appears in the sidebar.

```bash
git submodule add https://github.com/project.git docs/_repos/dir/
## Local Build Prerequisites

```
Before `make html`, the build fetches `ascend_config.json` via `scripts/fetch_ascend_data.py` (see `fetch-config` in `./Makefile`). No git submodules or document copying is involved.

# Contributing

Expand Down
1 change: 0 additions & 1 deletion _repos/LLaMA-Factory
Submodule LLaMA-Factory deleted from 4d8b23
1 change: 0 additions & 1 deletion _repos/VeOmni
Submodule VeOmni deleted from 06f4d8
1 change: 0 additions & 1 deletion _repos/deepspeed
Submodule deepspeed deleted from dc0fd2
1 change: 0 additions & 1 deletion _repos/ms-swift
Submodule ms-swift deleted from b59a10
1 change: 0 additions & 1 deletion _repos/triton-ascend
Submodule triton-ascend deleted from 205a6c
1 change: 0 additions & 1 deletion _repos/verl
Submodule verl deleted from 7402ca
1 change: 0 additions & 1 deletion _repos/vllm-ascend
Submodule vllm-ascend deleted from 55c680
72 changes: 0 additions & 72 deletions _static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -318,78 +318,6 @@
margin-bottom: 5%;
}

body.onnxruntime-quickstart-page .rst-content {
color: #27384a;
font-size: 16px;
line-height: 1.75;
}

body.onnxruntime-quickstart-page .rst-content h1,
body.onnxruntime-quickstart-page .rst-content h2,
body.onnxruntime-quickstart-page .rst-content h3 {
color: #1f4b8f;
}

body.onnxruntime-quickstart-page .rst-content h1 {
border-bottom: 1px solid #d8e3f2;
padding-bottom: 8px;
}

body.onnxruntime-quickstart-page .rst-content a {
color: #1f63d8;
}

body.onnxruntime-quickstart-page .rst-content table.docutils {
border: 1px solid #d8e3f2;
}

body.onnxruntime-quickstart-page .rst-content table.docutils th {
background: #f2f7ff;
}

body.onnxruntime-quickstart-page .rst-content table.docutils tr:nth-child(even) td {
background: #f9fbff;
}

body.onnxruntime-quickstart-page .rst-content .highlight {
background: #f7faff;
border: 1px solid #d8e3f2;
border-radius: 6px;
}

.box .flex-grow {
flex-grow: 1; /* 让文本内容占据剩余空间 */
}


/* =========================================================
独立社区侧边栏专属样式
========================================================= */

#independent-sidebar .custom-sidebar-caption {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
font-size: 85%;
color: #0066cc;
font-weight: 700;
text-transform: uppercase;
margin-top: 1.5em;
margin-bottom: 0.5em;
padding-left: 15px;
letter-spacing: 0.5px;
}

#independent-sidebar ul {
margin-bottom: 0 !important;
}

/* 覆盖菜单基础项的 padding,使其靠左贴齐 */
#independent-sidebar ul li.toctree-l1 > a {
padding-left: 15px !important;
}

#independent-sidebar ul li.toctree-l1.current > a {
background: #e6f0fa; /* 当前选中项高亮背景色 */
color: #0066cc;
border-left: 4px solid #0066cc;
padding-left: 11px !important; /* 减去边框宽度保持对齐 */
}
49 changes: 0 additions & 49 deletions _static/llamafactory_actions.js

This file was deleted.

14 changes: 0 additions & 14 deletions _static/onnxruntime_quickstart.js

This file was deleted.

Loading
Loading