diff --git a/inference/dataflow/cpluscplus/sample1.cpp b/inference/dataflow/cpluscplus/sample1.cpp index 7e2160d442f9f9c1baa8b10a4b2c6c4455852635..1b8df19305d2cdddc1eeafe176a96373f1e66bfe 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 5c3aa0576197f7080f369f631a974d46d3386d25..b60ebfc53a34f4d1c4fc3df60b970cb47d315e8c 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 fcc9ece5384347da4277d4918688194cb0e69121..92ab880f92fdfb3a136d1bd5d057a182525557f6 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 e45ccd9b3a580c08df5f538a37707fcde5774841..71f52187d28c7fb80e389b4c795b8eca821e2dd4 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 8f54b0d2b745c437654d0ca5be3d4f999db08bb8..c18e46b0f87645382f1a1b8df758a93b7f383970 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 8bbd267ea7a9f2090474ea2f7f9853eab03dcaae..bb200e10e93544845439ffd836ecfff9d3a926cd 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 66ee873fd2a1d2953e198f1061c1d7a80f311ec1..f997d84b16eb3e8b2c0ee3aa28aa36342cbb9ce9 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 3a5290d850fe84acfa3dfa6241af2b10322382f3..b87a07cfd36af5e1d72ba6e0ede77a3fc525c392 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 d692611d14a347d313b71fa0a4ba45d279c204c1..23aa6a8a210dc3a22ddb6dd9117f099266b34220 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 4f4a9cd8c5c21ae8ebac17e8d5ed34acb904308c..d23460c8d63fc42c944ff8bef6e5d3826df08b06 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 ed24000afeb93b8b146dc3fcb1ee4945dff3b277..6bc3b605e61ea7d1546bccc3ac013789e452d0c4 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 43c5e7cdb095c3351dd62539d757e323345ffc8c..48da935857940cc65fb6d7b56f38891b8c69f5c6 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 cf5481256f6989d86e37d77be5a7bd0b70af8612..ff141be800fe5cb058d7b01a030e536a3ec7ae89 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 7299a7abe9c31fa295fa770deb15088971277969..c5247c5e61d55d92b9dba8101f31c86f464d223a 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)