diff --git a/mindspore/context.py b/mindspore/context.py index 6eb120f527d..e423467e4dd 100644 --- a/mindspore/context.py +++ b/mindspore/context.py @@ -569,9 +569,17 @@ def set_context(**kwargs): create the files in the same directory. For example, the `device_id` can be generated by `device_id = os.getenv("DEVICE_ID")` and the `save_graphs_path` can be set by `context.set_context(save_graphs_path="path/to/ir/files"+device_id)`. - enable_graph_kernel (bool): Whether to enable composition of basic primitives. These primitives would be - compiled into a fused kernel automatically. Default: False. - graph_kernel_flags (str): Set graph_kernel flags. + enable_graph_kernel (bool): Whether to enable graph kernel fusion to optimize network execution performance. + Default: False. + graph_kernel_flags (str): Optimization options of graph kernel fusion. Experienced user only. + For example, `context.set_context(graph_kernel_flags="--opt_level=2 --dump_as_text")`. + Some general options: + - opt_level: optimization level between 0 and 3. Default: 2. Graph kernel fusion can be enabled + equivalently by setting opt_level greater than 0. + - dump_as_text: dump detail info as text files. Default: false. + More options can be referred from the implementation code. + These options can also be set by environment variable `MS_GRAPH_KERNEL_FLAGS`, without modifying + network source code. For example, `export MS_GRAPH_KERNEL_FLAGS="--opt_level=2 --dump_as_text"`. reserve_class_name_in_scope (bool) : Whether to save the network class name in the scope. Default: True. Each node has a scope. A scope of a subnode is the name of its parent node. If reserve_class_name_in_scope is set, the class name will be saved after keyword 'net-' in the scope. For example: