Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Fairseq
Commits
8d6665f2
Commit
8d6665f2
authored
Aug 14, 2018
by
Myle Ott
Browse files
Warn when using FP16 on pre-Volta GPUs
parent
e7422192
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
train.py
train.py
+3
-0
No files found.
train.py
View file @
8d6665f2
...
@@ -42,6 +42,9 @@ def main(args):
...
@@ -42,6 +42,9 @@ def main(args):
# Build trainer
# Build trainer
if
args
.
fp16
:
if
args
.
fp16
:
if
torch
.
cuda
.
get_device_capability
(
0
)[
0
]
<
7
:
print
(
'| WARNING: your device does NOT support faster training with --fp16,'
' please switch to FP32 which is likely to be faster'
)
trainer
=
FP16Trainer
(
args
,
task
,
model
,
criterion
)
trainer
=
FP16Trainer
(
args
,
task
,
model
,
criterion
)
else
:
else
:
if
torch
.
cuda
.
get_device_capability
(
0
)[
0
]
>=
7
:
if
torch
.
cuda
.
get_device_capability
(
0
)[
0
]
>=
7
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment