资讯动态

昇腾CANN/GE ArgsFormat反序列化接口

发布时间:2026/9/10 5:01:58 来源:尧图企业网站定制
Deserialize【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge产品支持情况全量芯片支持。头文件/库文件头文件#include graph/arg_desc_info.h库文件libgraph.so函数功能ArgsFormat的反序列化接口。函数原型static std::vectorArgDescInfo Deserialize(const AscendString args_str)参数说明参数名输入/输出描述args_str输入ArgsFormat的序列化字符串。返回值返回ArgsFormat。失败时返回空的vector。约束说明字符串必须是ArgsFormat的序列化结果。调用示例graphStatus Mc2GenTaskCallback(const gert::ExeResGenerationContext *context, std::vectorstd::vectoruint8_t tasks) { .... // 更改原AI Core任务的ArgsFormat auto aicore_task KernelLaunchInfo::LoadFromData(context, tasks.back()); auto aicore_args_format_str aicore_task.GetArgsFormat(); auto aicore_args_format ArgsFormatSerializer::Deserialize(aicore_args_format_str); size_t i 0UL; for (; i aicore_args_format.size(); i) { if (aicore_args_format[i].GetType() ArgDescType::kIrInput || aicore_args_format[i].GetType() ArgDescType::kInputInstance) { break; } } aicore_args_format.insert(aicore_args_format.begin() i, ArgDescInfo::CreateHiddenInput(HiddenInputSubType::kHcom)); aicore_task.SetArgsFormat(ArgsFormatSerializer::Serialize(aicore_args_format).GetString()); tasks.back() aicore_task.Serialize(); return SUCCESS; }【免费下载链接】geGEGraph Engine是面向昇腾的图编译器和执行器提供了计算图优化、多流并行、内存复用和模型下沉等技术手段加速模型执行效率减少模型内存占用。 GE 提供对 PyTorch、TensorFlow 前端的友好接入能力并同时支持 onnx、pb 等主流模型格式的解析与编译。项目地址: https://gitcode.com/cann/ge创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价