Tensor.load
Function
All data transfer instructions in the msKPP tool are abstracted as the load method, and users only need to focus on the reasonable transfer channels in Ascend AI Processors, without considering the complex stride concept in the transfer instructions.
Prototype
1 | Tensor.load(tensor, repeat=1, set_value=-1, expect_value=-1) |
Parameters
Parameter |
Input Type |
Description |
|---|---|---|
tensor |
Variable |
Another input tensor, whose function is the same as that defined in the API. |
repeat |
int |
This parameter simulates the transfer instruction repeat. You can input this parameter to obtain the bandwidth of each transfer channel with varying repeat values. The bandwidth is used to calculate the time consumed by the transfer instruction. This parameter is optional. The default value is 1. You are advised to set it to an integer within the range of [1, 255]. If the input value of repeat does not meet the requirement, the system throws exception "input repeat = xx invalid." where xx is the input abnormal value of repeat. |
set_value |
int |
Identifier indicating that the tensor data is dependent by others. This parameter can be customized and must be used in conjunction with expect_value. This parameter is optional. If it is not specified, the dependency relationship is not enabled. |
expect_value |
int |
Identifier indicating that loading of the tensor data depends on other data. This parameter can be customized and must be used in conjunction with set_value. This parameter is optional. If it is not specified, the dependency relationship is not enabled. |
Constraints
set_value and expect_value must be used in pairs. Otherwise, pipeline blocking may occur.
The repeat parameter supports only the following four transfer channels: L1_TO_L0A, L1_TO_L0B, GM_TO_L0A, and GM_TO_L0B.