During operator compilation, you need to be aware of different architectures and AI processor models.
Heterogeneous compilation scenario: Currently, Kirin X90 and Kirin 9030 do not support heterogeneous compilation.
Standard custom operator project scenario: When defining the operator prototype, you need to call the AddConfig API to register the AI processor models supported by the operator and related configurations. The prototype of the AddConfig API is as follows: The soc parameter indicates the AI processor model, and the aicore_config parameter indicates other configuration.
void AddConfig(const char *soc); void AddConfig(const char *soc, OpAICoreConfig &aicore_config);
Therefore, you need to add the AI processor models supported by the operator to the operator prototype definition: Kirin X90 and Kirin 9030. In addition, change the value of the ASCEND_COMPUTE_UNIT field in the compilation configuration file CMakePresets.json in the operator project directory to the AI processor model of the new platform to be compiled.
// ...
namespace ops {
class AddCustom : public OpDef {
public:
AddCustom(const char* name) : OpDef(name)
{
// ...
this->AICore().AddConfig("ascend910b");
// Example: Add the Kirin X90 processor series.
this->AICore().AddConfig("kirinx90");
}
};
OP_ADD(AddCustom);
} // namespace ops