Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@require_huggingface_suite
def init_torch_dist_then_launch_deepspeed():
if torch_device == "xpu":
backend = "ccl"
backend = "xccl"
elif torch_device == "hpu":
backend = "hccl"
else:
Expand Down
6 changes: 1 addition & 5 deletions src/accelerate/test_utils/scripts/test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@
)


# TODO: remove RegressionModel4XPU once ccl support empty buffer in broadcasting.
if is_xpu_available():
from accelerate.test_utils import RegressionModel4XPU as RegressionModel
else:
from accelerate.test_utils import RegressionModel
from accelerate.test_utils import RegressionModel

if is_hpu_available():
ATOL = 1e-3
Expand Down
15 changes: 1 addition & 14 deletions src/accelerate/test_utils/training.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2021 The HuggingFace Team. All rights reserved.
# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,20 +34,6 @@ def __getitem__(self, i):
return {"x": self.x[i], "y": self.y[i]}


class RegressionModel4XPU(torch.nn.Module):
def __init__(self, a=0, b=0, double_output=False):
super().__init__()
self.a = torch.nn.Parameter(torch.tensor([2, 3]).float())
self.b = torch.nn.Parameter(torch.tensor([2, 3]).float())
self.first_batch = True

def forward(self, x=None):
if self.first_batch:
print(f"Model dtype: {self.a.dtype}, {self.b.dtype}. Input dtype: {x.dtype}")
self.first_batch = False
return x * self.a[0] + self.b[0]


class RegressionModel(torch.nn.Module):
def __init__(self, a=0, b=0, double_output=False):
super().__init__()
Expand Down
File renamed without changes.
Loading