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

Function lazy_disable

deepspeed/runtime/compiler.py:50–55  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

48
49
50def lazy_disable(func):
51 # torch._disable_dynamo imports torch._dynamo on the first call instead of when decorating, so decorating at
52 # import time does not slow down import deepspeed. It caches the disabled function from torch 2.4.
53 if required_torch_version(min_version=2.4):
54 return torch._disable_dynamo(func)
55 return disable(func)
56
57
58def enable(min_version=None):

Callers

nothing calls this directly

Calls 2

required_torch_versionFunction · 0.90
disableFunction · 0.70

Tested by

no test coverage detected