Skip to content

Commit d138858

Browse files
authored
build(deps): Upgrade accelerate requirement to allow version 1.0.0 (#371)
* deps: Upgrade accelerate to version 1.0.0 Signed-off-by: Will Johnson <mwjohnson728@gmail.com> * tests: Replace out of date variable with ,fixing unit tests Signed-off-by: Will Johnson <mwjohnson728@gmail.com> * fix: Add old parameter for backwards compatibility Signed-off-by: Will Johnson <mwjohnson728@gmail.com> --------- Signed-off-by: Will Johnson <mwjohnson728@gmail.com>
1 parent d360202 commit d138858

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

fixtures/accelerate_fsdp_defaults.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ fsdp_config:
1414
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
1515

1616
# this controls the FSDP pipelining
17-
fsdp_backward_prefetch_policy: BACKWARD_PRE # set to BACKWARD_PRE for the most time-efficient pipeline
17+
fsdp_backward_prefetch: BACKWARD_PRE # set to BACKWARD_PRE for the most time-efficient pipeline
1818
# but requires the most memory. BACKWARD_POST is the less
1919
# memory intensive option
20+
fsdp_backward_prefetch_policy: BACKWARD_PRE # for backwards compatibility
2021

2122
# setting this to true will increase forward memory by prefetching the next FSDP all-gather, while performing
2223
# the current forward pass.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ classifiers=[
2727
]
2828
dependencies = [
2929
"numpy>=1.26.4,<2.0",
30-
"accelerate>=0.20.3,<0.35,!=0.34",
30+
"accelerate>=0.20.3,!=0.34,<1.1",
3131
"transformers>4.41,<4.50",
3232
"torch>=2.2.0,<3.0",
3333
"sentencepiece>=0.1.99,<0.3",

tests/build/dummy_job_config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dynamo_use_dynamic": true,
66
"num_machines": 1,
77
"main_process_port": 1234,
8-
"fsdp_backward_prefetch_policy": "TRANSFORMER_BASED_WRAP",
8+
"fsdp_backward_prefetch": "TRANSFORMER_BASED_WRAP",
99
"fsdp_sharding_strategy": 1,
1010
"fsdp_state_dict_type": "FULL_STATE_DICT",
1111
"fsdp_cpu_ram_efficient_loading": true,

tests/build/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_process_accelerate_launch_args(job_config):
4444
args = process_accelerate_launch_args(job_config)
4545
# json config values used
4646
assert args.use_fsdp is True
47-
assert args.fsdp_backward_prefetch_policy == "TRANSFORMER_BASED_WRAP"
47+
assert args.fsdp_backward_prefetch == "TRANSFORMER_BASED_WRAP"
4848
assert args.env == ["env1", "env2"]
4949
assert args.training_script == "tuning.sft_trainer"
5050
assert args.config_file == "fixtures/accelerate_fsdp_defaults.yaml"

0 commit comments

Comments
 (0)