未验证 提交 3a2093a5 编写于 作者: Z zhangbo9674 提交者: GitHub

add use_warning of amp (#38086)

上级 3b85864a
......@@ -218,6 +218,13 @@ def amp_guard(enable=True,
% tracer._expected_place)
enable = False
if tracer._expected_place.is_gpu_place():
prop = paddle.device.cuda.get_device_capability()
if prop[0] < 7:
warnings.warn(
"AMP only support NVIDIA GPU with Compute Capability 7.0 or higher, current GPU is: %s, with Compute Capability: %d.%d."
% (paddle.device.cuda.get_device_name(), prop[0], prop[1]))
if level == 'O1':
amp_level = AMP_LEVEL.O1
_white_list = WHITE_LIST
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册