update graph kernel code docs

This commit is contained in:
Gaoxiong 2021-06-04 14:09:09 +08:00
parent d7e299ebac
commit 2ef32d5afc
1 changed files with 11 additions and 3 deletions

View File

@ -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: