Skip to content

Commit

Permalink
Initialize variable for all codepaths in dynamo benchmarks (#116260)
Browse files Browse the repository at this point in the history
Summary:
Sometimes, the first statement that sets this variable in the try block fails due to out of memory issues and the finally block tries to delete this variable, but it was not written to in the first place.

X-link: pytorch/pytorch#116260
Approved by: https://github.com/lezcano

Reviewed By: izaitsevfb, jeanschmidt

Differential Revision: D52424766

fbshipit-source-id: 8a9b1b7c8d99148258759bef8c8f5224724bd14a
  • Loading branch information
isuruf authored and facebook-github-bot committed Jan 2, 2024
1 parent f535c05 commit 5be3269
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions userbenchmark/dynamo/dynamobench/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,7 @@ def record_status(accuracy_status, dynamo_start_stats):
# Collect the fp64 reference outputs to be used later for accuracy checking.
fp64_outputs = None
model_fp64 = None
inputs_fp64 = None
try:
model_fp64, inputs_fp64 = cast_to_fp64(
self.deepcopy_and_maybe_ddp(model),
Expand Down

0 comments on commit 5be3269

Please sign in to comment.