Skip to content

Commit b23ddcc

Browse files
committed
rename Continue to Run
1 parent c3fc611 commit b23ddcc

File tree

8 files changed

+46
-46
lines changed

8 files changed

+46
-46
lines changed

docs/Inter-node/filter.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ type: explainer
55
---
66

77
As introduced in [filter](../Intra-node/Sequential.mdx#filter_sequential) in Sequential, `filter` is a logical control instruction between nodes or backends, with the following states:
8-
Continue, Skip, SerialSkip, SubGraphSkip, Break, Error.
8+
Run, Skip, SerialSkip, SubGraphSkip, Break, Error.
99

1010
## Default Multi-Node Scheduler Interpretation of `filter` Return Values
1111

1212
In multi-node scheduling, the return values of `filter` represent:
13-
- `Continue`: the backend of the current node can be executed.
13+
- `Run`: the backend of the current node can be executed.
1414
- `Skip`: the backend of the current node can be skipped, but it does not mean that the node has no result. The result of the node is the `dict` processed by `filter`.
1515
- `Break`: the execution of the entire DAG is terminated, and the `dict` processed by `filter` is the final result.
1616
- `Error`: an error occurred.
@@ -62,7 +62,7 @@ class your_filter : public Filter {
6262
// highlight-next-line
6363
return status::SubGraphSkip;
6464
else
65-
return status::Continue;
65+
return status::Run;
6666
}
6767
};
6868
IPIPE_REGISTER(Filter, your_filter, "your_filter");
@@ -77,11 +77,11 @@ filter="your_filter"
7777
Please do not use the same name as built-in filters for custom filters.
7878
7979
## Built-in Filters {#default_filters}
80-
| | Function | |
81-
|----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------|---|
82-
| Continue/run <br />Skip/skip <br />SerialSkip/serial_skip/serialskip <br />SubGraphSkip/subgraph_skip/subgraphskip, <br />Break/break, <br />Error/error | Returns the corresponding status value unconditionally | |
83-
| swap | Returns `Break` if there is no result, otherwise returns `Continue` | |
84-
| or | Returns `Continue` if there is no result, otherwise returns `Skip` | |
80+
| | Function | |
81+
|-----------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|---|
82+
| Run/run <br />Skip/skip <br />SerialSkip/serial_skip/serialskip <br />SubGraphSkip/subgraph_skip/subgraphskip, <br />Break/break, <br />Error/error | Returns the corresponding status value unconditionally | |
83+
| swap | Returns `Break` if there is no result, otherwise returns `Run` | |
84+
| or | Returns `Run` if there is no result, otherwise returns `Skip` | |
8585
8686
8787

docs/Inter-node/next.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ next="resize"
3030

3131
The `decode->resize` forms a directed acyclic graph consisting of two nodes, where `decode` is the root node and `resize` is the child node.
3232

33-
Similar to `Sequential`, the root node defaults to [filter](../Intra-node/Sequential.mdx#filter_sequential) = `Continue`, and the child node defaults to filter = `swap`.
33+
Similar to `Sequential`, the root node defaults to [filter](../Intra-node/Sequential.mdx#filter_sequential) = `Run`, and the child node defaults to filter = `swap`.
3434

3535
:::info Data Flow
3636
The original input `dict` data enters the `decode` node, and its `result` key value is written into the result.
@@ -76,7 +76,7 @@ The original input `dict` data is processed by node `A`, and both nodes `B` and
7676
# highlight-next-line
7777
map="B[result:B_result],C[result:data]"
7878
```
79-
The `output` configuration uses `map` to map the `result` of node B to its own `B_result`, and the `result` of node C to `data`. When `map` is present, the default filter is `Continue/run`, which means that no further processing is done on the input data.
79+
The `output` configuration uses `map` to map the `result` of node B to its own `B_result`, and the `result` of node C to `data`. When `map` is present, the default filter is `Run/run`, which means that no further processing is done on the input data.
8080

8181
`map` can also map multiple key-value pairs from preceding nodes to itself, such as `map="B[1:0,1:1,2:data]"`.
8282

docs/Intra-node/Sequential.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ During the forward execution of `Sequential[DecodeMat,ResizeMat]`, the data (dic
1919

2020
`Sequential` can be abbreviated as `S`. API reference can be found in [`Sequential`](../backend-reference/basic#sequential).
2121
## Conditional Control Flow Filter {#filter_sequential}
22-
`Sequential` itself implements support for control flow syntax extensions. In fact, `S[DecodeMat,ResizeMat]` is equivalent to `S[(Continue)DecodeMat,(swap)ResizeMat]`.
22+
`Sequential` itself implements support for control flow syntax extensions. In fact, `S[DecodeMat,ResizeMat]` is equivalent to `S[(Run)DecodeMat,(swap)ResizeMat]`.
2323

2424
The filters in `()` parentheses can return the following states:
25-
- Continue, which means that the current sub-backend can be skipped and wait to enter the next sub-backend (renamed to Run since version 0.3.2)
25+
- Run, which means that the current sub-backend can be skipped and wait to enter the next sub-backend (Effective from v0.3.2b1; `Continue` can be used in previous versions.)
2626
- Break, which means to exit the execution of `Sequential`
2727
- Error, which means an error occurred
2828
- SerialSkip, which means that consecutive serial sub-backends can be skipped, equivalent to Break in `Sequential`
@@ -31,16 +31,16 @@ The filters in `()` parentheses can return the following states:
3131
Here are some built-in filter definitions:
3232

3333
<Tabs groupId="filter" className="unique-tabs">
34-
<TabItem value="Continue" label="Continue">
34+
<TabItem value="Run" label="Run">
3535

3636
```cpp
3737
#include "filter.hpp"
3838

39-
class FilterContinue : public Filter {
39+
class FilterRun : public Filter {
4040
public:
41-
status forward(dict data) override { return Filter::status::Continue; }
41+
status forward(dict data) override { return Filter::status::Run; }
4242
};
43-
IPIPE_REGISTER(Filter, FilterContinue, "Continue,run");
43+
IPIPE_REGISTER(Filter, FilterRun, "Run,run");
4444
```
4545
4646
@@ -50,7 +50,7 @@ IPIPE_REGISTER(Filter, FilterContinue, "Continue,run");
5050
```cpp
5151
class Filter {
5252
public:
53-
enum struct status { Continue, Skip, SerialSkip, SubGraphSkip, Break, Error };
53+
enum struct status { Run, Skip, SerialSkip, SubGraphSkip, Break, Error };
5454

5555
virtual bool init(const std::unordered_map<std::string, std::string>& /*config*/,
5656
dict /*dict_config*/) {
@@ -65,7 +65,7 @@ class Filter {
6565

6666
(*input)[TASK_DATA_KEY] = (*input)[TASK_RESULT_KEY];
6767
input->erase(iter);
68-
return status::Continue;
68+
return status::Run;
6969
}
7070

7171
virtual ~Filter() = default;
@@ -80,7 +80,7 @@ Based on this, as will be discussed in the next section on [extending and compil
8080
Suppose there is a backend `S[DecodeTensor,(swap)TensorrtTensor,TensorrtSync]`, where the input range of `DecodeTensor` is [1,1], and the range of `TensorrtTensor` is [1,4]. According to the [Sequential rule for calculating input range](../backend-reference/basic#sequential), the input range of Sequential is [1,4].
8181
8282
If four data enter this Sequential at the same time, but one of them fails to decode, then
83-
- One data returns `status::Break` in `swap`, while the others return `status::Continue`.
83+
- One data returns `status::Break` in `swap`, while the others return `status::Run`.
8484
- `Sequential` continues to send the remaining three data to the next stage, while the data in `Break` state terminates the execution in Sequential.
8585
8686
The above describes the response when encountering `Break` for some data; similarly, when encountering `Skip` for some data, the data will be locally processed in a similar way. However, when a data is in `Error` state, Sequential will consider the overall task status as `Error`. If this contradicts the user's intention, the user can try to split the sub-backends into different Sequentials to avoid mutual interference. Note that the `Error` state is generally extremely rare and unexpected.

docs/faq/onnx.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ At this point, it is recommended to **discretize only one dimension**.
4747
After modifying the network, you can use the following code to convert the PyTorch model to an ONNX model:
4848

4949
```python
50-
x = torch.randn(1,*input_shape).cuda()
50+
x = torch.randn(1,3,224,224).cuda()
5151
out_size = 1
52-
out={"input":{0:"batch_size"}}
52+
in_out={"input":{0:"batch_size"}}
5353
for i in range(out_size):
54-
out[f"output_{i}"] = {0:"batch_size"}
54+
in_out[f"output_{i}"] = {0:"batch_size"}
5555

5656
torch_model.cuda().eval()
5757
torch.onnx.export(torch_model,
@@ -61,7 +61,7 @@ torch.onnx.export(torch_model,
6161
do_constant_folding=True,
6262
input_names=["input"], # input name
6363
output_names=[f"output_{i}" for i in range(out_size)], # output names
64-
dynamic_axes=out)
64+
dynamic_axes=in_out)
6565

6666
import onnx
6767
from onnxsim import onnx_simplifier

i18n/zh/docusaurus-plugin-content-docs/current/Inter-node/filter.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ type: explainer
55
---
66

77
正如在Sequential引入[filter](../Intra-node/Sequential.mdx#filter_sequential)时介绍过的,filter是节点或者后端间的逻辑控制指令,拥有以下状态:
8-
Continue, Skip, SerialSkip, SubGraphSkip, Break, Error.
8+
Run, Skip, SerialSkip, SubGraphSkip, Break, Error.
99

1010
## 默认多节点调度器对filter返回值的解析
1111

1212
在多节点调度中,filter返回值分别代表:
13-
- Continue, 代表可以执行当前节点的后端
13+
- Run, 代表可以执行当前节点的后端
1414
- Skip, 代表跳过当前节点的后端,但是不代表这个节点没有结果。节点的结果就是被filter处理过的`dict`
1515
- Break, 代表跳出整个有向无环图的执行, 被filter处理过的`dict`就是最终结果
1616
- Error, 代表出现错误
@@ -62,7 +62,7 @@ class your_filter : public Filter {
6262
// highlight-next-line
6363
return status::SubGraphSkip;
6464
else
65-
return status::Continue;
65+
return status::Run;
6666
}
6767
};
6868
IPIPE_REGISTER(Filter, your_filter, "your_filter");
@@ -77,11 +77,11 @@ filter="your_filter"
7777
7878
注意自定义filter请勿与内置filter重名。
7979
## 内置filter {#default_filters}
80-
| | 功能 | |
81-
|----------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------|---|
82-
| Continue/run <br />Skip/skip <br />SerialSkip/serial_skip/serialskip <br />SubGraphSkip/subgraph_skip/subgraphskip, <br />Break/break, <br />Error/error | 无条件返回对应状态值 | |
83-
| swap | 没有result返回Break, 否则返回Continue | |
84-
| or | 没有result返回Continue, 否则返回Skip | |
80+
| | 功能 | |
81+
|-----------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------|---|
82+
| Run/run <br />Skip/skip <br />SerialSkip/serial_skip/serialskip <br />SubGraphSkip/subgraph_skip/subgraphskip, <br />Break/break, <br />Error/error | 无条件返回对应状态值 | |
83+
| swap | 没有result返回Break, 否则返回Run | |
84+
| or | 没有result返回Run, 否则返回Skip | |
8585
8686
8787

i18n/zh/docusaurus-plugin-content-docs/current/Inter-node/next.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ next="resize"
2727

2828
`decode->resize`组成了由两个节点构成的有向无环图,其中decode是根节点,resize是子节点。
2929

30-
与Sequential类似,根节点默认[filter](../Intra-node/Sequential.mdx#filter_sequential)=`Continue`, 子节点默认filter=`swap`.
30+
与Sequential类似,根节点默认[filter](../Intra-node/Sequential.mdx#filter_sequential)=`Run`, 子节点默认filter=`swap`.
3131

3232
:::info 数据流向
3333
原始输入`dict`数据进入节点`decode`后,它的`result`键值被写入了结果。
@@ -75,7 +75,7 @@ next="output"
7575
map="B[result:B_result],C[result:data]"
7676
```
7777

78-
output通过`map`配置将B节点的result映射到了自己的B_result, 将C节点的result映射到了data. 当map存在时,默认filter为`Continue/run`, 也就是不再对输入数据做任何处理。
78+
output通过`map`配置将B节点的result映射到了自己的B_result, 将C节点的result映射到了data. 当map存在时,默认filter为`Run/run`, 也就是不再对输入数据做任何处理。
7979

8080
`map`亦可将前序节点的多个键值映射到自身,如 `map="B[1:0,1:1,2:data]"`
8181

i18n/zh/docusaurus-plugin-content-docs/current/Intra-node/Sequential.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import TabItem from '@theme/TabItem';
2121
`Sequential`可简写为`S`. API可参考[`Sequential`](../backend-reference/basic#sequential).
2222

2323
## 条件控制流 filter {#filter_sequential}
24-
`Sequential` 这个后端本身实现了对控制流语法扩展的支持。事实上,`S[DecodeMat,ResizeMat]` 等价于`S[(Continue)DecodeMat,(swap)ResizeMat]`.
24+
`Sequential` 这个后端本身实现了对控制流语法扩展的支持。事实上,`S[DecodeMat,ResizeMat]` 等价于`S[(Run)DecodeMat,(swap)ResizeMat]`.
2525

2626
`()`括号内的filter可返回以下状态:
27-
- Continue, 代表可以跳过当前子后端,等待进入下一个子后端
27+
- Run, 代表可以跳过当前子后端,等待进入下一个子后端(从0.3.2b1开始生效;之前版本可使用Continue)
2828
- Break, 代表跳出Sequential的执行
2929
- Error, 代表出现错误
3030
- SerialSkip, 代表可以连续跳过串行子后端,在`Sequential`中,等价于Break
@@ -34,16 +34,16 @@ import TabItem from '@theme/TabItem';
3434

3535

3636
<Tabs groupId="filter" className="unique-tabs">
37-
<TabItem value="Continue" label="Continue">
37+
<TabItem value="Run" label="Run">
3838

3939
```cpp
4040
#include "filter.hpp"
4141

42-
class FilterContinue : public Filter {
42+
class FilterRun : public Filter {
4343
public:
44-
status forward(dict data) override { return Filter::status::Continue; }
44+
status forward(dict data) override { return Filter::status::Run; }
4545
};
46-
IPIPE_REGISTER(Filter, FilterContinue, "Continue,run");
46+
IPIPE_REGISTER(Filter, FilterRun, "Run,run");
4747
```
4848
4949
@@ -53,7 +53,7 @@ IPIPE_REGISTER(Filter, FilterContinue, "Continue,run");
5353
```cpp
5454
class Filter {
5555
public:
56-
enum struct status { Continue, Skip, SerialSkip, SubGraphSkip, Break, Error };
56+
enum struct status { Run, Skip, SerialSkip, SubGraphSkip, Break, Error };
5757

5858
virtual bool init(const std::unordered_map<std::string, std::string>& /*config*/,
5959
dict /*dict_config*/) {
@@ -68,7 +68,7 @@ class Filter {
6868

6969
(*input)[TASK_DATA_KEY] = (*input)[TASK_RESULT_KEY];
7070
input->erase(iter);
71-
return status::Continue;
71+
return status::Run;
7272
}
7373

7474
virtual ~Filter() = default;
@@ -86,7 +86,7 @@ class Filter {
8686
`TensorrtTensor`的范围刚好是[1,4]. 根据[Sequential计算输入范围的规则](../backend-reference/basic#sequential),Sequential的输入范围是[1,4].
8787
8888
如果同时有四个数据进入此Sequential,但是其中一个解码失败,那么此时
89-
- 一个数据在`swap`中返回`status::Break`,其余返回`status::Continue`.
89+
- 一个数据在`swap`中返回`status::Break`,其余返回`status::Run`.
9090
- `Sequential`将三个数据继续送入下一个阶段, 而`Break`状态的数据终止Sequential中的执行
9191
9292
以上是遇到部分数据`Break`时的反应;类似的,遇到部分数据`Skip`,也会类似地局部性处理数据。然而,当一个数据`Error`时,Sequential会认为任务整体的状态是`Error`. 如果这与使用者的本意相违背,使用者可以尝试将子后端拆分到不同的Sequential中,以避免互相影响。注意,`Error`状态一般是极其稀有的,预料外的状态。

i18n/zh/docusaurus-plugin-content-docs/current/faq/onnx.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ type: explainer
4848
修改完网络后,可以利用下面代码,将pytorch模型转换为onnx模型。
4949

5050
```python
51-
x = torch.randn(1,*input_shape).cuda()
51+
x = torch.randn(1,3,224,224).cuda()
5252
out_size = 1
53-
out={"input":{0:"batch_size"}}
53+
in_out={"input":{0:"batch_size"}}
5454
for i in range(out_size):
55-
out[f"output_{i}"] = {0:"batch_size"}
55+
in_out[f"output_{i}"] = {0:"batch_size"}
5656

5757
torch_model.cuda().eval()
5858
torch.onnx.export(torch_model,
@@ -62,7 +62,7 @@ torch.onnx.export(torch_model,
6262
do_constant_folding=True,
6363
input_names=["input"], # 输入名
6464
output_names=[f"output_{i}" for i in range(out_size)], # 输出名
65-
dynamic_axes=out)
65+
dynamic_axes=in_out)
6666

6767
import onnx
6868
from onnxsim import onnx_simplifier

0 commit comments

Comments
 (0)