ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

context 中文

2022-01-11 10:04:57  阅读:181  来源: 互联网

标签:kernel 中文 set level graph RDR fusion context


def set_context(**kwargs):
    """
    Set context for running environment.
    Context should be configured before running your program. If there is no configuration,
    it will be automatically set according to the device target by default.
    Note:
        Attribute name is required for setting attributes.
 

enable_graph_kernel (bool): Enable graph kernel fusion to optimize network execution performance.
            Default: False.
            If enable_graph_kernel is set to True, acceleration can be enabled.
            For details of graph kernel fusion, please check
            `Enabling Graph Kernel Fusion <https://www.mindspore.cn/docs/programming_guide
            /en/master/enable_graph_kernel_fusion.html>`_.


grad_for_scalar (bool):  Whether to get gradient for scalar. Default: False.
            When grad_for_scalar is set to True, the function's scalar input can be derived.
            Because the back-end does not support scaling operations currently,
            this interface only supports simple operations that can be deduced by the front-end.

 

 

env_config_path (str): The path of mindspore environment config file.
            Through context.set_context(env_config_path="./mindspore_config.json")
            configure RDR:
            - enable: controls whether the RDR is enabled to collect the key data during training and
              save key data in the fault scenario. When set to true, the RDR will be turned on.
              When set to false, the RDR will be turned off.
            - mode: sets the mode of RDR on exporting data. When set to 1, the RDR only exports data
              in the fault scenario. When set to 2, the RDR exports data in the fault scenario and the
              normal end scenario. Default is 1.
            - path: sets the path where RDR saves data. The current path must be absolute.
            Memory reuse:
            - mem_Reuse: controls whether the memory reuse function is turned on. When set to True,
            - the memory reuse function is turned on. When set to False, the memory reuse function is turned off.


graph_kernel_flags (str) –
            Optimization options of graph kernel fusion, and the priority is higher when it conflicts
            with enable_graph_kernel. Only for experienced users.
            For example, context.set_context(graph_kernel_flags="--opt_level=2 --dump_as_text"). Some general options:
            - opt_level: Set the optimization level.
              Default: 2. Graph kernel fusion can be enabled equivalently by setting opt_level greater than 0.
              Available values are:
              - 0: disables graph kernel fusion;
              - 1: enables the basic fusion of operators;
              - 2: includes all optimizations of level 1,
                and turns on more optimizations such as CSE, arithmetic simplification and so on;
              - 3: includes all optimizations of level 2, and turns on more optimizations such as SitchingFusion,
                ParallelFusion and so on. Optimizations of this level are radical and unstable in some scenarios.
                Be caution when using this level.
            - dump_as_text: dump the detailed information of the key process as text files in the "graph_kernel_dump" directory.
               Default: false.

 

标签:kernel,中文,set,level,graph,RDR,fusion,context
来源: https://www.cnblogs.com/dpf-learn/p/15783317.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有