(Optional) Customizing Fault Entities
You can customize fault entities to extend the fault types supported by MindCluster Ascend FaultDiag by adding, querying, or deleting fault entities. User-added faults are saved in the ${HOME}/.ascend_faultdiag/custom-ascend-kg-config.json file. When you perform log cleaning and dumping and fault diagnosis, MindCluster Ascend FaultDiag automatically loads the user-defined fault files and the fault files already supported by MindCluster Ascend FaultDiag from the corresponding paths.
If you need to customize the save path of fault files, see the Customizing the MindCluster Ascend FaultDiag Home Directory section for operations.
Add or modify a custom fault entity through a JSON file.
ascend-fd entity --update updated_entity.jsonThe following is an example of the command output, indicating that the operation is successful.
Updated entity successfully.The following is an example of a JSON file. This example cannot be used directly. You need to modify the information about the custom fault based on the actual situation. A JSON file can contain a maximum of 1,000 custom fault information entries. Any excess entries will not be saved to the system. For details about the parameters in the file, see Table 1.
{ "41001": { #Fault code. You need to customize the fault code based on the actual situation. It cannot be the same as the fault codes already supported by MindCluster Ascend FaultDiag. "attribute.class": "Software", "attribute.component": "AI Framework", "attribute.module": "Compiler", "attribute.cause_zh": "抽象类型合并失败", "attribute.description_zh": "对函数输出求梯度时,抽象类型不匹配,导致抽象类型合并失败。", "attribute.suggestion_zh": [ "1. 检查求梯度的函数的输出类型与sens_param的类型是否相同,如果不相同,修改为相同类型;", "2. 自动求导报错Type Join Failed" ], "attribute.cause_en": "Abstract type merge failed", "attribute.description_en": "When computing the gradient of a function output, the abstract types do not match, leading to a failure in abstract type merging.", "attribute.suggestion_en": [ "1. Check whether the output type of the gradient calculation function matches the type of sens_param. If they do not match, modify them to be of the same type.", "2. Automatic differentiation reports an error: Type Join Failed." ], "attribute.error_case": [ "grad = ops.GradOperation(sens_param=True)", "# The output type of test_net is tuple(Tensor, Tensor)", "def test_net(a, b):", " return a, b" ], "attribute.fixed_case": [ "grad = ops.GradOperation(sens_param=True)", "# The output type of test_net is tuple(Tensor, Tensor)", "def test_net(a, b):", " return a, b" ], "rule": [ { "dst_code": "20106" } ], "source_file": "TrainLog", "regex.in": [ "Abstract type", "cannot join with" ] }, "41002": { #Fault code. Users need to customize the fault code based on actual conditions. It must not be the same as the fault codes already supported by MindCluster Ascend FaultDiag. "attribute.class": "", "attribute.component": "", "attribute.module": "", "attribute.cause_zh": "", "attribute.description_zh": "", "attribute.suggestion_zh": "", "attribute.cause_en": "", "attribute.description_en": "", "attribute.suggestion_en": "", "attribute.error_case": "", "attribute.fixed_case": "", "rule": [ { "dst_code": "20107" } ], "source_file": "CANN_Plog", "regex.in": [ "tsd client wait response fail" ] } ... }In the JSON file example,
41001and41002are user-defined fault codes. The value length must be 1 to 50 characters. English letters, digits, English symbols, underscores (_), and hyphens (-) are supported. The fault code cannot be the same as the fault codes already supported by MindCluster Ascend FaultDiag.Table 1 Parameter description
View user-defined custom fault entity information. You can query fault information by fault code. If no fault code is specified, all custom fault entity information will be queried.
ascend-fd entity --show entity_code_1 entity_code_2(Optional) Delete the custom fault entity information corresponding to the specified fault code.
ascend-fd entity --delete entity_code_1 entity_code_2(Optional) Verify the
custom-ascend-kg-config.jsonfile. If you have directly modified the custom fault entity information in this file, you can run the following command to verify the integrity and availability of the modified file.Directly modifying the
custom-ascend-kg-config.jsonfile is not recommended, as it may cause the MindCluster Ascend FaultDiag component to malfunction.ascend-fd entity --check custom-ascend-kg-config.jsonThe following is an example of the output, indicating that the file verification is successful.
Custom entity verification passed.