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

Function check_injection

tests/unit/inference/test_inference.py:249–260  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

247
248# Used to verify DeepSpeed kernel injection worked with a model
249def check_injection(model):
250
251 def verify_injection(module):
252 for child in module.children():
253 if isinstance(child, nn.ModuleList):
254 assert isinstance(child[0], DeepSpeedTransformerInference),\
255 "DeepSpeed-Inference Transformer kernels has not been injected in the model"
256 break
257 else:
258 verify_injection(child)
259
260 verify_injection(model)
261
262
263# Used to Get Device name

Callers 4

testMethod · 0.85
testMethod · 0.85
testMethod · 0.85
testMethod · 0.85

Calls 1

verify_injectionFunction · 0.85

Tested by

no test coverage detected