Skip to content

Commit

Permalink
skip if torch version less than 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
v-chen_data committed Jun 25, 2024
1 parent 13ecba9 commit f5fe4a9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/trainer/test_fsdp_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ def test_fsdp_full_state_dict_load(
):
if use_hsdp:
pytest.xfail('Known Pytorch issue with HSDP, waiting for pytorch patch')
if version.parse(torch.__version__) < version.parse('2.3.0'):
if use_tp:
pytest.skip('TP requires torch 2.3.0 or later')
if use_hsdp:
pytest.skip('HSDP requires torch 2.3.0 or later')
if autoresume:
run_name = 'my-cool-autoresume-run'
else:
Expand Down Expand Up @@ -691,6 +696,8 @@ def test_fsdp_full_state_dict_load_with_ema(
precision: str,
optimizer: str,
):
if use_tp and version.parse(torch.__version__) < version.parse('2.3.0'):
pytest.skip('TP requires torch 2.3.0 or later')
save_folder = tmp_path
save_filename = 'ba{batch}-rank{rank}.pt'

Expand Down Expand Up @@ -833,8 +840,11 @@ def test_fsdp_partitioned_state_dict_load(
):
if weights_only and autoresume:
pytest.skip('Weights only with autoresume is not supported')
if use_tp and version.parse(torch.__version__) < version.parse('2.3.0'):
pytest.skip('TP requires torch 2.3.0 or later')
if version.parse(torch.__version__) < version.parse('2.3.0'):
if use_tp:
pytest.skip('TP requires torch 2.3.0 or later')
if use_hsdp:
pytest.skip('HSDP requires torch 2.3.0 or later')

load_ignore_keys = [] if load_ignore_keys is None else load_ignore_keys

Expand Down

0 comments on commit f5fe4a9

Please sign in to comment.