Conv3D Template Parameters

Applicability

Product

Supported

Atlas 350 Accelerator Card

x

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

x

Atlas inference product AI Core

x

Atlas inference product Vector Core

x

Atlas training product

x

Function Usage

The following parameters need to be passed to create a Conv3D object:

  • Types of Input, Weight, Output, and Bias (optional) are defined by ConvType, including the logical memory location, data format, and data type.
  • Conv3dParam information (optional), which is used to enable the performance optimization template in different scenarios. Currently, this is not supported.

Prototype

1
2
template <class INPUT_TYPE, class WEIGHT_TYPE, class OUTPUT_TYPE, class BIAS_TYPE = biasType, class CONV_CFG = Conv3dParam>
using Conv3D = Conv3dIntfExt<Config<ConvApi::ConvDataType<INPUT_TYPE, WEIGHT_TYPE, OUTPUT_TYPE, BIAS_TYPE, CONV_CFG>>, Impl, Intf>

Parameters

Table 1 Template parameters

Parameter

Input/Output

Description

INPUT_TYPE

Input

ConvType type template parameter, specifying the type of the Input parameter.

WEIGHT_TYPE

Input

ConvType type template parameter, specifying the type of the Weight parameter.

OUTPUT_TYPE

Input

ConvType type template parameter, specifying the type of the Output parameter.

BIAS_TYPE

Optional input

ConvType type template parameter, specifying the type of the Bias parameter.

CONV_CFG

Optional input

ConvParam type template parameter, which is used to enable the performance optimization template for different scenarios. In the current version, only the basic template is supported, and performance optimization is not enabled.

Returns

None

Restrictions

None

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#include "lib/conv/conv3d/conv3d_api.h"

using inputType = ConvApi::ConvType<AscendC::TPosition::GM, ConvFormat::NDC1HWC0, bfloat16_t>;
using weightType = ConvApi::ConvType<AscendC::TPosition::GM, ConvFormat::FRACTAL_Z_3D, bfloat16_t>;
using outputType = ConvApi::ConvType<AscendC::TPosition::GM, ConvFormat::NDC1HWC0, bfloat16_t>;
using biasType = ConvApi::ConvType<AscendC::TPosition::GM, ConvFormat::ND, float>; // The parameter is optional. If Bias is not used, the parameter does not need to be passed.
struct ConvCustom : public ConvApi::ConvParam {
    __aicore__ inline ConvCustom(){};
}; // The parameter is optional. In the current version, only the basic template is supported, and performance optimization is not enabled. The parameter does not need to be passed.

Conv3dApi::Conv3D<inputType, weightType, outputType, biasType, ConvCustom> conv3dApi;