1111import sys
1212from typing import Any , Dict , Optional
1313
14- from absl import flags
15- from clu import metric_writers
1614import GPUtil
1715import pandas as pd
1816import psutil
1917import torch .distributed as dist
18+ from absl import flags
19+ from clu import metric_writers
2020
2121from algoperf import spec
2222from algoperf .pytorch_utils import pytorch_setup
@@ -198,7 +198,7 @@ def _get_system_hardware_info() -> Dict:
198198 try :
199199 system_hardware_info ['cpu_model_name' ] = _get_cpu_model_name ()
200200 system_hardware_info ['cpu_count' ] = psutil .cpu_count ()
201- except : # pylint: disable=bare-except
201+ except : # noqa: E722
202202 logging .info ('Unable to record cpu information. Continuing without it.' )
203203
204204 gpus = GPUtil .getGPUs ()
@@ -207,7 +207,7 @@ def _get_system_hardware_info() -> Dict:
207207 system_hardware_info ['gpu_model_name' ] = gpus [0 ].name
208208 system_hardware_info ['gpu_count' ] = len (gpus )
209209 system_hardware_info ['gpu_driver' ] = gpus [0 ].driver
210- except : # pylint: disable=bare-except
210+ except : # noqa: E722
211211 logging .info ('Unable to record gpu information. Continuing without it.' )
212212
213213 return system_hardware_info
@@ -232,7 +232,7 @@ def _get_system_software_info() -> Dict:
232232 system_software_info ['git_commit_hash' ] = _get_git_commit_hash ()
233233 # Note: do not store git repo url as it may be sensitive or contain a
234234 # secret.
235- except : # pylint: disable=bare-except
235+ except : # noqa: E722
236236 logging .info ('Unable to record git information. Continuing without it.' )
237237
238238 return system_software_info
@@ -279,7 +279,7 @@ def _get_workload_properties(workload: spec.Workload) -> Dict:
279279 for key in keys :
280280 try :
281281 attr = getattr (workload , key )
282- except : # pylint: disable=bare-except
282+ except : # noqa: E722
283283 logging .info (
284284 f'Unable to record workload.{ key } information. Continuing without it.'
285285 )
0 commit comments