File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change 33
33
# - ``numpy``
34
34
# - ``scipy``
35
35
# - ``tabulate``
36
- #
37
- # Note: a modern NVIDIA GPU (Volta or Ampere) is recommended for this tutorial.
38
- #
36
+
37
+ ######################################################################
38
+ # NOTE: a modern NVIDIA GPU (A100 or V100) is recommended for this tutorial in
39
+ # order to reproduce the speedup numbers shown below and documented elsewhere.
40
+
41
+ import torch
42
+ import warnings
43
+
44
+ gpu_ok = False
45
+ if torch .cuda .is_available ():
46
+ device = torch .cuda .get_device_name ()
47
+ if "V100" in device or "A100" in device :
48
+ gpu_ok = True
49
+
50
+ if not gpu_ok :
51
+ warnings .warn (
52
+ "GPU is not NVIDIA V100 or A100. Speedup numbers may be lower than "
53
+ "expected."
54
+ )
39
55
40
56
######################################################################
41
57
# Basic Usage
51
67
# ``torch.compile``. We can then call the returned optimized
52
68
# function in place of the original function.
53
69
54
- import torch
55
-
56
70
def foo (x , y ):
57
71
a = torch .sin (x )
58
72
b = torch .cos (x )
You can’t perform that action at this time.
0 commit comments