Skip to content

Commit 80e1de0

Browse files
authored
Fix Chart and Add English docs (#7479)
* fix chart * precommmit * fix chart * fix format * fix ccl apis * fix en chart * fix cn chart
1 parent 025be1d commit 80e1de0

File tree

3 files changed

+190
-70
lines changed

3 files changed

+190
-70
lines changed

docs/dev_guides/custom_device_docs/custom_runtime_cn.rst

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,45 +16,45 @@
1616
Device 接口
1717
############
1818

19-
+---------------------------+----------------------------------------------+------+
20-
| 接口名称 | 功能简介 | 必选 |
21-
+===========================+==============================================+======+
22-
| initialize | 初始化硬件后端。 | N |
23-
+---------------------------+----------------------------------------------+------+
24-
| finalize | 去初始化硬件后端。 | N |
25-
+---------------------------+----------------------------------------------+------+
26-
| init_device | 初始化指定硬件设备。 | N |
27-
+---------------------------+----------------------------------------------+------+
28-
| deinit_device | 去初始化指定硬件设备。 | N |
29-
+---------------------------+----------------------------------------------+------+
30-
| set_device | 设置当前使用的硬件设备。 | Y |
31-
+---------------------------+----------------------------------------------+------+
32-
| get_device | 获取当前使用的硬件设备。 | Y |
33-
+---------------------------+----------------------------------------------+------+
34-
| synchronize_device | 同步指定的硬件设备。 | Y |
35-
+---------------------------+----------------------------------------------+------+
36-
| get_device_count | 查询可用设备数量。 | Y |
37-
+---------------------------+----------------------------------------------+------+
38-
| get_device_list | 查询可用设备号。 | Y |
39-
+---------------------------+----------------------------------------------+------+
40-
| get_compute_capability | 查询设备算力。 | Y |
41-
+---------------------------+----------------------------------------------+------+
42-
| get_runtime_version | 查询运行时版本号。 | Y |
43-
+---------------------------+----------------------------------------------+------+
44-
| get_driver_version | 查询驱动版本号。 | Y |
45-
+---------------------------+----------------------------------------------+------+
46-
| get_multi_process | 获取设备上的 MultiProcessor 数量。 | N |
47-
+---------------------------+----------------------------------------------+------+
48-
| get_max_threads_per_mp | 获取设备每个 MultiProcessor 上的最大线程数。 | N |
49-
+---------------------------+----------------------------------------------+------+
50-
| get_max_threads_per_block | 获取设备每个 Block 能够运行的最大线程数。 | N |
51-
+---------------------------+----------------------------------------------+------+
52-
| get_max_grid_dim_size | 获取设备最大网格维度大小。 | N |
53-
+---------------------------+----------------------------------------------+------+
54-
| init_eigen_device | 初始化 Eigen GPU 设备对象。 | N |
55-
+---------------------------+----------------------------------------------+------+
56-
| destroy_eigen_device | 销毁 Eigen GPU 设备对象。 | N |
57-
+---------------------------+----------------------------------------------+------+
19+
+---------------------------+-----------------------------------------------+------+
20+
| 接口名称 | 功能简介 | 必选 |
21+
+===========================+===============================================+======+
22+
| initialize | 初始化硬件后端。 | N |
23+
+---------------------------+-----------------------------------------------+------+
24+
| finalize | 去初始化硬件后端。 | N |
25+
+---------------------------+-----------------------------------------------+------+
26+
| init_device | 初始化指定硬件设备。 | N |
27+
+---------------------------+-----------------------------------------------+------+
28+
| deinit_device | 去初始化指定硬件设备。 | N |
29+
+---------------------------+-----------------------------------------------+------+
30+
| set_device | 设置当前使用的硬件设备。 | Y |
31+
+---------------------------+-----------------------------------------------+------+
32+
| get_device | 获取当前使用的硬件设备。 | Y |
33+
+---------------------------+-----------------------------------------------+------+
34+
| synchronize_device | 同步指定的硬件设备。 | Y |
35+
+---------------------------+-----------------------------------------------+------+
36+
| get_device_count | 查询可用设备数量。 | Y |
37+
+---------------------------+-----------------------------------------------+------+
38+
| get_device_list | 查询可用设备号。 | Y |
39+
+---------------------------+-----------------------------------------------+------+
40+
| get_compute_capability | 查询设备算力。 | Y |
41+
+---------------------------+-----------------------------------------------+------+
42+
| get_runtime_version | 查询运行时版本号。 | Y |
43+
+---------------------------+-----------------------------------------------+------+
44+
| get_driver_version | 查询驱动版本号。 | Y |
45+
+---------------------------+-----------------------------------------------+------+
46+
| get_multi_process | 获取设备上的 MultiProcessor 数量。 | N |
47+
+---------------------------+-----------------------------------------------+------+
48+
| get_max_threads_per_mp | 获取设备每个 MultiProcessor 上的最大线程数。 | N |
49+
+---------------------------+-----------------------------------------------+------+
50+
| get_max_threads_per_block | 获取设备每个 Block 能够运行的最大线程数。 | N |
51+
+---------------------------+-----------------------------------------------+------+
52+
| get_max_grid_dim_size | 获取设备最大网格维度大小。 | N |
53+
+---------------------------+-----------------------------------------------+------+
54+
| init_eigen_device | 初始化 Eigen GPU 设备对象。 | N |
55+
+---------------------------+-----------------------------------------------+------+
56+
| destroy_eigen_device | 销毁 Eigen GPU 设备对象。 | N |
57+
+---------------------------+-----------------------------------------------+------+
5858

5959

6060
Memory 接口

docs/dev_guides/custom_device_docs/custom_runtime_en.rst

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,45 @@ Custom Runtime offers a new method to register the runtime of new devices via pl
1414
Device APIs
1515
############
1616

17-
+------------------------+----------------------------------------+----------+
18-
| API | Function | Required |
19-
+========================+========================================+==========+
20-
| initialize | To initialize the device backend | N |
21-
+------------------------+----------------------------------------+----------+
22-
| finalize | To de-initialize the device backend | N |
23-
+------------------------+----------------------------------------+----------+
24-
| init_device | To initialize the designated device | N |
25-
+------------------------+----------------------------------------+----------+
26-
| deinit_device | To de-initialize the designated device | N |
27-
+------------------------+----------------------------------------+----------+
28-
| set_device | To set the current device | Y |
29-
+------------------------+----------------------------------------+----------+
30-
| get_device | To get the current device | Y |
31-
+------------------------+----------------------------------------+----------+
32-
| synchronize_device | To synchronize the desginated device | Y |
33-
+------------------------+----------------------------------------+----------+
34-
| get_device_count | To count available devices | Y |
35-
+------------------------+----------------------------------------+----------+
36-
| get_device_list | To get the list of available devices | Y |
37-
+------------------------+----------------------------------------+----------+
38-
| get_compute_capability | To get computing capability of devices | Y |
39-
+------------------------+----------------------------------------+----------+
40-
| get_runtime_version | To get the runtime version | Y |
41-
+------------------------+----------------------------------------+----------+
42-
| get_driver_version | To get the driver version | Y |
43-
+------------------------+----------------------------------------+----------+
17+
+---------------------------+----------------------------------------------------------+----------+
18+
| API | Function | Required |
19+
+===========================+==========================================================+==========+
20+
| initialize | To initialize the device backend | N |
21+
+---------------------------+----------------------------------------------------------+----------+
22+
| finalize | To de-initialize the device backend | N |
23+
+---------------------------+----------------------------------------------------------+----------+
24+
| init_device | To initialize the designated device | N |
25+
+---------------------------+----------------------------------------------------------+----------+
26+
| deinit_device | To de-initialize the designated device | N |
27+
+---------------------------+----------------------------------------------------------+----------+
28+
| set_device | To set the current device | Y |
29+
+---------------------------+----------------------------------------------------------+----------+
30+
| get_device | To get the current device | Y |
31+
+---------------------------+----------------------------------------------------------+----------+
32+
| synchronize_device | To synchronize the desginated device | Y |
33+
+---------------------------+----------------------------------------------------------+----------+
34+
| get_device_count | To count available devices | Y |
35+
+---------------------------+----------------------------------------------------------+----------+
36+
| get_device_list | To get the list of available devices | Y |
37+
+---------------------------+----------------------------------------------------------+----------+
38+
| get_compute_capability | To get computing capability of devices | Y |
39+
+---------------------------+----------------------------------------------------------+----------+
40+
| get_runtime_version | To get the runtime version | Y |
41+
+---------------------------+----------------------------------------------------------+----------+
42+
| get_driver_version | To get the driver version | Y |
43+
+---------------------------+----------------------------------------------------------+----------+
44+
| get_multi_process | To get the number of MultiProcessors on the device | N |
45+
+---------------------------+----------------------------------------------------------+----------+
46+
| get_max_threads_per_mp | To get the max threads per MultiProcessor | N |
47+
+---------------------------+----------------------------------------------------------+----------+
48+
| get_max_threads_per_block | To get the max threads per block | N |
49+
+---------------------------+----------------------------------------------------------+----------+
50+
| get_max_grid_dim_size | To get the max grid dimension size | N |
51+
+---------------------------+----------------------------------------------------------+----------+
52+
| init_eigen_device | To initialize the Eigen GPU device object | N |
53+
+---------------------------+----------------------------------------------------------+----------+
54+
| destroy_eigen_device | To destroy the Eigen GPU device object | N |
55+
+---------------------------+----------------------------------------------------------+----------+
4456

4557

4658
Memory APIs
@@ -133,7 +145,7 @@ Event APIs
133145
+-------------------+------------------------------------------------------+----------+
134146

135147
Collective communication APIs
136-
############
148+
###############################
137149

138150
+-------------------------+---------------------------------------------------------+----------+
139151
| API | Function | Required |
@@ -142,9 +154,9 @@ Collective communication APIs
142154
+-------------------------+---------------------------------------------------------+----------+
143155
| xccl_get_unique_id | Get unique_id object | N |
144156
+-------------------------+---------------------------------------------------------+----------+
145-
| xccl_comm_init_rank | To initialize communicator | N |
157+
| xccl_comm_init_rank | To initialize communicator | N |
146158
+-------------------------+---------------------------------------------------------+----------+
147-
| xccl_destroy_comm | To destroy communicator | N |
159+
| xccl_destroy_comm | To destroy communicator | N |
148160
+-------------------------+---------------------------------------------------------+----------+
149161
| xccl_all_reduce | Collective communication AllReduce operation | N |
150162
+-------------------------+---------------------------------------------------------+----------+
@@ -167,7 +179,7 @@ Collective communication APIs
167179

168180

169181
Profiler APIs
170-
############
182+
###############
171183

172184
+-----------------------------+-----------------------------------+----------+
173185
| API | Function | Required |

docs/dev_guides/custom_device_docs/device_api_en.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,111 @@ It gets the driver version.
183183
### Parameter
184184

185185
version - the version of the stored driver
186+
187+
## get_multi_process 【optional】
188+
189+
### Definition
190+
191+
```c++
192+
C_Status (*get_multi_process)(const C_Device device, size_t* multi_process);
193+
```
194+
195+
### Description
196+
197+
Get the number of MultiProcessors on the device.
198+
199+
### Parameter
200+
201+
device - the device to query.
202+
multi_process - to store the number of MultiProcessors.
203+
204+
## get_max_threads_per_mp 【optional】
205+
206+
### Definition
207+
208+
```c++
209+
C_Status (*get_max_threads_per_mp)(const C_Device device, size_t* threads_per_mp);
210+
```
211+
212+
### Description
213+
214+
Get the maximum number of threads per MultiProcessor on the device.
215+
216+
### Parameter
217+
218+
device - the device to query.
219+
threads_per_mp - to store the maximum threads per MultiProcessor.
220+
221+
## get_max_threads_per_block 【optional】
222+
223+
### Definition
224+
225+
```c++
226+
C_Status (*get_max_threads_per_block)(const C_Device device, size_t* threads_per_block);
227+
```
228+
229+
### Description
230+
231+
Get the maximum number of threads per block that can run on the device.
232+
233+
### Parameter
234+
235+
device - the device to query.
236+
threads_per_block - to store the maximum threads per block.
237+
238+
## get_max_grid_dim_size 【optional】
239+
240+
### Definition
241+
242+
```c++
243+
C_Status (*get_max_grid_dim_size)(const C_Device device, std::array<unsigned int, 3>* grid_dim_size);
244+
```
245+
246+
### Description
247+
248+
Get the maximum grid dimension size of the device.
249+
250+
### Parameter
251+
252+
device - the device to query.
253+
grid_dim_size - to store the maximum grid dimension size.
254+
255+
## init_eigen_device 【optional】
256+
257+
### Definition
258+
259+
```c++
260+
C_Status (*init_eigen_device)(C_Place place,
261+
C_EigenDevice* eigen_device,
262+
C_Stream stream,
263+
C_Allocator allocator);
264+
```
265+
266+
### Description
267+
268+
Initialize the Eigen GPU device object.
269+
270+
### Parameter
271+
272+
place - the place object of the device to use.
273+
eigen_device - to store the Eigen GPU device object.
274+
stream - the stream object in Custom Context.
275+
allocator - the allocator object in Custom Context.
276+
277+
## destroy_eigen_device 【optional】
278+
279+
### Definition
280+
281+
```c++
282+
C_Status (*destroy_eigen_device)(const C_Device device,
283+
C_EigenDevice* eigen_device);
284+
```
285+
286+
### Description
287+
288+
Destroy the Eigen GPU device object.
289+
290+
### Parameter
291+
292+
device - the device object to use.
293+
eigen_device - the Eigen GPU device object to be destroyed.

0 commit comments

Comments
 (0)