Skip to content

Commit

Permalink
build(deps): Upgrade accelerate requirement to allow version 1.0.0 (#371
Browse files Browse the repository at this point in the history
)

* deps: Upgrade accelerate to version 1.0.0

Signed-off-by: Will Johnson <[email protected]>

* tests: Replace out of date variable  with ,fixing unit tests

Signed-off-by: Will Johnson <[email protected]>

* fix: Add old parameter for backwards compatibility

Signed-off-by: Will Johnson <[email protected]>

---------

Signed-off-by: Will Johnson <[email protected]>
  • Loading branch information
willmj authored Oct 15, 2024
1 parent d360202 commit d138858
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion fixtures/accelerate_fsdp_defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ fsdp_config:
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP

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

# setting this to true will increase forward memory by prefetching the next FSDP all-gather, while performing
# the current forward pass.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers=[
]
dependencies = [
"numpy>=1.26.4,<2.0",
"accelerate>=0.20.3,<0.35,!=0.34",
"accelerate>=0.20.3,!=0.34,<1.1",
"transformers>4.41,<4.50",
"torch>=2.2.0,<3.0",
"sentencepiece>=0.1.99,<0.3",
Expand Down
2 changes: 1 addition & 1 deletion tests/build/dummy_job_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dynamo_use_dynamic": true,
"num_machines": 1,
"main_process_port": 1234,
"fsdp_backward_prefetch_policy": "TRANSFORMER_BASED_WRAP",
"fsdp_backward_prefetch": "TRANSFORMER_BASED_WRAP",
"fsdp_sharding_strategy": 1,
"fsdp_state_dict_type": "FULL_STATE_DICT",
"fsdp_cpu_ram_efficient_loading": true,
Expand Down
2 changes: 1 addition & 1 deletion tests/build/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_process_accelerate_launch_args(job_config):
args = process_accelerate_launch_args(job_config)
# json config values used
assert args.use_fsdp is True
assert args.fsdp_backward_prefetch_policy == "TRANSFORMER_BASED_WRAP"
assert args.fsdp_backward_prefetch == "TRANSFORMER_BASED_WRAP"
assert args.env == ["env1", "env2"]
assert args.training_script == "tuning.sft_trainer"
assert args.config_file == "fixtures/accelerate_fsdp_defaults.yaml"
Expand Down

0 comments on commit d138858

Please sign in to comment.