Skip to content

Commit

Permalink
microsoft#1213: Fix CPUAdam for when vendor_id_raw is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
FarzanT authored Feb 15, 2023
1 parent 98cc35b commit 7408f8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deepspeed/ops/adam/cpu_adam.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def __init__(self,
bias_correction=bias_correction,
amsgrad=amsgrad)
super(DeepSpeedCPUAdam, self).__init__(model_params, default_args)

self.cpu_vendor = get_cpu_info()["vendor_id_raw"].lower()
cpu_info = get_cpu_info()
self.cpu_vendor = cpu_info["vendor_id_raw"].lower() if "vendor_id_raw" in cpu_info else "unknown"
if "amd" in self.cpu_vendor:
for group_id, group in enumerate(self.param_groups):
for param_id, p in enumerate(group['params']):
Expand Down

0 comments on commit 7408f8c

Please sign in to comment.