Skip to content

Commit 3a90059

Browse files
committed
feat: add new docs home and searchbar
1 parent 53abeb6 commit 3a90059

17 files changed

Lines changed: 650 additions & 85 deletions

File tree

docs_roll/docs/English/UserGuide/trackers_and_metrics.md

100644100755
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ The ROLL framework automatically records the following types of metrics:
155155
- time/adv: Duration of the advantages calculation phase.
156156
157157
### Execution Phases
158-
In the following time and memory metrics, {metric_infix} will be replaced with specific execution phase identifiers, such as:
158+
In the following time and memory metrics, `{metric_infix}` will be replaced with specific execution phase identifiers, such as:
159159
- train_step: Training phase
160160
- generate: Text generation/inference phase
161161
- model_update: Model parameter update/synchronization phase
@@ -165,37 +165,37 @@ In the following time and memory metrics, {metric_infix} will be replaced with s
165165
- compute_rewards: Reward computation phase
166166

167167
#### Time Metrics
168-
- time/{metric_infix}/total: Total execution time for the entire operation (from entering state_offload_manager to exiting).
169-
- time/{metric_infix}/execute: Execution time for actual business logic (i.e., the yield part, such as model training, generation, etc.).
170-
- time/{metric_infix}/onload: Time to load model state (strategy.load_states()) to GPU or memory.
171-
- time/{metric_infix}/offload: Time to offload model state (strategy.offload_states()) from GPU or memory.
168+
- time/`{metric_infix}`/total: Total execution time for the entire operation (from entering state_offload_manager to exiting).
169+
- time/`{metric_infix}`/execute: Execution time for actual business logic (i.e., the yield part, such as model training, generation, etc.).
170+
- time/`{metric_infix}`/onload: Time to load model state (strategy.load_states()) to GPU or memory.
171+
- time/`{metric_infix}`/offload: Time to offload model state (strategy.offload_states()) from GPU or memory.
172172

173173
#### GPU Memory Metrics
174174
- Memory snapshot at the beginning (after model state offloading)
175-
- memory/{metric_infix}/**start/offload**/allocated/{device_id}: Currently allocated GPU memory on a specific device_id.
176-
- memory/{metric_infix}/**start/offload**/reserved/{device_id}: Currently reserved GPU memory on a specific device_id.
177-
- memory/{metric_infix}/**start/offload**/max_allocated/{device_id}: Peak allocated GPU memory from the start of this operation to the current moment on a specific device_id.
178-
- memory/{metric_infix}/**start/offload**/max_reserved/{device_id}: Peak reserved GPU memory from the start of this operation to the current moment on a specific device_id.
175+
- memory/`{metric_infix}`/**start/offload**/allocated/`{device_id}`: Currently allocated GPU memory on a specific device_id.
176+
- memory/`{metric_infix}`/**start/offload**/reserved/`{device_id}`: Currently reserved GPU memory on a specific device_id.
177+
- memory/`{metric_infix}`/**start/offload**/max_allocated/`{device_id}`: Peak allocated GPU memory from the start of this operation to the current moment on a specific device_id.
178+
- memory/`{metric_infix}`/**start/offload**/max_reserved/`{device_id}`: Peak reserved GPU memory from the start of this operation to the current moment on a specific device_id.
179179
- Memory snapshot after loading model state (before executing business logic)
180-
- memory/{metric_infix}/**start/onload**/allocated/{device_id}: Currently allocated GPU memory on a specific device_id.
181-
- memory/{metric_infix}/**start/onload**/reserved/{device_id}: Currently reserved GPU memory on a specific device_id.
182-
- memory/{metric_infix}/**start/onload**/max_allocated/{device_id}: Peak allocated GPU memory from the start of this operation to the current moment on a specific device_id.
183-
- memory/{metric_infix}/**start/onload**/max_reserved/{device_id}: Peak reserved GPU memory from the start of this operation to the current moment on a specific device_id.
180+
- memory/`{metric_infix}`/**start/onload**/allocated/`{device_id}`: Currently allocated GPU memory on a specific device_id.
181+
- memory/`{metric_infix}`/**start/onload**/reserved/`{device_id}`: Currently reserved GPU memory on a specific device_id.
182+
- memory/`{metric_infix}`/**start/onload**/max_allocated/`{device_id}`: Peak allocated GPU memory from the start of this operation to the current moment on a specific device_id.
183+
- memory/`{metric_infix}`/**start/onload**/max_reserved/`{device_id}`: Peak reserved GPU memory from the start of this operation to the current moment on a specific device_id.
184184
- Memory snapshot after executing business logic (before offloading model state)
185-
- memory/{metric_infix}/**end/onload**/allocated/{device_id}: Currently allocated GPU memory on a specific device_id.
186-
- memory/{metric_infix}/**end/onload**/reserved/{device_id}: Currently reserved GPU memory on a specific device_id.
187-
- memory/{metric_infix}/**end/onload**/max_allocated/{device_id}: Peak allocated GPU memory from the start of this operation to the current moment on a specific device_id.
188-
- memory/{metric_infix}/**end/onload**/max_reserved/{device_id}: Peak reserved GPU memory from the start of this operation to the current moment on a specific device_id.
189-
- memory/{metric_infix}/**end/onload**/max_allocated_frac/{device_id}: Fraction of peak allocated GPU memory relative to total GPU memory on a specific device_id.
190-
- memory/{metric_infix}/**end/onload**/max_reserved_frac/{device_id}: Fraction of peak reserved GPU memory relative to total GPU memory on a specific device_id.
185+
- memory/`{metric_infix}`/**end/onload**/allocated/`{device_id}`: Currently allocated GPU memory on a specific device_id.
186+
- memory/`{metric_infix}`/**end/onload**/reserved/`{device_id}`: Currently reserved GPU memory on a specific device_id.
187+
- memory/`{metric_infix}`/**end/onload**/max_allocated/`{device_id}`: Peak allocated GPU memory from the start of this operation to the current moment on a specific device_id.
188+
- memory/`{metric_infix}`/**end/onload**/max_reserved/`{device_id}`: Peak reserved GPU memory from the start of this operation to the current moment on a specific device_id.
189+
- memory/`{metric_infix}`/**end/onload**/max_allocated_frac/`{device_id}`: Fraction of peak allocated GPU memory relative to total GPU memory on a specific device_id.
190+
- memory/`{metric_infix}`/**end/onload**/max_reserved_frac/`{device_id}`: Fraction of peak reserved GPU memory relative to total GPU memory on a specific device_id.
191191
- Memory snapshot after offloading model state (at operation end)
192-
- memory/{metric_infix}/**end/offload**/allocated/{device_id}: Currently allocated GPU memory on a specific device_id.
193-
- memory/{metric_infix}/**end/offload**/reserved/{device_id}: Currently reserved GPU memory on a specific device_id.
194-
- memory/{metric_infix}/**end/offload**/max_allocated/{device_id}: Peak allocated GPU memory from the start of this operation to the current moment on a specific device_id.
195-
- memory/{metric_infix}/**end/offload**/max_reserved/{device_id}: Peak reserved GPU memory from the start of this operation to the current moment on a specific device_id.
192+
- memory/`{metric_infix}`/**end/offload**/allocated/`{device_id}`: Currently allocated GPU memory on a specific device_id.
193+
- memory/`{metric_infix}`/**end/offload**/reserved/`{device_id}`: Currently reserved GPU memory on a specific device_id.
194+
- memory/`{metric_infix}`/**end/offload**/max_allocated/`{device_id}`: Peak allocated GPU memory from the start of this operation to the current moment on a specific device_id.
195+
- memory/`{metric_infix}`/**end/offload**/max_reserved/`{device_id}`: Peak reserved GPU memory from the start of this operation to the current moment on a specific device_id.
196196

197197
#### CPU Memory Metrics
198-
- memory/cpu/{metric_infix}/start/rss: Actual physical memory (Resident Set Size) occupied by the process at the start of the operation.
199-
- memory/cpu/{metric_infix}/start/vms: Virtual memory (Virtual Memory Size) occupied by the process at the start of the operation.
200-
- memory/cpu/{metric_infix}/end/rss: Actual physical memory occupied by the process at the end of the operation.
201-
- memory/cpu/{metric_infix}/end/vms: Virtual memory occupied by the process at the end of the operation.
198+
- memory/cpu/`{metric_infix}`/start/rss: Actual physical memory (Resident Set Size) occupied by the process at the start of the operation.
199+
- memory/cpu/`{metric_infix}`/start/vms: Virtual memory (Virtual Memory Size) occupied by the process at the start of the operation.
200+
- memory/cpu/`{metric_infix}`/end/rss: Actual physical memory occupied by the process at the end of the operation.
201+
- memory/cpu/`{metric_infix}`/end/vms: Virtual memory occupied by the process at the end of the operation.

docs_roll/docs/简体中文/使用指南/trackers_and_metrics.md

100644100755
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ ROLL 框架会自动记录以下类型的指标:
156156
- time/adv: 优势(Advantages)计算阶段的耗时。
157157
158158
### 各执行阶段
159-
在下面的时间指标和内存指标中,{metric_infix} 会被替换为具体的执行阶段标识,例如:
159+
在下面的时间指标和内存指标中,`{metric_infix}` 会被替换为具体的执行阶段标识,例如:
160160
- train_step: 训练阶段
161161
- generate: 文本生成/推理阶段
162162
- model_update: 模型参数更新/同步阶段
@@ -166,37 +166,37 @@ ROLL 框架会自动记录以下类型的指标:
166166
- compute_rewards: 计算奖励阶段
167167

168168
#### 时间指标
169-
- time/{metric_infix}/total: 整个操作的总执行时间(从进入 state_offload_manger 到退出)。
170-
- time/{metric_infix}/execute: 实际业务逻辑(即 yield 部分,如模型训练、生成等)的执行时间。
171-
- time/{metric_infix}/onload: 模型状态加载(strategy.load_states())到 GPU 或内存中的时间。
172-
- time/{metric_infix}/offload: 模型状态从 GPU 或内存中卸载(strategy.offload_states())的时间。
169+
- time/`{metric_infix}`/total: 整个操作的总执行时间(从进入 state_offload_manger 到退出)。
170+
- time/`{metric_infix}`/execute: 实际业务逻辑(即 yield 部分,如模型训练、生成等)的执行时间。
171+
- time/`{metric_infix}`/onload: 模型状态加载(strategy.load_states())到 GPU 或内存中的时间。
172+
- time/`{metric_infix}`/offload: 模型状态从 GPU 或内存中卸载(strategy.offload_states())的时间。
173173

174174
#### GPU内存指标
175175
- 开始时(模型状态卸载后)的内存快照
176-
- memory/{metric_infix}/**start/offload**/allocated/{device_id}: 某个 device_id 上当前已分配的 GPU 内存量。
177-
- memory/{metric_infix}/**start/offload**/reserved/{device_id}: 某个 device_id 上当前已预留的 GPU 内存量。
178-
- memory/{metric_infix}/**start/offload**/max_allocated/{device_id}: 某个 device_id 上从本次操作开始到当前时刻,已分配的 GPU 内存的峰值。
179-
- memory/{metric_infix}/**start/offload**/max_reserved/{device_id}: 某个 device_id 上从本次操作开始到当前时刻,已预留的 GPU 内存的峰值。
176+
- memory/`{metric_infix}`/**start/offload**/allocated/`{device_id}`: 某个 device_id 上当前已分配的 GPU 内存量。
177+
- memory/`{metric_infix}`/**start/offload**/reserved/`{device_id}`: 某个 device_id 上当前已预留的 GPU 内存量。
178+
- memory/`{metric_infix}`/**start/offload**/max_allocated/`{device_id}`: 某个 device_id 上从本次操作开始到当前时刻,已分配的 GPU 内存的峰值。
179+
- memory/`{metric_infix}`/**start/offload**/max_reserved/`{device_id}`: 某个 device_id 上从本次操作开始到当前时刻,已预留的 GPU 内存的峰值。
180180
- 加载模型状态后(业务逻辑执行前)的内存快照
181-
- memory/{metric_infix}/**start/onload**/allocated/{device_id}: 某个 device_id 上当前已分配的 GPU 内存量。
182-
- memory/{metric_infix}/**start/onload**/reserved/{device_id}: 某个 device_id 上当前已预留的 GPU 内存量。
183-
- memory/{metric_infix}/**start/onload**/max_allocated/{device_id}: 某个 device_id 上从本次操作开始到当前时刻,已分配的 GPU 内存的峰值。
184-
- memory/{metric_infix}/**start/onload**/max_reserved/{device_id}: 某个 device_id 上从本次操作开始到当前时刻,已预留的 GPU 内存的峰值。
181+
- memory/`{metric_infix}`/**start/onload**/allocated/`{device_id}`: 某个 device_id 上当前已分配的 GPU 内存量。
182+
- memory/`{metric_infix}`/**start/onload**/reserved/`{device_id}`: 某个 device_id 上当前已预留的 GPU 内存量。
183+
- memory/`{metric_infix}`/**start/onload**/max_allocated/`{device_id}`: 某个 device_id 上从本次操作开始到当前时刻,已分配的 GPU 内存的峰值。
184+
- memory/`{metric_infix}`/**start/onload**/max_reserved/`{device_id}`: 某个 device_id 上从本次操作开始到当前时刻,已预留的 GPU 内存的峰值。
185185
- 业务逻辑执行后(模型状态卸载前)的内存快照
186-
- memory/{metric_infix}/**end/onload**/allocated/{device_id}: 某个 device_id 上当前已分配的 GPU 内存量。
187-
- memory/{metric_infix}/**end/onload**/reserved/{device_id}: 某个 device_id 上当前已预留的 GPU 内存量。
188-
- memory/{metric_infix}/**end/onload**/max_allocated/{device_id}: 某个 device_id 上从本次操作开始到当前时刻,已分配的 GPU 内存的峰值。
189-
- memory/{metric_infix}/**end/onload**/max_reserved/{device_id}: 某个 device_id 上从本次操作开始到当前时刻,已预留的 GPU 内存的峰值。
190-
- memory/{metric_infix}/**end/onload**/max_allocated_frac/{device_id}: 某个 device_id 上已分配 GPU 内存峰值占总 GPU 内存的比例 (分数)。
191-
- memory/{metric_infix}/**end/onload**/max_reserved_frac/{device_id}: 某个 device_id 上已预留 GPU 内存峰值占总 GPU 内存的比例 (分数)。
186+
- memory/`{metric_infix}`/**end/onload**/allocated/`{device_id}`: 某个 device_id 上当前已分配的 GPU 内存量。
187+
- memory/`{metric_infix}`/**end/onload**/reserved/`{device_id}`: 某个 device_id 上当前已预留的 GPU 内存量。
188+
- memory/`{metric_infix}`/**end/onload**/max_allocated/`{device_id}`: 某个 device_id 上从本次操作开始到当前时刻,已分配的 GPU 内存的峰值。
189+
- memory/`{metric_infix}`/**end/onload**/max_reserved/`{device_id}`: 某个 device_id 上从本次操作开始到当前时刻,已预留的 GPU 内存的峰值。
190+
- memory/`{metric_infix}`/**end/onload**/max_allocated_frac/`{device_id}`: 某个 device_id 上已分配 GPU 内存峰值占总 GPU 内存的比例 (分数)。
191+
- memory/`{metric_infix}`/**end/onload**/max_reserved_frac/`{device_id}`: 某个 device_id 上已预留 GPU 内存峰值占总 GPU 内存的比例 (分数)。
192192
- 卸载模型状态后(操作结束)的内存快照
193-
- memory/{metric_infix}/**end/offload**/allocated/{device_id}: 某个 device_id 上当前已分配的 GPU 内存量。
194-
- memory/{metric_infix}/**end/offload**/reserved/{device_id}: 某个 device_id 上当前已预留的 GPU 内存量。
195-
- memory/{metric_infix}/**end/offload**/max_allocated/{device_id}: 某个 device_id 上从本次操作开始到当前时刻,已分配的 GPU 内存的峰值。
196-
- memory/{metric_infix}/**end/offload**/max_reserved/{device_id}: 某个 device_id 上从本次操作开始到当前时刻,已预留的 GPU 内存的峰值。
193+
- memory/`{metric_infix}`/**end/offload**/allocated/`{device_id}`: 某个 device_id 上当前已分配的 GPU 内存量。
194+
- memory/`{metric_infix}`/**end/offload**/reserved/`{device_id}`: 某个 device_id 上当前已预留的 GPU 内存量。
195+
- memory/`{metric_infix}`/**end/offload**/max_allocated/`{device_id}`: 某个 device_id 上从本次操作开始到当前时刻,已分配的 GPU 内存的峰值。
196+
- memory/`{metric_infix}`/**end/offload**/max_reserved/`{device_id}`: 某个 device_id 上从本次操作开始到当前时刻,已预留的 GPU 内存的峰值。
197197

198198
#### CPU内存指标
199-
- memory/cpu/{metric_infix}/start/rss: 进程在操作开始时占用的实际物理内存 (Resident Set Size)。
200-
- memory/cpu/{metric_infix}/start/vms: 进程在操作开始时占用的虚拟内存 (Virtual Memory Size)。
201-
- memory/cpu/{metric_infix}/end/rss: 进程在操作结束时占用的实际物理内存。
202-
- memory/cpu/{metric_infix}/end/vms: 进程在操作结束时占用的虚拟内存。
199+
- memory/cpu/`{metric_infix}`/start/rss: 进程在操作开始时占用的实际物理内存 (Resident Set Size)。
200+
- memory/cpu/`{metric_infix}`/start/vms: 进程在操作开始时占用的虚拟内存 (Virtual Memory Size)。
201+
- memory/cpu/`{metric_infix}`/end/rss: 进程在操作结束时占用的实际物理内存。
202+
- memory/cpu/`{metric_infix}`/end/vms: 进程在操作结束时占用的虚拟内存。

docs_roll/docusaurus.config.js

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// @ts-check
22
// Note: type annotations allow type checking and IDEs autocompletion
33

4-
const lightCodeTheme = require('prism-react-renderer/themes/github');
5-
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
4+
const { themes } = require('prism-react-renderer');
5+
const lightTheme = themes.github;
6+
const darkTheme = themes.dracula;
67

78
/** @type {import('@docusaurus/types').Config} */
89
const config = {
@@ -59,6 +60,21 @@ const config = {
5960
],
6061
],
6162

63+
themes: [
64+
[
65+
// @ts-ignore
66+
require.resolve("@easyops-cn/docusaurus-search-local"),
67+
/** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
68+
// @ts-ignore
69+
({
70+
hashed: true,
71+
indexBlog: false,
72+
// For Docs usingChinese, it is recomended to set:
73+
language: ["en"],
74+
}),
75+
],
76+
],
77+
6278
themeConfig:
6379
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
6480
({
@@ -71,17 +87,24 @@ const config = {
7187
src: 'img/logo.png',
7288
},
7389
items: [
90+
{ to: '/ROLL', label: 'Home', position: 'right' },
91+
{ to: '/ROLL/#core', label: 'Core Algorithms', position: 'right' },
92+
{ to: '/ROLL/#research', label: 'Research Community', position: 'right' },
7493
{
7594
type: 'docSidebar',
7695
sidebarId: 'tutorialSidebar',
77-
position: 'left',
78-
label: '文档',
96+
position: 'right',
97+
label: 'API Docs',
7998
},
8099
{
81100
href: 'https://github.com/alibaba/ROLL',
82101
label: 'GitHub',
83102
position: 'right',
84103
},
104+
{
105+
type: 'search',
106+
position: 'right', // 确保位置在右侧
107+
},
85108
],
86109
},
87110
footer: {
@@ -122,8 +145,11 @@ const config = {
122145
copyright: `Copyright © ${new Date().getFullYear()} Alibaba.`,
123146
},
124147
prism: {
125-
theme: lightCodeTheme,
126-
darkTheme: darkCodeTheme,
148+
theme: lightTheme,
149+
darkTheme: darkTheme,
150+
},
151+
colorMode: {
152+
defaultMode: 'dark',
127153
},
128154
}),
129155
};

docs_roll/package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@
1515
},
1616
"dependencies": {
1717
"@ant-design/icons": "^6.0.0",
18-
"@docusaurus/core": "2.4.1",
19-
"@docusaurus/preset-classic": "2.4.1",
20-
"@mdx-js/react": "^1.6.22",
18+
"@docusaurus/core": "^3.0.0",
19+
"@docusaurus/preset-classic": "^3.0.0",
20+
"@easyops-cn/docusaurus-search-local": "^0.52.1",
21+
"@mdx-js/react": "^3.0.0",
2122
"antd": "^5.26.7",
2223
"axios": "^1.11.0",
2324
"clsx": "^1.2.1",
24-
"prism-react-renderer": "^1.3.5",
25-
"react": "^17.0.2",
26-
"react-dom": "^17.0.2"
25+
"prism-react-renderer": "^2.1.0",
26+
"react": "^18.2.0",
27+
"react-dom": "^18.2.0"
2728
},
2829
"devDependencies": {
29-
"@docusaurus/module-type-aliases": "2.4.1",
30+
"@docusaurus/module-type-aliases": "3.0.0",
3031
"@jridgewell/gen-mapping": "0.3.8",
3132
"@jridgewell/source-map": "0.3.6",
3233
"@jridgewell/sourcemap-codec": "1.5.0",
@@ -45,6 +46,6 @@
4546
]
4647
},
4748
"engines": {
48-
"node": ">=16.14"
49+
"node": ">=18.0"
4950
}
50-
}
51+
}

0 commit comments

Comments
 (0)