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

Function _engine

tests/unit/v1/zero/test_zero_partial_offload.py:64–74  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

62
63
64def _engine(config):
65 torch.manual_seed(0)
66 model = Net()
67 named = list(model.named_parameters())
68 # Weights with weight decay and biases without, as most training scripts set them up.
69 params = [
70 dict(params=[p for n, p in named if n.endswith("weight")]),
71 dict(params=[p for n, p in named if n.endswith("bias")], weight_decay=0.0)
72 ]
73 engine, _, _, _ = deepspeed.initialize(model=model, model_parameters=params, config=config)
74 return engine
75
76
77def _train(engine, steps, first_step=0):

Calls 3

NetClass · 0.85
manual_seedMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected