Skip to content

Commit

Permalink
fix npu support method in single card
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaqiw09 committed May 16, 2024
1 parent 0f4fe94 commit cbbef02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lm_eval/models/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ def __init__(
# use user-passed device
device_list = set(
["cuda", "cpu", "npu"]
+ [f"cuda:{i}" for i in range(device_counts)]
+ [f"npu:{i}" for i in range(device_counts)]
+ [f"cuda:{i}" for i in range(torch.cuda.device_count())]
+ ["mps", "mps:0"]
+ ["npu", "npu:0"]
)
if device and device in device_list:
self._device = torch.device(device)
Expand Down

0 comments on commit cbbef02

Please sign in to comment.