Skip to content

Commit

Permalink
enable xla fsdp (#32048)
Browse files Browse the repository at this point in the history
* enable xla fsdp

* add acceleration version check for xla fsdp
  • Loading branch information
hanwen-sun authored Aug 7, 2024
1 parent 7ad784a commit 46d09af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/training_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -1902,7 +1902,7 @@ def __post_init__(self):
warnings.warn("`--xla_fsdp_grad_ckpt` is useful only when `--xla` is set to true.")

# accelerate integration for FSDP
if len(self.fsdp) > 0 and not self.fsdp_config["xla"]:
if len(self.fsdp) > 0 and is_accelerate_available("0.28.0"):
os.environ["ACCELERATE_USE_FSDP"] = "true"
from accelerate.utils.constants import (
FSDP_AUTO_WRAP_POLICY,
Expand Down

0 comments on commit 46d09af

Please sign in to comment.