Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMP] Add use_warning check by GPU Compute Capability of amp #38086

Merged
merged 1 commit into from
Dec 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions python/paddle/fluid/dygraph/amp/auto_cast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down