AddPlatformInfo

Function Usage

Sets the hardware platform information for debugging the operator tiling function. The following two setting methods are supported:

  • Automatically obtaining the current hardware platform information: Pass a null pointer to automatically obtain the current hardware information and add it to the ContextBuilder class.
  • Specifying the hardware platform information: Pass a specific Ascend AI Processor model and add the corresponding hardware information to the ContextBuilder class.

If the setting fails, an error message is printed. For details about how to configure and view logs, see Logging.

Prototype

1
ContextBuilder &AddPlatformInfo(const char* customSocVersion)

Parameters

Parameter

Input/Output

Description

customSocVersion

Input

AI processor model. The configuration method is as follows:

  • For the following products: Run the npu-smi info command on the server where AI processor is installed to obtain the Name information. The actual value is AscendName. For example, if Name is xxxyy, the actual value is Ascendxxxyy.

    Atlas A2 training product / Atlas A2 inference product

    Atlas 200I/500 A2 inference product

    Atlas inference product

    Atlas training product

  • For the Atlas A3 training product / Atlas A3 inference product : Run the npu-smi info -t board -i id -c chip_id command on the server where AI processor is installed to obtain the Chip Name and NPU Name information. The actual value is Chip Name_NPU Name. For example, if the value of Chip Name is Ascendxxx and the value of NPU Name is 1234, the actual value is Ascendxxx_1234. Note that:
    • id: device ID, which is the NPU ID obtained by running the npu-smi info -l command.
    • chip_id: chip ID, which is obtained by running the npu-smi info -m command.
  • For the Atlas 350 Accelerator Card: Run the npu-smi info -t board -i id command on the server where AI processor is installed to obtain the Chip Name and NPU Name information. The actual value is Chip Name_NPU Name. For example, if the value of Chip Name is Ascendxxx and the value of NPU Name is 1234, the actual value is Ascendxxx_1234.

    id indicates the device ID, which is the NPU ID obtained by running the npu-smi info -l command.

Returns

Object of the current ContextBuilder.

Restrictions

After AddPlatformInfo is called, the tiling context needs to be constructed using BuildTilingContext and passed to the tiling function.

Examples

1
2
3
4
5
6
7
8
9
void AddPlatformInfoDemo(......)
{
    auto holder = context_ascendc::ContextBuilder()
	// ... ... // Add the calling of the operator input and output APIs.
	.AddPlatformInfo("Ascendxxxyy")
	.BuildTilingContext();
    auto tilingContext = holder->GetContext<gert::TilingContext>();
    // ... ...
}