已合并
【PR】: 更新资料中的链接 #4550
Sophia1213创建于 12 天前
【PR】: 更新资料中的链接 #4550
已合并
共 10 个文件变更+28-158
| @@ -2,15 +2,15 @@ | |||
| 2 | 2 | ||
| 3 | ## Documentation | 3 | ## Documentation |
| 4 | 4 | ||
| 5 | -- [Graph Development Guide](https://hiascend.com/document/redirect/CannCommunityGraphguide) | 5 | +- [Graph Development Guide](../zh/user_guides/graph_dev/README.md) |
| 6 | 6 | ||
| 7 | Designed for single-card graph compilation and execution, providing GE basic concepts, principles, and how to use GE graph engine interfaces for graph construction, compilation and execution. | 7 | Designed for single-card graph compilation and execution, providing GE basic concepts, principles, and how to use GE graph engine interfaces for graph construction, compilation and execution. |
| 8 | 8 | ||
| 9 | -- [DataFlow Development Guide](https://hiascend.com/document/redirect/CannCommunityDataflow) | 9 | +- [DataFlow Development Guide](../zh/user_guides/dflow/index.md) |
| 10 | 10 | ||
| 11 | Designed for heterogeneous and cluster graph compilation and execution, introducing how to build, modify, compile and execute computation graphs through DataFlow interfaces. | 11 | Designed for heterogeneous and cluster graph compilation and execution, introducing how to build, modify, compile and execute computation graphs through DataFlow interfaces. |
| 12 | 12 | ||
| 13 | -- [LLM DataDist Development Guide](https://hiascend.com/document/redirect/CannCommunityLLMDatadistdev) | 13 | +- [LLM DataDist Development Guide](../zh/user_guides/llm_datadist/index.md) |
| 14 | 14 | ||
| 15 | Designed for large models, introducing how to use LLM-DataDist interfaces to implement data transmission between clusters and build large model inference disaggregated frameworks. | 15 | Designed for large models, introducing how to use LLM-DataDist interfaces to implement data transmission between clusters and build large model inference disaggregated frameworks. |
| 16 | 16 | ||
| @@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | Introduces key technologies for Host scheduling optimization and how to improve heterogeneous system resource utilization through these technologies. | 37 | Introduces key technologies for Host scheduling optimization and how to improve heterogeneous system resource utilization through these technologies. |
| 38 | 38 | ||
| 39 | -- [Automatic Fusion](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/850alpha002/graph/graphguide/autofuse_1_0001.html) | 39 | +- [Automatic Fusion](../zh/user_guides/graph_dev/autofuse/README.md) |
| 40 | 40 | ||
| 41 | Introduces the implementation principles and enabling methods of automatic fusion, and how to shorten model E2E time through this technology. | 41 | Introduces the implementation principles and enabling methods of automatic fusion, and how to shorten model E2E time through this technology. |
| 42 | 42 | ||
| @@ -3,7 +3,7 @@ | |||
| 3 | ## Product Support Status | 3 | ## Product Support Status |
| 4 | 4 | ||
| 5 | | Product | Support Status | | 5 | | Product | Support Status | |
| 6 | -| | :----------- | :------: | | 6 | +| :----------- | :------: | |
| 7 | | Atlas A3 Training Series Products/Atlas A3 Inference Series Products | √ | | 7 | | Atlas A3 Training Series Products/Atlas A3 Inference Series Products | √ | |
| 8 | | Atlas A2 Training Series Products/Atlas A2 Inference Series Products | √ | | 8 | | Atlas A2 Training Series Products/Atlas A2 Inference Series Products | √ | |
| 9 | 9 | ||
| @@ -20,7 +20,7 @@ Shape class inherits from Python built-in `list`, used to represent tensor shape | |||
| 20 | Shape module also defines the following constants: | 20 | Shape module also defines the following constants: |
| 21 | 21 | ||
| 22 | | Constant Name | Value | Description | | 22 | | Constant Name | Value | Description | |
| 23 | -| | :----- | :--- | :--- | | 23 | +| :----- | :--- | :--- | |
| 24 | | UNKNOWN_DIM | -1 | Represents unknown dimension | | 24 | | UNKNOWN_DIM | -1 | Represents unknown dimension | |
| 25 | | UNKNOWN_DIM_NUM | -2 | Represents unknown dimension count | | 25 | | UNKNOWN_DIM_NUM | -2 | Represents unknown dimension count | |
| 26 | | UNKNOWN_DIM_SIZE | -1 | Return value of get_shape_size() when shape is unknown | | 26 | | UNKNOWN_DIM_SIZE | -1 | Return value of get_shape_size() when shape is unknown | |
| @@ -35,7 +35,7 @@ class Shape(list): | |||
| 35 | ## Function List | 35 | ## Function List |
| 36 | 36 | ||
| 37 | | Function | Functionality Description | | 37 | | Function | Functionality Description | |
| 38 | -| | :--- | :--- | | 38 | +| :--- | :--- | |
| 39 | | \_\_init\_\_(dims=None) | Constructor, creates Shape object. dims is integer list, None represents scalar (empty list) | | 39 | | \_\_init\_\_(dims=None) | Constructor, creates Shape object. dims is integer list, None represents scalar (empty list) | |
| 40 | | get_shape_size() | Calculates product of all dimensions in shape, i.e., total element count of tensor | | 40 | | get_shape_size() | Calculates product of all dimensions in shape, i.e., total element count of tensor | |
| 41 | | is_unknown_shape() | Judges if shape contains unknown dimensions | | 41 | | is_unknown_shape() | Judges if shape contains unknown dimensions | |
| @@ -45,13 +45,13 @@ class Shape(list): | |||
| 45 | ### \_\_init\_\_ Parameter | 45 | ### \_\_init\_\_ Parameter |
| 46 | 46 | ||
| 47 | | Parameter | Type | Required | Description | | 47 | | Parameter | Type | Required | Description | |
| 48 | -| | :----- | :--- | :------: | :--- | | 48 | +| :----- | :--- | :------: | :--- | |
| 49 | | dims | List[int] | No | Dimension value list, e.g., [1, 3, 224, 224]. None represents scalar (empty list). Default value is None | | 49 | | dims | List[int] | No | Dimension value list, e.g., [1, 3, 224, 224]. None represents scalar (empty list). Default value is None | |
| 50 | 50 | ||
| 51 | ## Return Value Description | 51 | ## Return Value Description |
| 52 | 52 | ||
| 53 | | Function | Return Type | Description | | 53 | | Function | Return Type | Description | |
| 54 | -| | :--- | :--- | :--- | | 54 | +| :--- | :--- | :--- | |
| 55 | | get_shape_size() | int | Product of all dimensions. Returns 0 when shape is empty (scalar); returns -1 when shape contains unknown dimension (UNKNOWN_DIM or UNKNOWN_DIM_NUM) | | 55 | | get_shape_size() | int | Product of all dimensions. Returns 0 when shape is empty (scalar); returns -1 when shape contains unknown dimension (UNKNOWN_DIM or UNKNOWN_DIM_NUM) | |
| 56 | | is_unknown_shape() | bool | Returns True if shape contains UNKNOWN_DIM (-1) or UNKNOWN_DIM_NUM (-2); otherwise returns False | | 56 | | is_unknown_shape() | bool | Returns True if shape contains UNKNOWN_DIM (-1) or UNKNOWN_DIM_NUM (-2); otherwise returns False | |
| 57 | 57 | ||
| @@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | 介绍Host调度优化的关键技术,以及如何通过这些技术提升异构系统资源的利用率。 | 37 | 介绍Host调度优化的关键技术,以及如何通过这些技术提升异构系统资源的利用率。 |
| 38 | 38 | ||
| 39 | -- [自动融合](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/850alpha002/graph/graphguide/autofuse_1_0001.html) | 39 | +- [自动融合](./user_guides/graph_dev/autofuse/README.md) |
| 40 | 40 | ||
| 41 | 介绍自动融合的实现原理和使能方式,以及通过该技术,如何缩短模型E2E时间。 | 41 | 介绍自动融合的实现原理和使能方式,以及通过该技术,如何缩短模型E2E时间。 |
| 42 | 42 | ||
| @@ -18,7 +18,7 @@ build_initialize(global_options: Optional[dict] = None) -> None | |||
| 18 | 18 | ||
| 19 | | 参数名 | 输入/输出 | 描述 | | 19 | | 参数名 | 输入/输出 | 描述 | |
| 20 | | --- | --- | --- | | 20 | | --- | --- | --- | |
| 21 | -| global_options | 输入 | 全局配置参数。<br>配置参数dict映射表,key为参数类型,value为参数值,均为字符串格式,用于描述离线模型编译初始化信息。<br>dict中支持的配置参数请参见[aclgrphBuildInitialize支持的配置参数](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/900beta2/API/ascendgraphapi/atlasgeapi_07_0142.html),key为C++常量对应的字符串值。 | | 21 | +| global_options | 输入 | 全局配置参数。<br>配置参数dict映射表,key为参数类型,value为参数值,均为字符串格式,用于描述离线模型编译初始化信息。<br>dict中支持的配置参数请参见[aclgrphBuildInitialize支持的配置参数](../../../cpp/ge/aclgrphBuildInitialize_config_params/aclgrphbuildinitialize_config_params.md),key为C++常量对应的字符串值。 | |
| 22 | 22 | ||
| 23 | ## 返回值说明 | 23 | ## 返回值说明 |
| 24 | 24 | ||
| @@ -18,7 +18,7 @@ bundle_build_model(graph_with_options: List[GraphWithOptions]) -> ModelBuffer | |||
| 18 | 18 | ||
| 19 | | 参数名 | 输入/输出 | 描述 | | 19 | | 参数名 | 输入/输出 | 描述 | |
| 20 | | --- | --- | --- | | 20 | | --- | --- | --- | |
| 21 | -| graph_with_options | 输入 | 待编译的一组图和编译参数。该入参为一个结构体,包括如下参数:<br>class GraphWithOptions:<br> graph: Graph<br> build_options: Dict[str, str] = field(default_factory=dict)<br>一组图包括:权重初始化图,权重更新图,推理图,其中只有推理图支持设置如下options参数。<br>可以通过传入options参数配置离线模型编译配置信息,当前支持的配置参数请参见[aclgrphBuildModel支持的配置参数](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/900beta2/API/ascendgraphapi/atlasgeapi_07_0143.html),key为C++常量对应的字符串值。 | | 21 | +| graph_with_options | 输入 | 待编译的一组图和编译参数。该入参为一个结构体,包括如下参数:<br>class GraphWithOptions:<br> graph: Graph<br> build_options: Dict[str, str] = field(default_factory=dict)<br>一组图包括:权重初始化图,权重更新图,推理图,其中只有推理图支持设置如下options参数。<br>可以通过传入options参数配置离线模型编译配置信息,当前支持的配置参数请参见[aclgrphBuildModel支持的配置参数](../../../cpp/ge/aclgrphBuildModel_config_params/aclgrphbuildmodel_config_params.md),key为C++常量对应的字符串值。 | |
| 22 | 22 | ||
| 23 | ## 返回值说明 | 23 | ## 返回值说明 |
| 24 | 24 | ||
| @@ -30,4 +30,4 @@ bundle_save_model(output_file: str, model: ModelBuffer) -> None | |||
| 30 | - 如果output\_file不是字符串,抛出TypeError。 | 30 | - 如果output\_file不是字符串,抛出TypeError。 |
| 31 | - 如果model不是ModelBuffer类型,抛出TypeError。 | 31 | - 如果model不是ModelBuffer类型,抛出TypeError。 |
| 32 | - 如果保存失败,抛出RuntimeError。 | 32 | - 如果保存失败,抛出RuntimeError。 |
| 33 | -- 若生成的om模型文件名中含操作系统及架构,但操作系统及其架构与模型运行环境不一致时,需要与OPTION\_HOST\_ENV\_OS、OPTION\_HOST\_ENV\_CPU参数配合使用,设置模型运行环境的操作系统类型及架构。参数具体介绍请参见[aclgrphBuildInitialize支持的配置参数](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/900beta2/API/ascendgraphapi/atlasgeapi_07_0142.html)。 | 33 | +- 若生成的om模型文件名中含操作系统及架构,但操作系统及其架构与模型运行环境不一致时,需要与OPTION\_HOST\_ENV\_OS、OPTION\_HOST\_ENV\_CPU参数配合使用,设置模型运行环境的操作系统类型及架构。参数具体介绍请参见[aclgrphBuildInitialize支持的配置参数](../../../cpp/ge/aclgrphBuildInitialize_config_params/aclgrphbuildinitialize_config_params.md)。 |
| @@ -30,4 +30,4 @@ save_model(output_file: str, model: ModelBuffer) -> None | |||
| 30 | - 如果output\_file不是字符串,抛出TypeError。 | 30 | - 如果output\_file不是字符串,抛出TypeError。 |
| 31 | - 如果model不是ModelBuffer类型,抛出TypeError。 | 31 | - 如果model不是ModelBuffer类型,抛出TypeError。 |
| 32 | - 如果保存失败,抛出RuntimeError。 | 32 | - 如果保存失败,抛出RuntimeError。 |
| 33 | -- 若生成的om模型文件名中含操作系统及架构,但操作系统及其架构与模型运行环境不一致时,需要与OPTION\_HOST\_ENV\_OS、OPTION\_HOST\_ENV\_CPU参数配合使用,设置模型运行环境的操作系统类型及架构。参数具体介绍请参见[aclgrphBuildInitialize支持的配置参数](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/900beta2/API/ascendgraphapi/atlasgeapi_07_0142.html)。 | 33 | +- 若生成的om模型文件名中含操作系统及架构,但操作系统及其架构与模型运行环境不一致时,需要与OPTION\_HOST\_ENV\_OS、OPTION\_HOST\_ENV\_CPU参数配合使用,设置模型运行环境的操作系统类型及架构。参数具体介绍请参见[aclgrphBuildInitialize支持的配置参数](../../../cpp/ge/aclgrphBuildInitialize_config_params/aclgrphbuildinitialize_config_params.md)。 |
| @@ -14,7 +14,7 @@ | |||
| 14 | | AscendString类 | ascend_string.h | 对String类型的封装。 | libflow_func.so | | 14 | | AscendString类 | ascend_string.h | 对String类型的封装。 | libflow_func.so | |
| 15 | | MetaContext类 | meta_context.h | 用于UDF上下文信息相关处理,如申请tensor和获取设置的属性等操作。 | libflow_func.so | | 15 | | MetaContext类 | meta_context.h | 用于UDF上下文信息相关处理,如申请tensor和获取设置的属性等操作。 | libflow_func.so | |
| 16 | | FlowMsg类 | flow_msg.h | 用于处理flow func输入输出的相关操作。 | libflow_func.so | | 16 | | FlowMsg类 | flow_msg.h | 用于处理flow func输入输出的相关操作。 | libflow_func.so | |
| 17 | -| Tensor类 | flow_msg.h | 用于执行Tensor的相关操作。 | | 17 | +| Tensor类 | flow_msg.h | 用于执行Tensor的相关操作。 | - | |
| 18 | | MetaFlowFunc类 | meta_flow_func.h | 该类在meta_flow_func.h中定义,用户继承该类进行自定义的单func处理函数的编写。 | libflow_func.so | | 18 | | MetaFlowFunc类 | meta_flow_func.h | 该类在meta_flow_func.h中定义,用户继承该类进行自定义的单func处理函数的编写。 | libflow_func.so | |
| 19 | | MetaMultiFunc类 | meta_multi_func.h | 该类在meta_multi_func.h中定义,用户继承该类进行自定义的多func处理函数的编写。 | libflow_func.so | | 19 | | MetaMultiFunc类 | meta_multi_func.h | 该类在meta_multi_func.h中定义,用户继承该类进行自定义的多func处理函数的编写。 | libflow_func.so | |
| 20 | | FlowFuncRegistrar类 | meta_multi_func.h | 该类在meta_multi_func.h中定义,是注册MetaMultiFunc的辅助模板类。 | libflow_func.so | | 20 | | FlowFuncRegistrar类 | meta_multi_func.h | 该类在meta_multi_func.h中定义,是注册MetaMultiFunc的辅助模板类。 | libflow_func.so | |
| @@ -36,137 +36,7 @@ DUMP\_GRAPH\_LEVEL环境变量只有在[DUMP\_GE\_GRAPH](DUMP_GE_GRAPH.md)开启 | |||
| 36 | 36 | ||
| 37 | - 如果此环境变量设置了其他非法值,可能会导致未定义的行为发生。 | 37 | - 如果此环境变量设置了其他非法值,可能会导致未定义的行为发生。 |
| 38 | - 如果开启了采集算子dump数据功能,可以参考[ge.exec.enableDump](../../api/graph_engine_api/cpp/ge/options_params/precision_comparison.md#geexecenabledump)参数,即使不配置DUMP\_GRAPH\_LEVEL环境变量,或者配置export DUMP\_GRAPH\_LEVEL="PreRunBegin|AfterInfershape"但不包括“Build”字符串,最终都会dump子图ge\_proto\_xxxx\_Build.txt。 | 38 | - 如果开启了采集算子dump数据功能,可以参考[ge.exec.enableDump](../../api/graph_engine_api/cpp/ge/options_params/precision_comparison.md#geexecenabledump)参数,即使不配置DUMP\_GRAPH\_LEVEL环境变量,或者配置export DUMP\_GRAPH\_LEVEL="PreRunBegin|AfterInfershape"但不包括“Build”字符串,最终都会dump子图ge\_proto\_xxxx\_Build.txt。 |
| 39 | -- 此环境变量需要配合[DUMP\_GE\_GRAPH](DUMP_GE_GRAPH.md)使用,即开启[DUMP\_GE\_GRAPH](DUMP_GE_GRAPH.md)的场景下,可通过DUMP\_GRAPH\_LEVEL控制生成的dump图信息。全量dump图信息请参见[表1](#table1)。 | 39 | +- 此环境变量需要配合[DUMP\_GE\_GRAPH](DUMP_GE_GRAPH.md)使用,即开启[DUMP\_GE\_GRAPH](DUMP_GE_GRAPH.md)的场景下,可通过DUMP\_GRAPH\_LEVEL控制生成的dump图信息。详情请参见[dump图详细信息](../atc_tools/references/dump_graph_details.md)。 |
| 40 | - | ||
| 41 | -**表 1** dump图详细信息说明<a id="table1"></a> | ||
| 42 | - | ||
| 43 | -| 序号 | 子图名称 | 涉及组件 | 所处阶段描述 | 是否白名单 | | ||
| 44 | -| --- | --- | --- | --- | --- | | ||
| 45 | -| 1 | ge_proto_xxxx_GraphPreRunBegin.txt | GE | Graph编译前的图 | - | | ||
| 46 | -| 2 | ge_proto_xxxx_AfterFlowGraphPartition.txt | GE | Flow切分后的图(flow切分是应用于DataFlow中的切分方式) | - | | ||
| 47 | -| 3 | ge_proto_xxxx_AfterParallelPartitioner.txt | GE | pipeline并行切分后的图(这里的pipeline指后端推理场景的PP) | - | | ||
| 48 | -| 4 | ge_proto_xxxx_PreRunBegin.txt | GE | 原始图结构 | 白名单 | | ||
| 49 | -| 5 | ge_proto_xxxx_RunCustomPassBeforeInfershape.txt | GE | 在InferShape之前用户自定义Pass的出口图 | 白名单 | | ||
| 50 | -| 6 | ge_proto_xxxx_PreRunAfterInitPreparation.txt | FE | 经历了图准备阶段所有初始化处理之后的图结构 | - | | ||
| 51 | -| 7 | ge_proto_xxxx_PreRunAfterHandleSummaryOp.txt | GE | 对Summary节点做处理之后的图结构 | - | | ||
| 52 | -| 8 | ge_proto_xxxx_PrepareAfterCheckAndUpdateInput.txt | GE | 校验并更新图输入数据处理之后的图结构 | - | | ||
| 53 | -| 9 | ge_proto_xxxx_PrepareAfterGraphEquivalentTransformation.txt | GE | 将For循环图结构同等替换成While循环图结构处理之后的图结构 | - | | ||
| 54 | -| 10 | ge_proto_xxxx_PrepareAfterProcessOutput.txt | GE | 对图数据进行相关处理之后的图结构 | - | | ||
| 55 | -| 11 | ge_proto_xxxx_PrepareAfterOptimizeAfterGraphNormalization.txt | GE | 图标准化后图优化操作出口图 | - | | ||
| 56 | -| 12 | ge_proto_xxxx_PrepareAfterInsertAipp.txt | GE | 在配置了AIPP参数下,对图进行AIPP相关处理之后的图结构 | - | | ||
| 57 | -| 13 | ge_proto_xxxx_PrepareAfterProcessAippNodesDataFormat.txt | GE | AIPP节点格式刷新出口图 | - | | ||
| 58 | -| 14 | ge_proto_xxxx_PreRunAfterNormalizeGraph.txt | GE | 图标准化出口图 | 白名单 | | ||
| 59 | -| 15 | ge_proto_xxxx_PreRunAfterOptimizeGraphInit.txt | GE | 图优化初始化出口图 | - | | ||
| 60 | -| 16 | ge_proto_xxxx_OptimizeGraph_TagNoConstFoldingAfter.txt | FE | 量化场景使用,FE会给算子打上不做常量折叠标签,GE在执行常量折叠时会判断此标签,如果存在,则不执行常量折叠 | - | | ||
| 61 | -| 17 | ge_proto_xxxx_HcclAfterOptimizeGraphPrepare.txt | HCCL | HCCL图准备阶段优化后的图 | - | | ||
| 62 | -| 18 | ge_proto_xxxx_PreRunAfterOptimizeGraphPrepare.txt | GE | 经过各算子信息库原图准备处理(OptimizeGraphPrepare接口调用)之后的图结构 | - | | ||
| 63 | -| 19 | ge_proto_xxxx_PrepareAfterProcessBeforeInfershape.txt | GE | 对条件算子进行死边消除处理之后的图结构 | - | | ||
| 64 | -| 20 | ge_proto_xxxx_AfterFirstInferformat.txt | GE | 经过全图inferformat处理之后的图结构 | - | | ||
| 65 | -| 21 | ge_proto_xxxx_AfterInfershape.txt | GE | 经过全图infershape处理之后的图结构,会伴随常量折叠 | 白名单 | | ||
| 66 | -| 22 | ge_proto_xxxx_PrepareAfterInferFormatAndShape.txt | GE | 经历完所有InferFormat与InferShape处理之后的图结构,与上图间经历了第二次全图InferFormat | - | | ||
| 67 | -| 23 | ge_proto_xxxx_RunCustomPass_AfterInferShape.txt | GE | 在InferShape之后用户自定义Pass的出口图 | 白名单 | | ||
| 68 | -| 24 | ge_proto_xxxx_AfterSecondInferformat.txt | GE | 第二次格式推导之后的图 | - | | ||
| 69 | -| 25 | ge_proto_xxxx_PrepareAfterCtrlFlowPreProcess.txt | GE | 对条件算子做预处理之后的图结构 | - | | ||
| 70 | -| 26 | ge_proto_xxxx_PrepareAfterGetDynamicOutputShape.txt | GE | 动态档位下,对图输出做处理之后的图结构 | - | | ||
| 71 | -| 27 | ge_proto_xxxx_PrepareAfterProcessAippStage2.txt | GE | 在AIPP模式下,对图输入节点做相关处理之后的图结构 | - | | ||
| 72 | -| 28 | ge_proto_xxxx_PrepareAfterPrepareOptimize.txt | GE | 在图准备阶段,做相关优化处理之后的图结构 | - | | ||
| 73 | -| 29 | ge_proto_xxxx_PreRunAfterPrepare.txt | GE | 目前和上张图相同,经历过所有图准备处理之后的图结构 | 白名单 | | ||
| 74 | -| 30 | ge_proto_xxxx_OptimizeQuantGraph_FeGraphFusionAfter.txt | FE | 图优化阶段的量化流程结束后的图结构 | - | | ||
| 75 | -| 31 | ge_proto_xxxx_OptimizeOriginalGraph_FeGraphFusionAfter.txt | FE | 图融合流程结束后的图结构 | - | | ||
| 76 | -| 32 | ge_proto_xxxx_OptimizeOriginalGraph_FeTopoSortingAfter.txt | FE | 图融合后进行拓扑排序,排查融合后是否成环的图结构 | - | | ||
| 77 | -| 33 | ge_proto_xxxx_OptimizeOriginalGraph_DSAFeOpJudgeAfter.txt | FE | 经过动态shape分析后的格式DataType和Format选择的图 | - | | ||
| 78 | -| 34 | ge_proto_xxxx_HcclBeforeOptimizeOriginalGraph.txt | HCCL | HCCL原图优化之前的图 | - | | ||
| 79 | -| 35 | ge_proto_xxxx_HcclAfterOptimizeOriginalGraph.txt | HCCL | HCCL原图优化之后的图 | - | | ||
| 80 | -| 36 | ge_proto_xxxx_RunCustomPassAfterBuiltinFusionPass.txt | GE | 内部Pass之后用户自定义Pass的出口图 | 白名单 | | ||
| 81 | -| 37 | ge_proto_xxxx_PreRunAfterOptimizeOriginalGraph.txt | GE | 经过各算子信息库原图优化处理(OptimizeOriginalGraph接口调用)之后的图结构 | 白名单 | | ||
| 82 | -| 38 | ge_proto_xxxx_PrepareAfterUpdateInputOutputByUserOptions.txt | GE | 根据用户参数,对图输入输出做相关处理之后的图结构 | - | | ||
| 83 | -| 39 | ge_proto_xxxx_PrepareAfterUpdateVariableFormats.txt | GE | 对变量的Format进行相关处理之后的图结构 | - | | ||
| 84 | -| 40 | ge_proto_xxxx_PreRunAfterPrepareRunningFormatRefiner.txt | GE | 与上图相同 | - | | ||
| 85 | -| 41 | ge_proto_xxxx_BeforeOptimizeOriginalGraphJudgeInsert.txt | FE | op_judge流程的入口图 | - | | ||
| 86 | -| 42 | ge_proto_xxxx_OptimizeOriginalGraph_FeOpDtypeJudgeAfter.txt | FE | 精度模式选择后的图 | - | | ||
| 87 | -| 43 | ge_proto_xxxx_PreRunAfterRefineRunningPrecision.txt | GE | 精度选择之后的图 | - | | ||
| 88 | -| 44 | ge_proto_xxxx_AfterPrecisionRefine.txt | GE | 精度选择之后经过转换算子融合生成的图 | - | | ||
| 89 | -| 45 | ge_proto_xxxx_PreRunAfterAfterPrecisionRefine.txt | GE | 精度选择之后经过转换算子融合,再经过自动融合生成的图<br>如果未开启自动融合功能,该子图的内容会和<br>ge_proto_xxxx_AfterPrecisionRefine.txt子图内容一致 | - | | ||
| 90 | -| 46 | ge_proto_xxxx_OptimizeOriginalGraph_FeOpFormatJudgeAfter.txt | FE | 格式选择后完整op_judge的图 | - | | ||
| 91 | -| 47 | ge_proto_xxxx_OptimizeOriginalGraph_FeDistHeavyFormatAfter.txt | FE | 重型算子扩散后的图结构 | - | | ||
| 92 | -| 48 | ge_proto_xxxx_OptimizeOriginalGraph_FeInsertTransNodeAfter.txt | FE | 插入转换算子后的图结构 | - | | ||
| 93 | -| 49 | ge_proto_xxxx_PreRunAfterRefineRunningFormat.txt | GE | 经过各算子信息库优化处理(OptimizeOriginalGraphJudgeInsert接口调用)之后的图结构 | - | | ||
| 94 | -| 50 | ge_proto_xxxx_PreRunAfterSubexpressionMigration.txt | GE | 动态分档场景下公共子表达式提取之后的图结构 | - | | ||
| 95 | -| 51 | ge_proto_xxxx_before_SameTransdataBreadthFusionPass.txt | GE | SameTransdataBreadthFusionPass入口图 | - | | ||
| 96 | -| 52 | ge_proto_xxxx_after_SameTransdataBreadthFusionPass.txt | GE | SameTransdataBreadthFusionPass出口图 | - | | ||
| 97 | -| 53 | ge_proto_xxxx_OptimizeStage1_1.txt | GE | 图优化1_1阶段处理之后的图结构 | - | | ||
| 98 | -| 54 | ge_proto_xxxx_OptimizeStage1_2.txt | GE | 图优化1_2阶段处理之后的图结构 | - | | ||
| 99 | -| 55 | ge_proto_xxxx_PreRunAfterOptimize1.txt | GE | 所有图优化1阶段处理之后的图结构 | - | | ||
| 100 | -| 56 | ge_proto_xxxx_PreRunAfterOptimizeAfterStage1.txt | GE | 经过各算子信息库优化处理(OptimizeAfterStage1接口调用)之后的图结构 | 白名单 | | ||
| 101 | -| 57 | ge_proto_xxxx_RunCustomPassAfterOriginGraphOptimize.txt | GE | 在原图优化阶段后执行自定义pass | 白名单 | | ||
| 102 | -| 58 | ge_proto_xxxx_PreRunAfterInferShape2.txt | GE | 第二次InferShape处理之后的图结构 | - | | ||
| 103 | -| 59 | ge_proto_xxxx_BeforeStagePartition.txt | GE | Stage切分前的图 | - | | ||
| 104 | -| 60 | ge_proto_xxxx_AfterStagePartition.txt | GE | Stage切分后的图 | - | | ||
| 105 | -| 61 | ge_proto_xxxx_AfterEnginePlacer.txt | GE | 引擎选择完成后的图 | - | | ||
| 106 | -| 62 | ge_proto_xxxx_Before_DSP.txt | GE | 动静模型拆分前的图 | - | | ||
| 107 | -| 63 | ge_proto_xxxx_After_DSP.txt | GE | 动静模型拆分后的图 | - | | ||
| 108 | -| 64 | ge_proto_xxxx_AfterDynamicShapePartition.txt | GE | 动态shape图拆分之后的图结构 | - | | ||
| 109 | -| 65 | ge_proto_xxxx_MergedComputeGraphAfterCompositeEnginePartition.txt | GE | 经历对立子图拆分与子图优化处理之后的合并图结构 | - | | ||
| 110 | -| 66 | ge_proto_xxxx_partition0_rank0_inputNodeGraph_AtomicEnginePartitioning.txt | GE | 原子引擎规则图拆分后,输入节点子图的图结构 | - | | ||
| 111 | -| 67 | ge_proto_xxxx_partition0_rank1_new_sub_graph1_AtomicEnginePartitioning.txt | GE | 原子引擎规则图拆分后,子图1的图结构 | - | | ||
| 112 | -| 68 | ge_proto_xxxx_partition0_rank2_new_sub_graph110_AtomicEnginePartitioning.txt | GE | 原子引擎规则图拆分后,子图110的图结构 | - | | ||
| 113 | -| 69 | ge_proto_xxxx_OptimizeSubgraphPreProc.txt | GE | 子图优化预处理出口图 | - | | ||
| 114 | -| 70 | ge_proto_xxxx_DNN_VM_RTS_OptimizeSubGraphBefore.txt | RTS | - | - | | ||
| 115 | -| 71 | ge_proto_xxxx_DNN_VM_RTS_OptimizeSubGraphAfter.txt | RTS | - | - | | ||
| 116 | -| 72 | ge_proto_xxxx_AIcoreEngine_OptimizeSubGraphBefore.txt | FE | AI Core子图优化入口图 | - | | ||
| 117 | -| 73 | ge_proto_xxxx_OptimizeSubGraphBefore.txt | GE | 子图优化操作前的子图结构,每张子图都有一份,同名不同序号,总个数根据子图个数确定 | - | | ||
| 118 | -| 74 | ge_proto_xxxx_OptimizeSubGraphAfter.txt | GE | 子图优化操作后的子图结构,每张子图都有一份,同名不同序号,总个数根据子图个数确定 | - | | ||
| 119 | -| 75 | ge_proto_xxxx_partition0_rank1_new_sub_graph1_lxfusion_input.txt | AOE(lxfusion) | ATC场景和AOE baseline场景的sgat输入图 | - | | ||
| 120 | -| 76 | ge_proto_xxxx_partition0_rank1_new_sub_graph1_after_rebuild.txt | AOE(lxfusion) | AOE sgat内部流程UB融合图 | - | | ||
| 121 | -| 77 | ge_proto_xxxx_AIcoreEngine_OptimizeSubGraphAfter.txt | FE | AI Core子图优化出口图 | - | | ||
| 122 | -| 78 | ge_proto_xxxx_OptimizeSubgraphPostProc.txt | GE | 子图优化后处理出口图 | - | | ||
| 123 | -| 79 | ge_proto_xxxx_mergedComputeGraph.txt | GE | 图合并之后的图结构,与上图相同 | - | | ||
| 124 | -| 80 | ge_proto_xxxx_MergedComputeGraphAfterAtomicEnginePartition.txt | GE | 经历对立原子引擎拆分与子图优化处理之后的合并图结构 | - | | ||
| 125 | -| 81 | ge_proto_xxxx_PreRunAfterOptimizeSubgraph.txt | GE | 子图优化处理之后的图结构 | 白名单 | | ||
| 126 | -| 82 | ge_proto_xxxx_OptimizeWholeGraphaicpu_tf_optimizer.txt | GE | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 127 | -| 83 | ge_proto_xxxx_OptimizeWholeGraphaicpu_ascend_optimizer.txt | GE | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 128 | -| 84 | ge_proto_xxxx_OptimizeWholeGraphdvpp_graph_optimizer.txt | GE | 整图优化DVPP优化后出口图 | - | | ||
| 129 | -| 85 | ge_proto_xxxx_OptimizeWholeGraphhccl_alltoallvc_fusion_optimizer.txt | HCCL | HCCL原图优化阶段融合优化后的图 | - | | ||
| 130 | -| 86 | ge_proto_xxxx_OptimizeWholeGraphAIcoreEngine.txt | GE | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 131 | -| 87 | ge_proto_xxxx_OptimizeWholeGraphDSAEngine.txt | FE | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 132 | -| 88 | ge_proto_xxxx_OptimizeWholeGraphhccl_graph_optimizer.txt | HCCL | HCCL原图优化阶段优化的图 | - | | ||
| 133 | -| 89 | ge_proto_xxxx_OptimizeWholeGraphDNN_VM_RTS_GRAPH_OPTIMIZER_STORE.txt | GE | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 134 | -| 90 | ge_proto_xxxx_OptimizeWholeGraphDNN_VM_RTS_FFTS_PLUS_GRAPH_OPTIMIZER_STORE.txt | RTS | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 135 | -| 91 | ge_proto_xxxx_OptimizeWholeGraphDNN_VM_HOST_CPU_OPTIMIZER.txt | GE | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 136 | -| 92 | ge_proto_xxxx_OptimizeWholeGraphge_local_graph_optimizer.txt | GE | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 137 | -| 93 | ge_proto_xxxx_OptimizeWholeGraphffts_plus.txt | FE | 调用各引擎的原图优化接口后的图信息,OptimizeWholeGraph后为引擎名称 | - | | ||
| 138 | -| 94 | ge_proto_xxxx_PreRunAfterOptimizeWholeGraph.txt | GE | 经过各算子信息库优化处理(OptimizeWholeGraph接口调用)之后的图结构 | - | | ||
| 139 | -| 95 | ge_proto_xxxx_PreRunAfterOptimize2.txt | GE | 所有图优化2阶段处理之后的图结构 | - | | ||
| 140 | -| 96 | ge_proto_xxxx_PreRunAfterOptimizeGraphBeforeBuild.txt | GE | 模型编译入口图 | 白名单 | | ||
| 141 | -| 97 | ge_proto_xxxx_PreRunAfterOptimizeTensorMove.txt | GE | 优化冗余TensorMove节点之后的图 | - | | ||
| 142 | -| 98 | ge_proto_xxxx_BeforeHandleMemConflict.txt | GE | 处理内存冲突之前的图 | - | | ||
| 143 | -| 99 | ge_proto_xxxx_AfterHandleMemConflict.txt | GE | 处理内存冲突之后的图 | - | | ||
| 144 | -| 100 | ge_proto_xxxx_BeforeHandleMemoryLayoutConflict.txt | GE | 解决内存排布冲突入口图 | - | | ||
| 145 | -| 101 | ge_proto_xxxx_PreRunAfterMemConflictProc.txt | GE | 解决内存读写冲突出口图 | - | | ||
| 146 | -| 102 | ge_proto_xxxx_partition0_rank0_inputNodeGraph_SecondPartitioning.txt | GE | 二拆操作后,输入节点子图的图结构 | - | | ||
| 147 | -| 103 | ge_proto_xxxx_partition0_rank1_new_sub_graph1_SecondPartitioning.txt | GE | 二拆操作后,子图1的图结构 | - | | ||
| 148 | -| 104 | ge_proto_xxxx_partition0_rank2_new_sub_graph110_SecondPartitioning.txt | GE | 二拆操作后,子图110的图结构 | - | | ||
| 149 | -| 105 | ge_proto_xxxx_BeforeUnfoldSubgraphs.txt | GE | 动态shape图展开之前的图 | - | | ||
| 150 | -| 106 | ge_proto_xxxx_AfterUnfoldSubgraphs.txt | GE | 动态shape图展开之后的图 | - | | ||
| 151 | -| 107 | ge_proto_xxxx_RunCustomPass_BeforeAssignLogicStream{pass_name}.txt | GE | 用户自定义流分配Pass处理之前的图 | 白名单 | | ||
| 152 | -| 108 | ge_proto_xxxx_RunCustomPass_AfterAssignLogicStream{pass_name}.txt | GE | 用户自定义流分配Pass处理之后的图 | 白名单 | | ||
| 153 | -| 109 | ge_proto_xxxx_AfterAssignLogicalStreams.txt | GE | 完成逻辑流分配后的图 | - | | ||
| 154 | -| 110 | ge_proto_xxxx_AfterAssignResource.txt | GE | 流分配、内存分配、GenTask之后的图 | - | | ||
| 155 | -| 111 | ge_proto_xxxx_Build.txt | GE | 模型编译出口图 | 白名单 | | ||
| 156 | -| 112 | ge_proto_xxxx_PreRunAfterBuild.txt | GE | 与上图相同 | - | | ||
| 157 | -| 113 | ge_proto_xxxx_BeforeAttrsCompress.txt | GE | 离线模型压缩前的图 | - | | ||
| 158 | -| 114 | ge_proto_xxxx_AfterAttrsCompress.txt | GE | 离线模型压缩后的图 | - | | ||
| 159 | -| 115 | ge_proto_xxxx_BeforeAttrsDecompress.txt | GE | 离线模型解压前的图 | - | | ||
| 160 | -| 116 | ge_proto_xxxx_AfterAttrsDecompress.txt | GE | 离线模型解压后的图 | - | | ||
| 161 | -| 117 | ge_proto_xxxx_ComputeGraphBeforeLowering.txt | GE | lowering前的计算图 | 白名单 | | ||
| 162 | -| 118 | ge_proto_xxxx_Before_MultiStream_LoweringFirstLastEventSync.txt | GE | 多流插入Event之前的执行图 | - | | ||
| 163 | -| 119 | ge_proto_xxxx_ExeGraphBeforeOptimize.txt | GE | 执行图优化前的执行图 | 白名单 | | ||
| 164 | -| 120 | ge_proto_xxxx_AfterZeroCopy.txt | GE | 零拷贝优化之后的执行图 | - | | ||
| 165 | -| 121 | ge_proto_xxxx_AfterCEM.txt | GE | CEM优化之后的执行图 | - | | ||
| 166 | -| 122 | ge_proto_xxxx_AfterCopyFlowLaunch.txt | GE | 随路拷贝优化后的执行图 | - | | ||
| 167 | -| 123 | ge_proto_xxxx_TrustOutTensorAfter.txt | GE | TrustOutTensor优化之后的执行图 | - | | ||
| 168 | -| 124 | ge_proto_xxxx_AfterAicpuFuseHostInputs.txt | GE | AicpuFuseHostInputs优化之后的图 | - | | ||
| 169 | -| 125 | ge_proto_xxxx_ExecuteGraphAfterSplit.txt | GE | 动态shape最终的执行图 | 白名单 | | ||
| 170 | 40 | ||
| 171 | ## 产品支持情况 | 41 | ## 产品支持情况 |
| 172 | 42 | ||
| @@ -15,7 +15,7 @@ from ge.graph import Shape | |||
| 15 | 15 | ||
| 16 | ## 功能说明 | 16 | ## 功能说明 |
| 17 | 17 | ||
| 18 | -Shape 类继承自 Python 内置的 `list`,用于表示张量的形状维度信息。除了具备标准列表的所有操作能力外,还提供了计算形状总元素数和判断是否为未知形状的便捷方法。当 dims 为 None 时表示标量(空列表)。 | 18 | +Shape类继承自Python内置的`list`,用于表示张量的形状维度信息。除了具备标准列表的所有操作能力外,还提供了计算形状总元素数和判断是否为未知形状的便捷方法。当dims为None时表示标量(空列表)。 |
| 19 | 19 | ||
| 20 | Shape 模块同时定义了以下常量: | 20 | Shape 模块同时定义了以下常量: |
| 21 | 21 | ||
| @@ -23,7 +23,7 @@ Shape 模块同时定义了以下常量: | |||
| 23 | | :----- | :--- | :--- | | 23 | | :----- | :--- | :--- | |
| 24 | | UNKNOWN_DIM | -1 | 表示未知维度 | | 24 | | UNKNOWN_DIM | -1 | 表示未知维度 | |
| 25 | | UNKNOWN_DIM_NUM | -2 | 表示未知维度数量 | | 25 | | UNKNOWN_DIM_NUM | -2 | 表示未知维度数量 | |
| 26 | -| UNKNOWN_DIM_SIZE | -1 | 未知形状时 get_shape_size() 的返回值 | | 26 | +| UNKNOWN_DIM_SIZE | -1 | 未知形状时get_shape_size()的返回值 | |
| 27 | 27 | ||
| 28 | ## 类定义 | 28 | ## 类定义 |
| 29 | 29 | ||
| @@ -36,7 +36,7 @@ class Shape(list): | |||
| 36 | 36 | ||
| 37 | | 函数 | 功能说明 | | 37 | | 函数 | 功能说明 | |
| 38 | | :--- | :--- | | 38 | | :--- | :--- | |
| 39 | -| \_\_init\_\_(dims=None) | 构造函数,创建 Shape 对象。dims 为整数列表,None 表示标量(空列表) | | 39 | +| \_\_init\_\_(dims=None) | 构造函数,创建Shape对象。dims为整数列表,None表示标量(空列表) | |
| 40 | | get_shape_size() | 计算形状中所有维度的乘积,即张量的总元素数 | | 40 | | get_shape_size() | 计算形状中所有维度的乘积,即张量的总元素数 | |
| 41 | | is_unknown_shape() | 判断形状中是否包含未知维度 | | 41 | | is_unknown_shape() | 判断形状中是否包含未知维度 | |
| 42 | 42 | ||
| @@ -46,27 +46,27 @@ class Shape(list): | |||
| 46 | 46 | ||
| 47 | | 参数名 | 类型 | 是否必选 | 说明 | | 47 | | 参数名 | 类型 | 是否必选 | 说明 | |
| 48 | | :----- | :--- | :------: | :--- | | 48 | | :----- | :--- | :------: | :--- | |
| 49 | -| dims | List[int] | 否 | 维度值列表,例如 [1, 3, 224, 224]。None 表示标量(空列表)。默认值为 None | | 49 | +| dims | List[int] | 否 | 维度值列表,例如[1, 3, 224, 224]。None表示标量(空列表)。默认值为None | |
| 50 | 50 | ||
| 51 | ## 返回值说明 | 51 | ## 返回值说明 |
| 52 | 52 | ||
| 53 | | 函数 | 返回值类型 | 说明 | | 53 | | 函数 | 返回值类型 | 说明 | |
| 54 | | :--- | :--- | :--- | | 54 | | :--- | :--- | :--- | |
| 55 | -| get_shape_size() | int | 所有维度的乘积。当形状为空(标量)时返回 0;当形状中包含未知维度(UNKNOWN_DIM 或 UNKNOWN_DIM_NUM)时返回 -1 | | 55 | +| get_shape_size() | int | 所有维度的乘积。当形状为空(标量)时返回 0;当形状中包含未知维度(UNKNOWN_DIM或UNKNOWN_DIM_NUM)时返回-1 | |
| 56 | -| is_unknown_shape() | bool | 如果形状中包含 UNKNOWN_DIM(-1)或 UNKNOWN_DIM_NUM(-2),返回 True;否则返回 False | | 56 | +| is_unknown_shape() | bool | 如果形状中包含UNKNOWN_DIM(-1)或UNKNOWN_DIM_NUM(-2),返回True;否则返回False | |
| 57 | 57 | ||
| 58 | ## 约束说明 | 58 | ## 约束说明 |
| 59 | 59 | ||
| 60 | -- dims 参数必须为整数列表(list of int)或 None,否则抛出 TypeError。 | 60 | +- dims参数必须为整数列表(list of int)或None,否则抛出TypeError。 |
| 61 | -- Shape 继承自 list,因此支持所有标准列表操作(索引、切片、迭代、len 等)。 | 61 | +- Shape继承自list,因此支持所有标准列表操作(索引、切片、迭代、len等)。 |
| 62 | -- 当形状中包含未知维度时,get_shape_size() 返回 -1,而非抛出异常。 | 62 | +- 当形状中包含未知维度时,get_shape_size()返回-1,而非抛出异常。 |
| 63 | 63 | ||
| 64 | ## 使用示例 | 64 | ## 使用示例 |
| 65 | 65 | ||
| 66 | ```python | 66 | ```python |
| 67 | from ge.graph import Shape | 67 | from ge.graph import Shape |
| 68 | 68 | ||
| 69 | -# 创建 Shape 对象 | 69 | +# 创建Shape对象 |
| 70 | shape = Shape([1, 3, 224, 224]) | 70 | shape = Shape([1, 3, 224, 224]) |
| 71 | 71 | ||
| 72 | # 获取总元素数 | 72 | # 获取总元素数 |
| @@ -75,7 +75,7 @@ print(shape.get_shape_size()) # 150528 | |||
| 75 | # 判断是否为未知形状 | 75 | # 判断是否为未知形状 |
| 76 | print(shape.is_unknown_shape()) # False | 76 | print(shape.is_unknown_shape()) # False |
| 77 | 77 | ||
| 78 | -# 创建包含未知维度的 Shape | 78 | +# 创建包含未知维度的Shape |
| 79 | unknown_shape = Shape([-1, 3, 224, 224]) | 79 | unknown_shape = Shape([-1, 3, 224, 224]) |
| 80 | print(unknown_shape.is_unknown_shape()) # True | 80 | print(unknown_shape.is_unknown_shape()) # True |
| 81 | print(unknown_shape.get_shape_size()) # -1 | 81 | print(unknown_shape.get_shape_size()) # -1 |
| @@ -85,7 +85,7 @@ scalar = Shape() | |||
| 85 | print(len(scalar)) # 0 | 85 | print(len(scalar)) # 0 |
| 86 | print(scalar.get_shape_size()) # 0 | 86 | print(scalar.get_shape_size()) # 0 |
| 87 | 87 | ||
| 88 | -# 支持 list 操作 | 88 | +# 支持list操作 |
| 89 | print(shape[0]) # 1 | 89 | print(shape[0]) # 1 |
| 90 | print(len(shape)) # 4 | 90 | print(len(shape)) # 4 |
| 91 | print(list(shape)) # [1, 3, 224, 224] | 91 | print(list(shape)) # [1, 3, 224, 224] |