Skip to content

Commit

Permalink
npu mlu xpu
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnXuan committed Aug 21, 2024
1 parent 0fb057d commit 1aaccff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libai/utils/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,13 @@ def device_type(self):
return self._device_type

def set_device_type(self, device_type):
assert device_type in ["cpu", "cuda"], f"not supported for {device_type}"
assert device_type in [
"cpu",
"cuda",
"npu",
"xpu",
"mlu",
], f"not supported for {device_type}"
self._device_type = device_type

def get_layer_ranks(self, layer_idx):
Expand Down

0 comments on commit 1aaccff

Please sign in to comment.