Skip to content

Commit

Permalink
Fix unused Python variables outside torch/ and test/ (#136359)
Browse files Browse the repository at this point in the history
Summary:
X-link: pytorch/pytorch#136359
Approved by: https://github.com/albanD

Reviewed By: clee2000

Differential Revision: D67115192

fbshipit-source-id: 65e4ccafac9046d78e1de4234d5aa00894274c81
  • Loading branch information
rec authored and facebook-github-bot committed Dec 12, 2024
1 parent 2dd3e11 commit df8afaf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 5 additions & 8 deletions userbenchmark/dynamo/dynamobench/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ def print_summary_table(data, print_dataframe=False):
col.ljust(width),
f"gmean={gmean(cdata):.2f}x mean={cdata.mean():.3f}x",
)
except Exception as e:
except Exception:
pass


Expand Down Expand Up @@ -3018,7 +3018,7 @@ def record_status(accuracy_status, dynamo_start_stats):
)
):
is_same = False
except Exception as e:
except Exception:
# Sometimes torch.allclose may throw RuntimeError
is_same = False

Expand Down Expand Up @@ -3110,7 +3110,7 @@ def record_status(accuracy_status, dynamo_start_stats):
tol=tolerance,
):
is_same = False
except Exception as e:
except Exception:
# Sometimes torch.allclose may throw RuntimeError
is_same = False

Expand Down Expand Up @@ -3157,7 +3157,7 @@ def check_tolerance(
self.init_optimizer(name, current_device, model.parameters())
optimized_model_iter_fn = optimize_ctx(self.run_n_iterations)
new_result = optimized_model_iter_fn(model, example_inputs)
except Exception as e:
except Exception:
log.exception("")
print(
"TorchDynamo optimized model failed to run because of following error"
Expand Down Expand Up @@ -3542,7 +3542,7 @@ def minify_model(

try:
shutil.move("repro.py", f"{repro_dir}/{name}_repro.py")
except OSError as e:
except OSError:
logging.error("Could not find repro script for model %s", name)
else:
logging.info(
Expand Down Expand Up @@ -4369,9 +4369,6 @@ def run(runner, args, original_dir=None):
# Set translation validation on by default on CI accuracy runs.
torch.fx.experimental._config.translation_validation = True

ci = functools.partial(
CI, args.backend, training=args.training, dynamic=args.dynamic_shapes
)
if args.ddp:
assert args.training, "DDP benchmark requires --training mode"
torch._dynamo.config.optimize_ddp = args.optimize_ddp_mode
Expand Down
1 change: 0 additions & 1 deletion userbenchmark/dynamo/dynamobench/torchbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ def load_model(
)
is_training = self.args.training
use_eval_mode = self.args.use_eval_mode
dynamic_shapes = self.args.dynamic_shapes
candidates = [
f"torchbenchmark.models.{model_name}",
f"torchbenchmark.canary_models.{model_name}",
Expand Down

0 comments on commit df8afaf

Please sign in to comment.