图编译缓存

功能介绍

图编译缓存功能支持将图编译结果进行磁盘持久化,当应用程序重新运行时直接加载磁盘上缓存的编译结果。在编译并运行Graph过程中,为了减少图编译时长,可以开启图编译缓存功能。

使用约束

使用方法

1
2
3
4
5
6
std::map<ge::AscendString, ge::AscendString> session_options = {{"ge.graph_compiler_cache_dir", "./build_cache_dir"}};
std::shared_ptr<ge::Session> session = std::make_shared<ge::Session>(session_options);
const auto graph = CreateGraph();
std::map<ge::AscendString, ge::AscendString> graph_options = {{"ge.graph_key", "test_graph_001"}};
auto = session->AddGraph(0, graph, graph_options);
...

缓存文件生成规则

生成文件包括:

文件名生成规则: