提交 9bcbccd3 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!168 Mindspore VM backend modify the profiling interface to context option, need to adapt

Merge pull request !168 from WeibiaoYu/master
......@@ -81,6 +81,15 @@ class Profiler:
os.environ['PROFILING_MODE'] = 'true'
os.environ['PROFILING_OPTIONS'] = 'training_trace:task_trace'
# use context interface to open profiling, for the new mindspore version(after 2020.5.21)
try:
import mindspore.context as context
context.set_context(enable_profiling=True, profiling_options="training_trace:task_trace")
except ImportError:
logger.error("Profiling: fail to import context from mindspore.")
except ValueError as err:
logger.err("Profiling: fail to set context", err.message)
os.environ['AICPU_PROFILING_MODE'] = 'true'
os.environ['PROFILING_DIR'] = str(self._container_path)
self._subgraph = check_subgraph(subgraph)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册