From b4d72279bff876b62311a667709396863c3a7a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AE=81?= Date: Fri, 15 Aug 2025 15:07:56 +0800 Subject: [PATCH] remove default soc version, and change default python version --- inference/dataflow/cpluscplus/sample1.cpp | 2 -- inference/dataflow/cpluscplus/sample2.cpp | 2 -- inference/dataflow/cpluscplus/sample3.cpp | 2 -- inference/dataflow/cpluscplus/sample4.cpp | 2 -- inference/dataflow/cpluscplus/sample5.cpp | 2 -- inference/dataflow/cpluscplus/sample6.cpp | 2 -- inference/dataflow/cpluscplus/test_perf.cpp | 2 -- inference/dataflow/python/README.md | 16 ++++++++-------- inference/dataflow/python/sample1.py | 3 +-- inference/dataflow/python/sample2.py | 3 +-- inference/dataflow/python/sample3.py | 3 +-- .../dataflow/python/sample_multiple_model.py | 3 +-- inference/dataflow/python/sample_pytorch.py | 3 +-- inference/dataflow/python/test_perf.py | 3 +-- 14 files changed, 14 insertions(+), 34 deletions(-) diff --git a/inference/dataflow/cpluscplus/sample1.cpp b/inference/dataflow/cpluscplus/sample1.cpp index 7e2160d44..1b8df1930 100644 --- a/inference/dataflow/cpluscplus/sample1.cpp +++ b/inference/dataflow/cpluscplus/sample1.cpp @@ -139,9 +139,7 @@ int32_t main() auto flow_graph = BuildDataFlow(); // Initialize - // socVersion is set according to real chip type std::map config = {{"ge.exec.deviceId", "0"}, - {"ge.socVersion", "Ascend910B"}, {"ge.experiment.data_flow_deploy_info_path", "../config/data_flow_deploy_info.json"}, {"ge.graphRunMode", "0"}}; auto geRet = ge::GEInitialize(config); diff --git a/inference/dataflow/cpluscplus/sample2.cpp b/inference/dataflow/cpluscplus/sample2.cpp index 5c3aa0576..b60ebfc53 100644 --- a/inference/dataflow/cpluscplus/sample2.cpp +++ b/inference/dataflow/cpluscplus/sample2.cpp @@ -122,9 +122,7 @@ int32_t main() { auto flow_graph = BuildDataFlowGraph(); // Initialize - // socVersion is set according to real chip type std::map config = {{"ge.exec.deviceId", "0"}, - {"ge.socVersion", "Ascend910B"}, {"ge.exec.logicalDeviceClusterDeployMode", "SINGLE"}, {"ge.exec.logicalDeviceId", "[0:0]"}, {"ge.graphRunMode", "0"}}; diff --git a/inference/dataflow/cpluscplus/sample3.cpp b/inference/dataflow/cpluscplus/sample3.cpp index fcc9ece53..92ab880f9 100644 --- a/inference/dataflow/cpluscplus/sample3.cpp +++ b/inference/dataflow/cpluscplus/sample3.cpp @@ -121,9 +121,7 @@ int32_t main() { auto flow_graph = BuildDataFlowGraph(); // Initialize - // socVersion is set according to real chip type std::map config = {{"ge.exec.deviceId", "0"}, - {"ge.socVersion", "Ascend910B"}, {"ge.exec.logicalDeviceClusterDeployMode", "SINGLE"}, {"ge.exec.logicalDeviceId", "[0:0]"}, {"ge.graphRunMode", "0"}}; diff --git a/inference/dataflow/cpluscplus/sample4.cpp b/inference/dataflow/cpluscplus/sample4.cpp index e45ccd9b3..71f52187d 100644 --- a/inference/dataflow/cpluscplus/sample4.cpp +++ b/inference/dataflow/cpluscplus/sample4.cpp @@ -102,9 +102,7 @@ int32_t main() auto flow_graph = BuildDataFlowGraph(); // Initialize - // socVersion is set according to real chip type std::map config = {{"ge.exec.deviceId", "0"}, - {"ge.socVersion", "Ascend910B"}, {"ge.graphRunMode", "0"}}; auto geRet = ge::GEInitialize(config); if (geRet != ge::SUCCESS) { diff --git a/inference/dataflow/cpluscplus/sample5.cpp b/inference/dataflow/cpluscplus/sample5.cpp index 8f54b0d2b..c18e46b0f 100644 --- a/inference/dataflow/cpluscplus/sample5.cpp +++ b/inference/dataflow/cpluscplus/sample5.cpp @@ -103,9 +103,7 @@ int32_t main() auto flow_graph = BuildDataFlow(); // Initialize - // socVersion is set according to real chip type std::map config = {{"ge.exec.deviceId", "0"}, - {"ge.socVersion", "Ascend910B"}, {"ge.exec.logicalDeviceClusterDeployMode", "SINGLE"}, {"ge.exec.logicalDeviceId", "[0:0]"}, {"ge.graphRunMode", "0"}}; diff --git a/inference/dataflow/cpluscplus/sample6.cpp b/inference/dataflow/cpluscplus/sample6.cpp index 8bbd267ea..bb200e10e 100644 --- a/inference/dataflow/cpluscplus/sample6.cpp +++ b/inference/dataflow/cpluscplus/sample6.cpp @@ -144,9 +144,7 @@ int32_t main() flow_graph.SetInputsAlignAttrs(alginMaxCacheNum, alignTimeout, false); flow_graph.SetExceptionCatch(true); // Initialize - // socVersion is set according to real chip type std::map config = {{"ge.exec.deviceId", "0"}, - {"ge.socVersion", "Ascend910B"}, {"ge.experiment.data_flow_deploy_info_path", "../config/data_flow_deploy_info.json"}, {"ge.graphRunMode", "0"}}; auto geRet = ge::GEInitialize(config); diff --git a/inference/dataflow/cpluscplus/test_perf.cpp b/inference/dataflow/cpluscplus/test_perf.cpp index 66ee873fd..f997d84b1 100644 --- a/inference/dataflow/cpluscplus/test_perf.cpp +++ b/inference/dataflow/cpluscplus/test_perf.cpp @@ -78,9 +78,7 @@ int32_t main() auto flow_graph = BuildDataFlowGraph(); // Initialize - // socVersion is set according to real chip type std::map config = {{"ge.exec.deviceId", "0"}, - {"ge.socVersion", "Ascend910B"}, {"ge.graphRunMode", "0"}}; auto geRet = ge::GEInitialize(config); if (geRet != ge::SUCCESS) { diff --git a/inference/dataflow/python/README.md b/inference/dataflow/python/README.md index 3a5290d85..b87a07cfd 100644 --- a/inference/dataflow/python/README.md +++ b/inference/dataflow/python/README.md @@ -31,7 +31,7 @@ ## 环境准备 参考[环境准备](../../../README.md#环境准备)下载安装驱动/固件/CANN软件包 -python 版本要求:python3.9 +python 版本要求:python3.11 具体版本以dataflow wheel包编译时用的python版本为准,如果需要使用不同python版本,可以参考[py_dflow](../py_dflow)重新编译dataflow wheel包。 sample_pytorch.py、sample_npu_model.py样例依赖pytorch和torchvision包,推荐使用torch 2.1.0和torchvision 0.16.0 @@ -45,12 +45,12 @@ export ASCEND_SLOG_PRINT_TO_STDOUT=1 # 日志打屏,不设置日志落盘默 source {HOME}/Ascend/ascend-toolkit/set_env.sh #{HOME}为CANN软件包安装目录,请根据实际安装路径进行替换 export RESOURCE_CONFIG_PATH=xxx/xxx/xxx/numa_config.json -python3.9 sample1.py -python3.9 sample2.py -python3.9 sample3.py -python3.9 sample_pytorch.py -python3.9 sample_npu_model.py -python3.9 sample_multiple_model.py -python3.9 test_perf.py +python3.11 sample1.py +python3.11 sample2.py +python3.11 sample3.py +python3.11 sample_pytorch.py +python3.11 sample_npu_model.py +python3.11 sample_multiple_model.py +python3.11 test_perf.py ``` diff --git a/inference/dataflow/python/sample1.py b/inference/dataflow/python/sample1.py index d692611d1..23aa6a8a2 100644 --- a/inference/dataflow/python/sample1.py +++ b/inference/dataflow/python/sample1.py @@ -20,8 +20,7 @@ import dataflow as df options = { "ge.exec.deviceId":"0", "ge.exec.logicalDeviceClusterDeployMode":"SINGLE", - "ge.exec.logicalDeviceId":"[0:0]", - "ge.socVersion":"Ascend910B" + "ge.exec.logicalDeviceId":"[0:0]" } df.init(options) diff --git a/inference/dataflow/python/sample2.py b/inference/dataflow/python/sample2.py index 4f4a9cd8c..d23460c8d 100644 --- a/inference/dataflow/python/sample2.py +++ b/inference/dataflow/python/sample2.py @@ -21,8 +21,7 @@ from udf_py.udf_add import UserFunc1 # dataflow初始化参数 options = { "ge.exec.deviceId":"0", - "ge.experiment.data_flow_deploy_info_path":"./config/data_flow_deploy_info.json", - "ge.socVersion":"Ascend910B" + "ge.experiment.data_flow_deploy_info_path":"./config/data_flow_deploy_info.json" } df.init(options) diff --git a/inference/dataflow/python/sample3.py b/inference/dataflow/python/sample3.py index ed24000af..6bc3b605e 100644 --- a/inference/dataflow/python/sample3.py +++ b/inference/dataflow/python/sample3.py @@ -20,8 +20,7 @@ import dataflow as df options = { "ge.exec.deviceId":"0", "ge.exec.logicalDeviceClusterDeployMode":"SINGLE", - "ge.exec.logicalDeviceId":"[0:0]", - "ge.socVersion":"Ascend910B" + "ge.exec.logicalDeviceId":"[0:0]" } df.init(options) diff --git a/inference/dataflow/python/sample_multiple_model.py b/inference/dataflow/python/sample_multiple_model.py index 43c5e7cdb..48da93585 100644 --- a/inference/dataflow/python/sample_multiple_model.py +++ b/inference/dataflow/python/sample_multiple_model.py @@ -138,8 +138,7 @@ class SampleFlowGraph: self.flow_graph = None self.options = { "ge.exec.deviceId":"0", - "ge.experiment.data_flow_deploy_info_path":"./config/multi_model_deploy.json", - "ge.socVersion":"Ascend910B" + "ge.experiment.data_flow_deploy_info_path":"./config/multi_model_deploy.json" } def init(self): diff --git a/inference/dataflow/python/sample_pytorch.py b/inference/dataflow/python/sample_pytorch.py index cf5481256..ff141be80 100644 --- a/inference/dataflow/python/sample_pytorch.py +++ b/inference/dataflow/python/sample_pytorch.py @@ -86,8 +86,7 @@ def postprocess(input_image): if __name__ == '__main__': options = { - "ge.experiment.data_flow_deploy_info_path": "./config/sample_pytorch_deploy_info.json", - "ge.socVersion": "Ascend910B" + "ge.experiment.data_flow_deploy_info_path": "./config/sample_pytorch_deploy_info.json" } df.init(options) diff --git a/inference/dataflow/python/test_perf.py b/inference/dataflow/python/test_perf.py index 7299a7abe..c5247c5e6 100644 --- a/inference/dataflow/python/test_perf.py +++ b/inference/dataflow/python/test_perf.py @@ -20,8 +20,7 @@ import time options = { "ge.exec.deviceId":"0", "ge.exec.logicalDeviceClusterDeployMode":"SINGLE", - "ge.exec.logicalDeviceId":"[0:0]", - "ge.socVersion":"Ascend910B" + "ge.exec.logicalDeviceId":"[0:0]" } df.init(options) -- Gitee