Skip to content

Commit ee3fc03

Browse files
committed
更新英文文档
1 parent 61bf959 commit ee3fc03

File tree

27 files changed

+654
-668
lines changed

27 files changed

+654
-668
lines changed

README.md

Lines changed: 8 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -23,79 +23,26 @@ Torchpipe is a multi-instance pipeline parallel library that acts as a bridge be
2323

2424

2525

26-
torchpipe代码正在开源准备中。这里是其(中文)文档站点
26+
torchpipe代码正在开源准备中。这里是其文档站点
2727

28-
The torchpipe code is being prepared for open sourcing. Here is its (Chinese) documentation site.
28+
The torchpipe code is being prepared for open sourcing. Here is its documentation site.
2929

3030

31-
## updates
32-
- Some parts of the documentation have been translated into English:
33-
https://torchpipe.github.io/en/
3431

3532

3633

37-
## 修改方法
3834

39-
- **文档部分建议优先修改中文版本,路径为:[./i18n/zh/docusaurus-plugin-content-docs/current](./i18n/zh/docusaurus-plugin-content-docs/current)**
40-
- 您也可以删除中文版的文件,修改英语版本,这样中文版就默认为英语版本的内容;后期再翻译英语版本亦可。
41-
- 待中文版成熟后,翻译为英语版本
35+
## edit
4236

37+
- **Chinese version located at:[./i18n/zh/docusaurus-plugin-content-docs/current](./i18n/zh/docusaurus-plugin-content-docs/current)**
4338

44-
## 文档编译
4539

46-
### 启动容器
47-
```bash
48-
# remove image if needed
49-
docker stop docu2 && docker rm docu2
50-
export your_ip=<your_ip>
51-
# 修改对外ip和端口(your_ip:port:3000 ):
52-
docker run -p $your_ip:3000:3000 --privileged=true -v `pwd`:/workspace --name="docu2" --cap-add=SYS_PTRACE -itd node
53-
docker exec -it -w/workspace/ docu2 bash
54-
```
40+
## compile
41+
See [./docs/compile.md](./docs/compile.md)
5542

56-
### 安装依赖
57-
58-
```bash
59-
yarn add @docusaurus/theme-mermaid
60-
yarn add @easyops-cn/docusaurus-search-local
61-
yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest
62-
```
63-
64-
### 编译并运行
65-
66-
本地预览时,需要将`docusaurus.config.js`中的`url`修改为您的IP
67-
```bash
68-
git config --global --add safe.directory /workspace
69-
70-
yarn run build # < repeat this command if u need update the document
71-
72-
npm run serve &
73-
```
74-
75-
76-
77-
78-
79-
### 更新翻译(optinal)
80-
81-
菜单等系统部分的翻译,需要:
82-
- 将主体用英语书写
83-
- 再执行:
84-
```bash
85-
yarn run write-translations --locale zh
86-
```
87-
- 在生成的文件中将对应的英文修改为中文
88-
89-
正文(markdown)部分的翻译:
90-
- 只翻译较为成熟部分的文档
91-
92-
93-
94-
95-
### 图标
96-
97-
本项目使用了来自于[IconPark](https://iconpark.oceanengine.com/official)的免费图标(soap-bubble),其遵循[Apache License 2.0](https://github.com/bytedance/IconPark/blob/master/LICENSE), 并经过ChatGPT4对其矢量图进行调优。
43+
### Icons
9844

45+
This project utilizes free icons (soap-bubble) from [IconPark](https://iconpark.oceanengine.com/official). These icons are licensed under the [Apache License 2.0](https://github.com/bytedance/IconPark/blob/master/LICENSE) and have been optimized for vector graphics by ChatGPT4.
9946

10047

10148

compile.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
## compile
3+
4+
### 启动容器
5+
```bash
6+
# remove image if needed
7+
docker stop docu2 && docker rm docu2
8+
export your_ip=<your_ip>
9+
# 修改对外ip和端口(your_ip:port:3000 ):
10+
docker run -p $your_ip:3000:3000 --privileged=true -v `pwd`:/workspace --name="docu2" --cap-add=SYS_PTRACE -itd node
11+
docker exec -it -w/workspace/ docu2 bash
12+
```
13+
14+
### 安装依赖
15+
16+
```bash
17+
yarn add @docusaurus/theme-mermaid
18+
yarn add @easyops-cn/docusaurus-search-local
19+
yarn upgrade @docusaurus/core@latest @docusaurus/preset-classic@latest
20+
```
21+
22+
### 编译并运行
23+
24+
```bash
25+
git config --global --add safe.directory /workspace
26+
27+
yarn run build # < repeat this command if u need update the document
28+
29+
npm run serve &
30+
```
31+
接下来,您就可以通过<your_ip>:3000预览文档内容了。
32+
33+
34+
35+
36+
### 更新翻译(optinal)
37+
38+
菜单等系统部分的翻译,需要:
39+
- 将主体用英语书写
40+
- 再执行:
41+
```bash
42+
yarn run write-translations --locale zh
43+
```
44+
- 在生成的文件中将对应的英文修改为中文

docs/backend-reference/basic.mdx

Lines changed: 34 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,71 @@
11
---
22
id: basic
3-
title: 基础性后端
3+
title: Basic backends
44
type: reference
55
displayed_sidebar: api
66
---
77

8-
# 基础性后端
98

109

1110

12-
## 速览
11+
Overview
1312

13+
| Name | Initialization: Key/Type/Default | Forward Input: Key/Type | Forward Output: Key/Type | Function | Note |
14+
|-------------------------------------------------|----------------------------------|-------------------------|--------------------------|-------------------------------|-----------------|
15+
| [`Identity`](#identity) | None | `data/any` | `result/any` | `dict["result"]=dict["data"]` | Default backend |
16+
| [`Sequential`](#sequential) | `Sequential::backend` | `data/any` | | | |
17+
| [`Jump`](../Inter-node/graphtraversal.mdx#jump) | `jump` | | | Jump to other (root) node | |
1418

15-
|名称|初始化:键值/类型/默认值|前向输入:键值/类型|前向输出:键值/类型|功能|备注|
16-
|---|---|---|---|---|---|
17-
| [`Identity`](#identity) ||`data/any`|`result/any`|`dict["result"]=dict["data"]` |默认后端|
18-
| [`Sequential`](#sequential) |`Sequential::backend`|`data/any`|| ||
19-
| [`Jump`](../Inter-node/graphtraversal.mdx#jump) |`jump`||| 跳转到其他(根)节点 ||
2019

2120

22-
23-
24-
## 后端展开规则 {#backend-spread}
25-
对于后端配置,部分后端有进行展开的能力,比如,对于`backend=A[B]`, 可展开为
26-
```ini
27-
backend=A
28-
"A::backend"=B
21+
## Backend Expansion Rule {#backend-spread}
22+
For backend configuration, some backends have the ability to expand, for example, for `backend="A[B]"`, it can be expanded to
23+
```toml
24+
backend="A"
25+
"A::backend"="B"
2926
```
3027

3128
## Identity
32-
什么都不做,只是将输入赋值给输出。
33-
29+
Does nothing but assigns the input to the output.
3430

3531
## Sequential {#sequential}
36-
> 具体示例参见[Sequential](../Intra-node/Sequential.mdx)
32+
> For specific examples, please refer to [Sequential](../Intra-node/Sequential.mdx).
3733
38-
### 初始化
39-
`Sequential::backend`可以指定以逗号分开的多个子后端,如`Sequential::backend=A,B,C[D],E`.
40-
`Sequential`对子后端以[展开规则](#backend-spread)进行展开后得到:
41-
```ini
42-
backend=E
34+
### Initialization
35+
`Sequential::backend` can specify multiple sub-backends separated by commas, such as `Sequential::backend=A,B,C[D],E`.
36+
`Sequential` expands sub-backends according to the [backend expansion rules](#backend-spread) to obtain:
37+
```toml
38+
backend="E"
4339
```
4440

45-
```ini
46-
backend=C
47-
C::backend=D
41+
```toml
42+
backend="C"
43+
C::backend="D"
4844
```
4945

50-
```ini
51-
backend=B
46+
```toml
47+
backend="B"
5248
```
5349

54-
```ini
55-
backend=A
50+
```toml
51+
backend="A"
5652
```
57-
子后端的初始化将按照逆序进行。
53+
Sub-backend initialization will be performed in reverse order.
5854
:::info
59-
`Sequential`可复合使用,如:<br />
55+
`Sequential` can be composed, for example:<br />
6056
`S[S[DecodeTensor,ResizeTensor],(or)S[DecodeMat,ResizeMat,Mat2Tensor,SyncTensor],SyncTensor]`.
6157
:::
62-
:::tip 重复后端的参数
63-
Sequential的子后端可能有重复的情况,此时如果需要对子后端指定不同的参数,可以使用`|`符号:
58+
:::tip Repeating Backend Parameters
59+
Sub-backends of `Sequential` may have duplicates. If you need to specify different parameters for sub-backends, you can use the `|` symbol:
6460
```toml
6561
backend="Sequential[a,b,Jump,c,Jump]"
6662
jump="||node_name_1||node_name_2"
6763
# 或者,任意的占位符都是可以的:
6864
# jump="a|b|node_name_1|c|node_name_2"
6965
```
7066
:::
67+
### Forward
68+
When forwarding, sub-backends are executed in series. If the result of a non-final sub-backend is empty, the execution is terminated and an exception is thrown. If the result of a non-final sub-backend is non-empty, the filter will be executed. The default is `swap`.
7169

72-
### 前向
73-
前向时将串行执行子后端;如果非最后的子后端的结果为空,则中止执行,抛出异常;如果非最后的子后端的结果非空,将执行filter. 默认为`swap`.
74-
75-
### 输入范围
76-
如果子后端输入数据范围都是[1,1], 那么`Sequential`的范围是[1,1], 否则,是输入范围非[1,1]的子后端的输入范围的并集. **目前只允许最多有一个子后端满足`max() != 1 && max() != UINT32_MAX`**. 在Sequential中,目前只允许*最多*放一个输入范围非平凡的子后端,这个子后端可以认为是整个Sequential的主要的功能实现者,其他后端是辅助或者功能性后端。
77-
78-
79-
80-
81-
<!-- | [`Parallel`](#parallel) |`Parallel::backend`|`data/any`|| **将max()提升为UINT32_MAX.**<br />用于并行化执行其他后端(需要后端前向接口线程安全,且线程无关)。可用于并行化[全部opencv相关后端](./opencv.mdx);|对于tensor相关后端或者线程不安全的后端,可使用[Jump](../Inter-node/graphtraversal.mdx#jump)进行节点跳转。|
82-
## Parallel
83-
将后端的输入范围从[1, max]提高到[1,UINT32_MAX], 并行执行后端。
84-
85-
86-
87-
### 初始化
88-
:::tip 参数
89-
- **Parallel::backend** - 后端名,默认为Identity,min()必须是1. 只初始化了一次该后端。
90-
:::
91-
92-
:::caution
93-
被提升输入范围的后端的前向接口必须是线程安全的,并且状态不依赖于线程本身。[torch相关后端](./torch.mdx)不被支持
94-
::: -->
70+
### Input Range
71+
If the input data range of all sub-backends is [1,1], then the range of `Sequential` is [1,1]. Otherwise, it is the union of the input ranges of sub-backends whose input ranges are not [1,1]. **Currently, only one sub-backend is allowed to satisfy `max() != 1 && max() != UINT32_MAX` at most**. In `Sequential`, currently only one sub-backend with non-trivial input range is allowed at most, and this sub-backend can be regarded as the main functional implementer of the entire `Sequential`, while other backends are auxiliary or functional backends.

docs/backend-reference/log.mdx

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,48 @@
11
---
22
id: log
3-
title: 日志
3+
title: Log
44
type: reference
55
displayed_sidebar: api
66

77
---
8-
98
:::caution
10-
本节文档验证中。
9+
This section of the document is under verification.
1110

12-
- 日志在进程中只初始化一次
13-
- 日志配置参数直接写在全局参数中
11+
- The log is only initialized once in the process.
12+
- Log configuration parameters are directly written in global parameters.
1413
:::
14+
## Overview
1515

16-
## 速览
17-
18-
19-
|名称|主要初始化参数|备注|
20-
|---|---|---|---|---|
21-
| [Logger](#logger) |`Logger::path`,`Logger::maxBytes`<br />`Logger::backupCount`,`Logger::flush_every`<br />`Logger::pattern` | 默认存在于解释器的环境初始化中(Interpreter::env),会在解释器初始化时初始化一次.|
16+
| Name | Main Initialization Parameters | Remarks |
17+
|-------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
18+
| [Logger](#logger) | `Logger::path`, `Logger::maxBytes`, `Logger::backupCount`, `Logger::flush_every`, `Logger::pattern` | By default, it exists in the interpreter's environment initialization (Interpreter::env) and is initialized once during interpreter initialization. |
2219

2320

2421

2522
## Logger
26-
实现日志输出功能(包括:控制台输出、文件输出)。
27-
此后端默认采用控制台输出,如果配置了`Logger::path`参数,将同时输出到path对应的日志文件。
28-
29-
### 初始化
30-
:::tip 参数
31-
- **Logger::path** - 指定日志文件路径,如果不指定路径,默认控制台输出日志,指定后,日志将同时在日志文件以及控制台输出。
32-
- **Logger::maxBytes** - 指定每个日志文件存储的最大空间, 单位是 Byte,仅当指定日志文件路径后生效,取值范围: 1 - 1073741824 (1G)。
33-
- **Logger::backupCount** - 指定日志文件的最大存储数量,配合Logger::maxBytes参数使用,取值范围:0 - 1024。当取值为0的时候,代表只在指定文件中循环存储,无备份。取值为1的时候,存储文件为:log.txt,log.1.txt,存在一个备份。
34-
- **Logger::pattern** 设置 [logger的打印模式](https://internal.dunescience.org/doxygen/classspdlog_1_1pattern__formatter.html)
35-
* debug模式下默认值为 `[%l][%m/%d %H:%M:%S][%s:%#%!]: %v`.
36-
* release 下默认值为 `[%l][%m/%d %H:%M:%S][%s:%#]: %v`
37-
- **Logger::flush_every** - 刷新日志到文件的频率,默认为5,单位秒;设置为0代表会刷新每条日志。
23+
Implements logging functionality (including console output and file output).
24+
By default, this backend uses console output. If the `Logger::path` parameter is configured, it will also output to the log file corresponding to `path`.
25+
26+
### Initialization
27+
28+
:::tip Parameters
29+
- **Logger::path** - Specifies the log file path. If no path is specified, the log will be output to the console by default. If a path is specified, the log will be output to both the log file and the console.
30+
- **Logger::maxBytes** - Specifies the maximum storage space for each log file, in bytes. This parameter only takes effect when a log file path is specified. Valid values are 1-1073741824 (1G).
31+
- **Logger::backupCount** - Specifies the maximum number of log files to store, used in conjunction with the `Logger::maxBytes` parameter. Valid values are 0-1024. When the value is 0, it means that only the specified file is stored in a circular manner without backup. When the value is 1, the stored files are: log.txt, log.1.txt, with one backup.
32+
- **Logger::pattern** - Sets the [print mode of the logger](https://internal.dunescience.org/doxygen/classspdlog_1_1pattern__formatter.html).
33+
* The default value in debug mode is `[%l][%m/%d %H:%M:%S][%s:%#%!]: %v`.
34+
* The default value in release mode is `[%l][%m/%d %H:%M:%S][%s:%#]: %v`.
35+
- **Logger::flush_every** - Specifies the frequency at which the log is flushed to the file, in seconds. The default value is 5. Setting it to 0 means that every log will be flushed.
3836
:::
3937

4038

41-
<details><summary>示例</summary>
42-
39+
<details><summary>Example</summary>
4340
```toml
4441
"Logger::path" = "./torchpipe.log"
45-
# 可选参数,保存日志文件路径,如果不设置,默认控制台输出日志
42+
# Optional parameter, specifies the log file path. If not set, the log will be output to the console by default.
4643
"Logger::maxBytes" = 1048576 #
47-
# 可选参数,设置后启用循环保存功能,设置单个日志文件存储最大空间,默认值:无穷大。取值范围: 1 - 1073741824 (1G)
44+
# Optional parameter, enables circular storage when set, specifies the maximum storage space for a single log file. Default value: infinity. Valid values are 1-1073741824 (1G).
4845
"Logger::backupCount" = 20
49-
# 可选参数,配合Logger::maxBytes参数,日志文件的最大保存数量,取值范围: 0 - 1024
46+
# Optional parameter, used in conjunction with the `Logger::maxBytes` parameter, specifies the maximum number of log files to store. Valid values are 0-1024.
5047
```
5148
</details>

0 commit comments

Comments
 (0)