"git@developer.sourcefind.cn:change/sglang.git" did not exist on "65fdb289294f890c1814277ffc6160fa93b07750"
Commit e7f19560 authored by Michael Carilli's avatar Michael Carilli
Browse files

Add some links

parent dc55a996
...@@ -37,7 +37,7 @@ def scale_loss(loss, ...@@ -37,7 +37,7 @@ def scale_loss(loss,
unscaled. The direct ``.grad`` attributes of any FP16 unscaled. The direct ``.grad`` attributes of any FP16
model params will remain scaled after context manager exit. model params will remain scaled after context manager exit.
This subtlety affects gradient clipping. See "Gradient clipping" under This subtlety affects gradient clipping. See "Gradient clipping" under
"Advanced use cases" for best practices. `Advanced use cases`_ for best practices.
Args: Args:
loss(Tensor): Typically a scalar Tensor. The ``scaled_loss`` that the context loss(Tensor): Typically a scalar Tensor. The ``scaled_loss`` that the context
...@@ -54,7 +54,10 @@ def scale_loss(loss, ...@@ -54,7 +54,10 @@ def scale_loss(loss,
.. warning::If ``True``, ``optimizer.step()`` cannot be .. warning::If ``True``, ``optimizer.step()`` cannot be
called yet after context manager exit, and must wait for another, later backward context called yet after context manager exit, and must wait for another, later backward context
manager invocation with ``delay_unscale`` left to False. manager invocation with ``delay_unscale`` left to False.
See "Advanced use cases" for examples. See `Advanced use cases`_ for examples.
.. _`Advanced use cases`:
https://nvidia.github.io/apex/amp.html#advanced-use-cases
""" """
if not _amp_state.opt_properties.enabled: if not _amp_state.opt_properties.enabled:
yield loss yield loss
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment