Fix multi-node distributed training with single GPU per node (#4143)

This commit is contained in:
Mustafa Eyceoz 2026-03-03 09:45:41 -05:00 committed by GitHub
commit 6762a380e3

View file

@ -1473,7 +1473,7 @@ BitsAndBytesConfig__init__ = BitsAndBytesConfig__init__.replace(
)
exec(BitsAndBytesConfig__init__, globals())
if DEVICE_COUNT == 1:
if DEVICE_COUNT == 1 and int(os.environ.get("WORLD_SIZE", "1")) <= 1:
from accelerate.utils.dataclasses import DistributedType
def _prepare_backend(self, *args, **kwargs):