已合并
modify document #94
lyx324521创建于 15 天前
modify document #94
已合并
lyx324521创建于 15 天前
1 个文件变更+36-0
@@ -0,0 +1,36 @@
1+# Ascend Extension for TensorPipe API
2+ 
3+## Introduction
4+ 
5+Tensorpipe in the open source repository is based on the point-to-point communication support of Huawei Ascend pytorch/torch_npu. All interfaces are used to implement the functions of the RPC module in torch_npu.
6+ 
7+## Interface definition
8+ 
9+Interfaces are introduced from two aspects: class objects and separate methods defined for external use.
10+ 
11+| class | Class Description | Basic Member Method | Method Description |
12+|:--------------:|:------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------- |:-----------------------------------------------------------------------------------------------------------------:|
13+| ContextOptions | Communication context configuration class. | `ContextOptions&& name(std::string name)` | Configure the communication context name. |
14+| PipeOptions | Pipe configuration | `PipeOptions&& remoteName(std::string remoteName)` | Configuring the Peer Name of a Pipe |
15+| Context | Communication Context Resource Class | `void registerTransport(int64_t priority,std::string transport,std::shared_ptr<transport::Context> context)` | Managing the Port Connection Information Required for Registration Communication |
16+| - | Communication Context Resource Class | `void registerChannel(int64_t priority,std::string channel,std::shared_ptr<channel::Context> context)` | Manages channel link information required for registration communication. |
17+| - | Communication Context Resource Class | `std::shared_ptr<Listener> listen(const std::vector<std::string>& urls)` | Creating a Listening Instance |
18+| - | Communication Context Resource Class | `void close()` | Closes the pipeline required for communication and releases all resources. |
19+| - | Communication Context Resource Class | `void join()` | Wait until all resource application and execution are complete and the current function is blocked synchronously. |
20+| Listener | Communication status monitoring class | `void accept(accept_callback_fn fn)` | Accept the connection request. |
21+| - | Communication status monitoring class | `const std::map<std::string, std::string>& addresses()` | Mapping URL and Port Number |
22+| - | Communication status monitoring class | `const std::string& address(const std::string& transport)` | Reload the function, which maps the URL address and port number. |
23+| - | Communication status monitoring class | `std::string url(const std::string& transport) const` | Obtaining the URL and Port Number |
24+| - | Communication status monitoring class | `void close()` | Disable port listening. |
25+| Message | Communication information expression class | `std::string metadata; std::vector<Payload> payloads; std::vector<Tensor> tensors;` | Example of data information |
26+| Pipe | Communication pipeline description class | `Pipe(ConstructorToken token,std::shared_ptr<ContextImpl> context,std::string id,std::string remoteName,const std::string& url)` | Constructor, creating a pipeline instance. |
27+| - | Communication pipeline description class | `void read(Allocation allocation, read_callback_fn fn)` | Apply for memory and read pipe content. |
28+| - | Communication pipeline description class | `void write(Message message, write_callback_fn fn)` | Write Pipe Content |
29+| - | Communication pipeline description class | `const std::string& getRemoteName()` | Obtaining the Peer Name of a Pipe |
30+| - | Communication pipeline description class | `void close()` | Shut down the pipe |
31+| Buffer | Communication Cache Management Class | `Buffer(TBuffer b)` | Creates a buffer block. |
32+| - | Communication Cache Management Class | `Buffer(const Buffer& other)` | Creates a buffer block by copying the constructor. |
33+| - | Communication Cache Management Class | `Buffer& operator=(const Buffer& other)` | Assignment operator overloading, lvalue |
34+| - | Communication Cache Management Class | `Buffer& operator=(Buffer&& other)` | Assignment operator overload, rvalue |
35+| - | Communication Cache Management Class | `Device device() const` | Obtains the information about the device where the buffer block is located. |
36+| NPUBuffer | Communication Cache Management Class | `Device device() const` | Obtains the information about the device where the buffer block is located. |