|
|
|
@@ -21,14 +21,13 @@ from mindspore._c_expression import security |
|
|
|
|
|
|
|
def set_dump(target, enabled=True): |
|
|
|
""" |
|
|
|
Enable or disable dump for the target and its contents. |
|
|
|
Enable or disable dump for the `target` and its contents. |
|
|
|
|
|
|
|
Target should be an instance of `Cell <https://www.mindspore.cn/docs/api/en/master/api_python/nn/ |
|
|
|
mindspore.nn.Cell.html#mindspore.nn.Cell>`_ or `Primitive <https://www.mindspore.cn/docs/api/en/master/ |
|
|
|
api_python/ops/mindspore.ops.Primitive.html#mindspore.ops.Primitive>`_ . Please note that this API takes |
|
|
|
effect only when Asynchronous Dump is enabled and the dump_mode field in dump config file is 2. See the |
|
|
|
`dump document <https://mindspore.cn/docs/programming_guide/en/master/dump_in_graph_mode.html>`_ |
|
|
|
for details. The default enabled status for a cell or primitive is False. |
|
|
|
`target` should be an instance of :class:`mindspore.nn.Cell` or :class:`mindspore.ops.Primitive` . |
|
|
|
Please note that this API takes effect only when Asynchronous Dump is enabled and the `dump_mode` |
|
|
|
field in dump config file is "2". See the `dump document <https://mindspore.cn/docs/programming_guide/ |
|
|
|
en/master/dump_in_graph_mode.html>`_ for details. |
|
|
|
The default enabled status for a :class:`mindspore.nn.Cell` or :class:`mindspore.ops.Primitive` is False. |
|
|
|
|
|
|
|
.. warning:: |
|
|
|
This is an experimental prototype that is subject to change or deletion. |
|
|
|
@@ -37,23 +36,20 @@ def set_dump(target, enabled=True): |
|
|
|
1. This API is only effective for GRAPH_MODE with Ascend backend. |
|
|
|
2. This API only supports being called before training starts. |
|
|
|
If you call this API during training, it may not be effective. |
|
|
|
3. After using set_dump(cell, True), operators in forward and backward |
|
|
|
3. After using `set_dump(Cell, True)` , operators in forward and backward |
|
|
|
computation (computation generated by the grad operations) of the |
|
|
|
cell will be dumped. |
|
|
|
4. For `nn.SparseSoftmaxCrossEntropyWithLogits |
|
|
|
<https://www.mindspore.cn/docs/api/en/master/api_python/nn/ |
|
|
|
mindspore.nn.SoftmaxCrossEntropyWithLogits.html#mindspore.nn |
|
|
|
.SoftmaxCrossEntropyWithLogits>`_ layer, the forward |
|
|
|
4. For :class:`mindspore.nn.SoftmaxCrossEntropyWithLogits` layer, the forward |
|
|
|
computation and backward computation use the same set of |
|
|
|
operators. So you can only see dump data from backward computation. |
|
|
|
Please note that nn.SoftmaxCrossEntropyWithLogits layer will also use |
|
|
|
the above operators internally when initialized with sparse=True and |
|
|
|
reduction="mean". |
|
|
|
Please note that :class:`mindspore.nn.SoftmaxCrossEntropyWithLogits` layer will also use |
|
|
|
the above operators internally when initialized with `sparse=True` and |
|
|
|
`reduction="mean"` . |
|
|
|
|
|
|
|
Args: |
|
|
|
target (Union[Cell, Primitive]): The Cell instance or Primitive instance |
|
|
|
to which the dump flag is set. |
|
|
|
enabled (bool): True means enable dump, False means disable dump. |
|
|
|
enabled (bool, optional): True means enable dump, False means disable dump. |
|
|
|
Default: True. |
|
|
|
|
|
|
|
Supported Platforms: |
|
|
|
|