Skip to content

Commit

Permalink
[CustomDevice] refine custom device api (PaddlePaddle#5604)
Browse files Browse the repository at this point in the history
* [CustomDevice] refine custom device api

* update
  • Loading branch information
ronny1996 committed Feb 2, 2023
1 parent 2dbed63 commit 083a8ca
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 267 deletions.
2 changes: 1 addition & 1 deletion docs/dev_guides/custom_device_docs/ccl_api_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ C_Status (*xccl_group_end)()
### 接口说明
结束集合通迅操作聚合
停止集合通迅操作聚合
## xccl_send 【optional】
Expand Down
292 changes: 146 additions & 146 deletions docs/dev_guides/custom_device_docs/custom_runtime_cn.rst

Large diffs are not rendered by default.

256 changes: 154 additions & 102 deletions docs/dev_guides/custom_device_docs/custom_runtime_en.rst

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions docs/dev_guides/custom_device_docs/memory_api_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ ptr - 需要释放的统一地址空间内存地址。

size - 需要释放的内存大小(字节形式)。

## memory_copy_h2d 【required
## memory_copy_h2d 【optional

### 接口定义

Expand All @@ -142,7 +142,7 @@ src - 源主机内存地址。
size - 需要拷贝的内存大小(字节形式)。
## memory_copy_d2h 【required
## memory_copy_d2h 【optional
### 接口定义
Expand All @@ -164,7 +164,7 @@ src - 源设备内存地址。

size - 需要拷贝的内存大小(字节形式)。

## memory_copy_d2d 【required
## memory_copy_d2d 【optional

### 接口定义

Expand Down Expand Up @@ -330,7 +330,7 @@ value - 填充值。
size - 填充大小(字节形式)。
## device_memory_stats 【required
## device_memory_stats 【optional
### 接口定义
Expand All @@ -350,7 +350,7 @@ total_memory - 总内存(字节形式)。

free_memory - 剩余可用内存(字节形式)。

## device_min_chunk_size 【required
## device_min_chunk_size 【optional

### 接口定义

Expand Down
10 changes: 5 additions & 5 deletions docs/dev_guides/custom_device_docs/memory_api_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ ptr - the address of unified memory needed to be deallocated

size - the size of memory needed to be deallocated (in byte)

## memory_copy_h2d 【required
## memory_copy_h2d 【optional

### Definition

Expand All @@ -142,7 +142,7 @@ src - the address of the source host memory
size - the size of memory needed to be copied (in byte)
## memory_copy_d2h 【required
## memory_copy_d2h 【optional
### Definition
Expand All @@ -164,7 +164,7 @@ src - the address of the source device memory

size - the size of memory needed to be copied (in byte)

## memory_copy_d2d 【required
## memory_copy_d2d 【optional

### Definition

Expand Down Expand Up @@ -330,7 +330,7 @@ value - padded value
size - padding size (in byte)
## device_memory_stats 【required
## device_memory_stats 【optional
### Definition
Expand All @@ -350,7 +350,7 @@ total_memory - total memory (in byte)

free_memory - free memory (in byte)

## device_min_chunk_size 【required
## device_min_chunk_size 【optional

### Definition

Expand Down
8 changes: 4 additions & 4 deletions docs/dev_guides/custom_device_docs/stream_api_cn.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stream 接口

## create_stream 【required
## create_stream 【optional

### 接口定义

Expand All @@ -18,7 +18,7 @@ device - 使用的设备。
stream - 存储创建的 stream 对象。
## destroy_stream 【required
## destroy_stream 【optional
### 接口定义
Expand Down Expand Up @@ -54,7 +54,7 @@ device - 使用的设备。
stream - 需要查询的 stream。
## synchronize_stream 【required
## synchronize_stream 【optional
### 接口定义
Expand Down Expand Up @@ -94,7 +94,7 @@ callback - 回调函数。
user_data - 回调函数的参数。
## stream_wait_event 【required
## stream_wait_event 【optional
### 接口定义
Expand Down
8 changes: 4 additions & 4 deletions docs/dev_guides/custom_device_docs/stream_api_en.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stream APIs

## create_stream 【required
## create_stream 【optional

### Definition

Expand All @@ -18,7 +18,7 @@ device - the device to be used
stream - the created stream
## destroy_stream 【required
## destroy_stream 【optional
### Definition
Expand Down Expand Up @@ -54,7 +54,7 @@ device - the device to be used
stream - the stream required to be queried.
## synchronize_stream 【required
## synchronize_stream 【optional
### Definition
Expand Down Expand Up @@ -94,7 +94,7 @@ callback - the callback function
user_data - parameters of the function
## stream_wait_event 【required
## stream_wait_event 【optional
### Definition
Expand Down

0 comments on commit 083a8ca

Please sign in to comment.