Skip to content

Commit e8c7b8d

Browse files
author
nan
committed
v0
1 parent 559cabb commit e8c7b8d

File tree

18 files changed

+54
-55
lines changed

18 files changed

+54
-55
lines changed

docs/backend-reference/torch.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ For quantizing onnx models using tensorrt, the following parameters are availabl
148148

149149

150150

151-
See [example](https://github.com/torchpipe/torchpipe/tree/main/examples/int8).
151+
See [example](https://github.com/torchpipe/torchpipe/tree/v0/examples/int8).
152152

153153

154154
### Forward Computation

docs/benchmark.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Client 10/Compute Backend Instance 1/Timeout 0/Max Batch 1
6767
| triton-cli | QPS: 15039 <br /> | - |
6868

6969

70-
[import]: https://github.com/torchpipe/torchpipe/blob/main/libs/commands/import/README.md
70+
[import]: https://github.com/torchpipe/torchpipe/blob/v0/libs/commands/import/README.md
7171

7272

7373

docs/contribution_guide/modify_the_code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ pytest .
2828
If necessary, please consider supplementing with [Python tests](https://github.com/torchpipe/torchpipe//test).
2929

3030
:::note Code Formatting (optional)
31-
Please configure a formatting plugin to enable [.clang-format](https://github.com/torchpipe/torchpipe/blob/develop/.clang-format).
31+
Please configure a formatting plugin to enable [.clang-format](https://github.com/torchpipe/torchpipe/blob/v0/.clang-format).
3232
:::

docs/installation.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ If you encounter any compilation or runtime issues inside the Docker container,
3636
First, clone the code:
3737

3838
```bash
39-
git clone https://github.com/torchpipe/torchpipe.git
40-
# git clone -b main https://github.com/torchpipe/torchpipe.git
39+
git clone -b v0 https://github.com/torchpipe/torchpipe.git
4140
cd torchpipe/ && git submodule update --init --recursive
4241
```
4342

@@ -146,7 +145,7 @@ For more examples, see [Showcase](./showcase/showcase.mdx).
146145

147146
## Customizing Dockerfile {#selfdocker}
148147

149-
Refer to the [example Dockerfile](https://github.com/torchpipe/torchpipe/blob/main/docker/Dockerfile).
148+
Refer to the [example Dockerfile](https://github.com/torchpipe/torchpipe/blob/v0/docker/Dockerfile).
150149

151150
```bash
152151

docs/python/test.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def test_all_files(file_dir:str, num_clients=10, batch_size = 1,
392392

393393

394394
### Clients with Different Batch Sizes
395-
In the example provided [here](https://github.com/torchpipe/torchpipe/blob/main/examples/yolox/yolox_multithreads_test.py), we use ten clients, each requesting different amounts of data per request, ranging from 1 to 10. We validate the consistency of the results in this case.
395+
In the example provided [here](https://github.com/torchpipe/torchpipe/blob/v0/examples/yolox/yolox_multithreads_test.py), we use ten clients, each requesting different amounts of data per request, ranging from 1 to 10. We validate the consistency of the results in this case.
396396

397397
Typically, users can iterate through all the data in a directory and repeatedly send requests to verify the stability and consistency of the results.
398398

docs/quick_start_new_user.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type: explainer
77

88
# Trial in 30mins(new users)
99

10-
TorchPipe is a multi-instance pipeline parallel library that provides a seamless integration between lower-level acceleration libraries (such as TensorRT and OpenCV) and RPC frameworks. It guarantees high service throughput while meeting latency requirements. This document is mainly for new users, that is, users who are in the introductory stage of acceleration-related theoretical knowledge, know some python grammar, and can read simple codes. This content mainly includes the use of torchpipe for accelerating service deployment, complemented by performance and effect comparisons. The complete code of this document can be found at [resnet50_thrift](https://github.com/torchpipe/torchpipe/blob/develop/examples/resnet50_thrift/)
10+
TorchPipe is a multi-instance pipeline parallel library that provides a seamless integration between lower-level acceleration libraries (such as TensorRT and OpenCV) and RPC frameworks. It guarantees high service throughput while meeting latency requirements. This document is mainly for new users, that is, users who are in the introductory stage of acceleration-related theoretical knowledge, know some python grammar, and can read simple codes. This content mainly includes the use of torchpipe for accelerating service deployment, complemented by performance and effect comparisons. The complete code of this document can be found at [resnet50_thrift](https://github.com/torchpipe/torchpipe/blob/v0/examples/resnet50_thrift/)
1111

1212
## Catalogue
1313
* [1. Basic knowledge](#1)
@@ -84,7 +84,7 @@ self.classification_engine = torch2trt(resnet50, [input_shape],
8484

8585
```
8686

87-
The overall online service deployment can be found at [main_trt.py](https://github.com/torchpipe/torchpipe/blob/develop/examples/resnet50_thrift/main_trt.py)
87+
The overall online service deployment can be found at [main_trt.py](https://github.com/torchpipe/torchpipe/blob/v0/examples/resnet50_thrift/main_trt.py)
8888

8989
:::tip
9090
Since TensorRT is not thread-safe, when using this method for model acceleration, it is necessary to handle locking (with self.lock:) during the service deployment process.
@@ -104,7 +104,7 @@ From the above process, it's clear that when accelerating a single model, the fo
104104

105105
![](images/quick_start_new_user/torchpipe_en.png)
106106

107-
We've made adjustments to the deployment of our service using TorchPipe.The overall online service deployment can be found at [main_torchpipe.py](https://github.com/torchpipe/torchpipe/blob/develop/examples/resnet50_thrift/main_torchpipe.py).
107+
We've made adjustments to the deployment of our service using TorchPipe.The overall online service deployment can be found at [main_torchpipe.py](https://github.com/torchpipe/torchpipe/blob/v0/examples/resnet50_thrift/main_torchpipe.py).
108108
The core function modifications as follows:
109109

110110
```py
@@ -219,7 +219,7 @@ std="58.395, 57.120, 57.375" # 255*"0.229, 0.224, 0.225"
219219
`python clien_qps.py --img_dir /your/testimg/path/ --port 8888 --request_client 20 --request_batch 1
220220
`
221221

222-
The specific test code can be found at [client_qps.py](https://github.com/torchpipe/torchpipe/blob/develop/examples/resnet50_thrift/client_qps.py)
222+
The specific test code can be found at [client_qps.py](https://github.com/torchpipe/torchpipe/blob/v0/examples/resnet50_thrift/client_qps.py)
223223

224224
With the same Thrift service interface, testing on a machine with NVIDIA-3080 GPU, 36-core CPU, and concurrency of 10, we have the following results:
225225

docs/showcase/showcase.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ slug: /showcase
1717
| [tensorrt's native int8] | | [TensorrtTensor](../backend-reference/torch.mdx#tensorrttensor) | |
1818

1919

20-
[resnet18]: https://github.com/torchpipe/torchpipe/tree/main/examples/resnet18
21-
[yolox]: https://github.com/torchpipe/torchpipe/tree/main/examples/yolox
22-
[PP-OCRv2]: https://github.com/torchpipe/torchpipe/tree/main/examples/ppocr
23-
[TensorRT's native INT8]: https://github.com/torchpipe/torchpipe/tree/main/examples/int8
20+
[resnet18]: https://github.com/torchpipe/torchpipe/tree/v0/examples/resnet18
21+
[yolox]: https://github.com/torchpipe/torchpipe/tree/v0/examples/yolox
22+
[PP-OCRv2]: https://github.com/torchpipe/torchpipe/tree/v0/examples/ppocr
23+
[TensorRT's native INT8]: https://github.com/torchpipe/torchpipe/tree/v0/examples/int8
2424

2525
[torchpipe.utils.cpp_extension.load]: ../python/compile.mdx
2626
[filter]: ../Inter-node/filter.mdx

docs/tools/quantization.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ For detection models, you can consider using the [official complete tutorial](ht
2929

3030
In addition to the pre-training parameters provided by the model for normal training, training-based quantization also requires quantization pre-training parameters provided by post-training quantization (ptq).
3131

32-
We have integrated [calib_tools](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/calib_tools.py) for reference.
32+
We have integrated [calib_tools](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/calib_tools.py) for reference.
3333

3434
- Define calibrator:
3535
```python
@@ -100,17 +100,17 @@ The official training format is very simple and is only used as an example.
100100
#### Direct Quantization without Modifying Backbone
101101
Following the official example, we conducted step-by-step experiments on resnet:
102102

103-
- Download training data: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/download_data.py)
104-
- Train for 10 epochs to obtain the resnet50 model: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/fp32_train.py), accuracy 98.44%
105-
- (optional) PyTorch ptq: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/ptq.py), accuracy 96.64% (max)
106-
- (optional) PyTorch qat: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/qat.py), accuracy 98.26%.
103+
- Download training data: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/download_data.py)
104+
- Train for 10 epochs to obtain the resnet50 model: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/fp32_train.py), accuracy 98.44%
105+
- (optional) PyTorch ptq: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/ptq.py), accuracy 96.64% (max)
106+
- (optional) PyTorch qat: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/qat.py), accuracy 98.26%.
107107

108108
#### MSE + Residual Fusion {#mseadd}
109109

110110
The above resnet training uses the max quantization method and does not fuse the Add layer, resulting in TensorRT running speed not meeting expectations. The following are the results after fusing Add under int8 and switching to the mse mode:
111111

112-
- ptq: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/ptq_merge_residual.py), accuracy 94.34% (mse)
113-
- qat: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/qat_merge_residual.py), accuracy 95.82%.
112+
- ptq: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/ptq_merge_residual.py), accuracy 94.34% (mse)
113+
- qat: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/qat_merge_residual.py), accuracy 95.82%.
114114

115115

116116
#### Summary of Results in PyTorch
@@ -124,9 +124,9 @@ The above resnet training uses the max quantization method and does not fuse the
124124
### Summary of Test Results in TorchPipe
125125
The following tests were performed using the onnx generated by TorchPipe:
126126

127-
- Export onnx: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/export_onnx_merge_residual.py)
128-
- Load fp32-onnx with TorchPipe and perform ptq: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/torchpipe_ptq_test.py)
129-
- Test with qat-onnx loaded with TorchPipe: [code](https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/torchpipe_qat_test.py)
127+
- Export onnx: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/export_onnx_merge_residual.py)
128+
- Load fp32-onnx with TorchPipe and perform ptq: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/torchpipe_ptq_test.py)
129+
- Test with qat-onnx loaded with TorchPipe: [code](https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/torchpipe_qat_test.py)
130130

131131

132132
| Model | Accuracy | Performance | Note |
@@ -135,4 +135,4 @@ The following tests were performed using the onnx generated by TorchPipe:
135135
| tensorrt's native int8 | 98.26% | - | |
136136
| qat | 98.67% | - | [Acc. under onnxruntime] is 98.69%. |
137137

138-
[Acc. under onnxruntime]: https://github.com/torchpipe/torchpipe/blob/develop/examples/int8/qat/onnxruntime_qat_test.py
138+
[Acc. under onnxruntime]: https://github.com/torchpipe/torchpipe/blob/v0/examples/int8/qat/onnxruntime_qat_test.py

docusaurus.config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ const config = {
5858
editUrl: ({locale, versionDocsDirPath, docPath}) => {
5959
// Link to Crowdin for French docs
6060
if (locale == 'en') {
61-
return `https://github.com/torchpipe/torchpipe.github.io/edit/main/docs/${docPath}`;
61+
return `https://github.com/torchpipe/torchpipe.github.io/edit/v0/docs/${docPath}`;
6262
}
6363
// Link to GitHub for English docs
6464

65-
return `https://github.com/torchpipe/torchpipe.github.io/edit/main/i18n/zh/docusaurus-plugin-content-docs/current/${docPath}`;
65+
return `https://github.com/torchpipe/torchpipe.github.io/edit/v0/i18n/zh/docusaurus-plugin-content-docs/current/${docPath}`;
6666
},
6767
sidebarCollapsed: true,
6868
showLastUpdateTime:true,
@@ -192,7 +192,7 @@ const config = {
192192
// label: "Nrwl",
193193
// },
194194
{
195-
href: "https://github.com/torchpipe/torchpipe/",
195+
href: "https://github.com/torchpipe/torchpipe/tree/v0",
196196
className: "header-github-link",
197197
"aria-label": "Github repository",
198198
position: "right",

i18n/zh/docusaurus-plugin-content-docs/current/backend-reference/torch.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ tensorrt推理引擎
151151

152152

153153

154-
参见[示例](https://github.com/torchpipe/torchpipe/tree/main/examples/int8).
154+
参见[示例](https://github.com/torchpipe/torchpipe/tree/v0/examples/int8).
155155

156156

157157
### 前向计算

0 commit comments

Comments
 (0)