We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e6c103 commit 9eb8734Copy full SHA for 9eb8734
recipes_source/recipes/profiler_recipe.py
@@ -163,7 +163,12 @@
163
######################################################################
164
# Profiler can also be used to analyze performance of models executed on GPUs and XPUs:
165
# Users could switch between cpu, cuda and xpu
166
-device = 'cuda'
+if torch.cuda.is_available():
167
+ device = 'cuda'
168
+elif torch.xpu.is_available():
169
+ device = 'xpu'
170
+else:
171
+ device = 'cpu'
172
173
activities = [ProfilerActivity.CPU]
174
sort_by_keyword = device + "_time_total"
0 commit comments