Skip to content

Commit bc79723

Browse files
Fix elapsed time computation from issue #3649 (#3650)
Fixes #3649 ## Description This PR fixes the timing helper used in the `torch.compile` tutorial by dividing the CUDA event elapsed time by 1000 (ms -> s) instead of 1024. ## Checklist <!--- Make sure to add `x` to all items in the following checklist: --> - [x] The issue that is being fixed is referred in the description (see above "Fixes #ISSUE_NUMBER") - [x] Only one issue is addressed in this pull request - [x] Labels from the issue that this PR is fixing are added to this pull request - [x] No unnecessary issues are included into this pull request. cc @williamwen42 @msaroufim @anijain2305 Co-authored-by: sekyondaMeta <127536312+sekyondaMeta@users.noreply.github.com>
1 parent 637bf93 commit bc79723

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

intermediate_source/torch_compile_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def timed(fn):
163163
result = fn()
164164
end.record()
165165
torch.cuda.synchronize()
166-
return result, start.elapsed_time(end) / 1024
166+
return result, start.elapsed_time(end) / 1000
167167

168168

169169
inp = torch.randn(4096, 4096).cuda()

0 commit comments

Comments
 (0)