Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 1 addition & 5 deletions src/accelerate/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
check_cuda_fp8_capability,
check_cuda_p2p_ib_support,
deepspeed_required,
get_ccl_version,
get_cpu_distributed_information,
get_int_from_env,
is_ccl_available,
Expand Down Expand Up @@ -797,10 +796,7 @@ def _prepare_backend(
and is_ccl_available()
and (get_int_from_env(["CCL_WORKER_COUNT"], 0) > 0 or distributed_type == DistributedType.MULTI_XPU)
):
if get_ccl_version() >= "1.12":
import oneccl_bindings_for_pytorch # noqa: F401
else:
import torch_ccl # noqa: F401
import oneccl_bindings_for_pytorch # noqa: F401

backend = "ccl"
elif backend in (None, "mpi") and torch.distributed.is_mpi_available():
Expand Down
7 changes: 2 additions & 5 deletions src/accelerate/utils/imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,11 @@ def is_ccl_available():
pass
except ImportError:
print(
"Intel(R) oneCCL Bindings for PyTorch* is required to run DDP on Intel(R) GPUs, but it is not"
"Intel(R) oneCCL Bindings for PyTorch* is required to run DDP on Intel(R) XPUs, but it is not"
" detected. If you see \"ValueError: Invalid backend: 'ccl'\" error, please install Intel(R) oneCCL"
" Bindings for PyTorch*."
)
return (
importlib.util.find_spec("torch_ccl") is not None
or importlib.util.find_spec("oneccl_bindings_for_pytorch") is not None
)
return importlib.util.find_spec("oneccl_bindings_for_pytorch") is not None


def get_ccl_version():
Expand Down