
pyatc【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/geProduct Support StatusProductSupport StatusAtlas A3 Training Series Products/Atlas A3 Inference Series Products√Atlas A2 Training Series Products/Atlas A2 Inference Series Products√Module Import# Command line mode python -m ge.pyatc [ATC parameters...] # Python code mode from ge.pyatc import mainFunctionality Descriptionpyatcmodule provides Python entry equivalent toatc(Ascend Tensor Compiler) command line tool, facilitating users to execute ATC compilation commands within specified Python interpreter process.The core use of this module is to solve scenarios where ATC process needs to use specific Python interpreter, such as Python Pass plugin loading and execution. Throughpyatc, users can ensure ATC uses current Python environment instead of system default Python.Function Prototypesmaindef main(cmdline_argv0None, argsNone) - NoneATC command line main entry function. Encodes parameters and calls underlying C ATC main function to execute compilation, uses return value as exit code to exit process.Parameter DescriptionmainParameterTypeRequiredDescriptioncmdline_argv0Optional[str]NoCustom argv[0], i.e., command line program name. If None, usessys.argv[0](when argv[0] is__main__.py, automatically replaced withsys.executable -m ge.pyatc)argsOptional[List[str]]NoATC command line parameter list. If None, usessys.argv[1:]Return Value Descriptionmainfunction has no return value. After execution completes, callssys.exit()to exit process with underlying ATC return code.Constraint Descriptionmainfunction callssys.exit()to terminate process, not suitable for scenarios where subsequent logic needs to continue executing.ATC command line parameters are consistent withatccommand line tool, specific parameter description please refer to ATC related documentation.This module requires CANN environment to be properly installed and configured.Usage Example# Command line mode, equivalent to atc command (example only, atc command complete validity not guaranteed) python -m ge.pyatc --modelmodel.onnx --soc_versionAscend910B1 --outputmodel # Or pyatc --modelmodel.onnx --soc_versionAscend910B1 --outputmodel # With Pass path scenario (example only, atc command complete validity not guaranteed) export ASCEND_GE_PY_PASS_PATH/path/to/my_pass.py python -m ge.pyatc --modelmodel.onnx --soc_versionAscend910B1 --outputmodel # Or pyatc --modelmodel.onnx --soc_versionAscend910B1 --outputmodel【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考