mskpp.tiling_func
Function
Calls the tiling function of the user.
Function Prototype
def tiling_func(op_type: str, inputs: list, outputs: list, lib_path: str,
inputs_info: list = None, outputs_info: list = None, attr=None, soc_version: str = None) -> TilingOutput
Parameters
Return Value
Parameter |
Description |
|---|---|
blockdim |
Number of cores configured for the tiling function. Data type: int. |
workspace_size |
The value is the size of the workspace applied for by the user plus 78,643,200 bytes reserved by msKPP. Data type: int. |
workspace |
Workspace applied for by msKPP. The size is workspace_size. Data type: numpy.array. |
tiling_data |
Stores tiling_data, which is used to call the kernel function. Data type: numpy.array. |
tiling_key |
tiling_key configured by the user's tiling function. If it is not set, msKPP sets it to 0 by default. Data type: int. |
Example
M = 1024
N = 640
K = 256
input_a = np.random.randint(1, 10, [M, K]).astype(np.float16)
input_b = np.random.randint(1, 10, [K, N]).astype(np.float16)
input_bias = np.random.randint(1, 10, [N]).astype(np.float32)
output = np.zeros([M, N]).astype(np.float32)
# tiling data
tiling_output = mskpp.tiling_func(
op_type="MatmulLeakyreluCustom",
inputs=[input_a, input_b, input_bias], outputs=[output],
lib_path="liboptiling.so", # tiling code build output.
)
Parent topic: API List
