Skip to content

Commit

Permalink
Initialize variable for all codepaths in dynamo benchmarks (pytorch#1…
Browse files Browse the repository at this point in the history
…16260)

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.

Pull Request resolved: pytorch#116260
Approved by: https://github.com/lezcano
  • Loading branch information
isuruf authored and pytorchmergebot committed Dec 26, 2023
1 parent f6dfbff commit a254fbf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions benchmarks/dynamo/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,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 a254fbf

Please sign in to comment.