Skip to content

Commit

Permalink
[CI] install fix for HF tests and use dict instead of json for some t…
Browse files Browse the repository at this point in the history
…ests (#1405)

* install HF w. dev extra to get all required packages

* switch ds.init to use param dict instead of json file on disk

* switch back to 'testing' extra
  • Loading branch information
jeffra authored Sep 28, 2021
1 parent c1829c4 commit 9e5c0c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ jobs:
git clone https://github.com/huggingface/transformers
git rev-parse --short HEAD
cd transformers
# scipy/sklearn required for tests, using the 'dev' extra forces torch re-install
pip install scipy sklearn
pip install .[testing]
# find reqs used in ds integration tests
find examples/pytorch -regextype posix-egrep -regex '.*(language-modeling|question-answering|summarization|text-classification|translation).*/requirements.txt' -exec pip install -r {} \;
Expand Down
18 changes: 7 additions & 11 deletions tests/unit/test_configurable_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@ def get_deepspeed_model(self, model, tmpdir):
},
}

ds_args = args_from_dict(tmpdir, ds_config_dict)

from megatron import mpu
model, _, _,_ = deepspeed.initialize(args=ds_args,
model=model,
mpu=mpu,
model_parameters=model.parameters())
model, _, _,_ = deepspeed.initialize(model=model,
mpu=mpu,
model_parameters=model.parameters(),
config=ds_config_dict)
return model

def test_gpt2_basic(self, tmpdir):
Expand Down Expand Up @@ -243,13 +241,11 @@ def get_deepspeed_model(self, model, tmpdir):
}
},
}

ds_args = args_from_dict(tmpdir, ds_config_dict)
dist.barrier()

model, _, _,_ = deepspeed.initialize(args=ds_args,
model=model,
model_parameters=model.parameters())
model, _, _,_ = deepspeed.initialize(model=model,
model_parameters=model.parameters(),
config=ds_config_dict)
return model.cuda()

def get_topology(self, mp, pp, world_size):
Expand Down

0 comments on commit 9e5c0c5

Please sign in to comment.