Skip to content

Commit

Permalink
Fix unit test failure with deepspeed >= 0.15.4
Browse files Browse the repository at this point in the history
Signed-off-by: Kyunggeun Lee <quic_kyunggeu@quicinc.com>
  • Loading branch information
quic-kyunggeu committed Nov 13, 2024
1 parent 556e121 commit 7a1ee4f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion TrainingExtensions/torch/test/python/v2/test_deepspeed.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import deepspeed as ds
import tempfile
import json
from packaging import version

from torch.utils.data import Dataset, DataLoader, RandomSampler

Expand Down Expand Up @@ -476,7 +477,12 @@ def test_deepspeed_zero3_offload_buckets_sync(unlabeled_data_loader,
data = data.cuda()
_ = sim_deepspeed.model(data)

param_coordinator = ds_optimizer._get_param_coordinator(False)
# NOTE: Some backwards-incompatible changes were made in deepspeed 0.15.4
if version.parse(ds.__version__) < version.parse("0.15.4"):
param_coordinator = ds_optimizer.parameter_offload.get_param_coordinator(False)
else:
param_coordinator = ds_optimizer.parameter_offload.get_param_coordinator()

assert param_coordinator.is_complete_trace()

with SafeGatheredParameters(sim_deepspeed.model.parameters()), torch.no_grad():
Expand Down

0 comments on commit 7a1ee4f

Please sign in to comment.