MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _engine

Function _engine

tests/unit/runtime/zero/test_zero_numel_param_shape.py:92–108  ·  view source on GitHub ↗
(case)

Source from the content-addressed store, hash-verified

90
91
92def _engine(case):
93 extra, dtype = CONFIGS[case]
94 if dtype not in get_accelerator().supported_dtypes():
95 pytest.skip(f"{dtype} is not supported by {get_accelerator().device_name()}")
96 config = {
97 "train_micro_batch_size_per_gpu": 1,
98 "optimizer": {
99 "type": "Adam",
100 "params": {
101 "lr": 1e-3
102 }
103 },
104 **extra,
105 }
106 model = EmptyTailModel()
107 engine, *_ = deepspeed.initialize(model=model, model_parameters=model.parameters(), config=config)
108 return engine
109
110
111def _step(engine, case):

Calls 6

get_acceleratorFunction · 0.90
EmptyTailModelClass · 0.85
initializeMethod · 0.80
supported_dtypesMethod · 0.45
device_nameMethod · 0.45
parametersMethod · 0.45

Tested by

no test coverage detected