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

Function is_zero_supported_optimizer

deepspeed/runtime/zero/utils.py:66–77  ·  view source on GitHub ↗
(optimizer)

Source from the content-addressed store, hash-verified

64
65
66def is_zero_supported_optimizer(optimizer):
67 if dist.get_rank() == 0:
68 logger.info(f'Checking ZeRO support for optimizer={optimizer.__class__.__name__} type={type(optimizer)}')
69 # Add MuonWithAuxAdam to supported list if muon is installed. This happens here instead of at module level
70 # because importing Muon compiles its kernels, which slows down import deepspeed.
71 try:
72 from deepspeed.runtime.zero.muon.muon_optimizer import MuonWithAuxAdam
73 if MuonWithAuxAdam not in ZERO_SUPPORTED_OPTIMIZERS:
74 ZERO_SUPPORTED_OPTIMIZERS.append(MuonWithAuxAdam)
75 except ImportError:
76 pass
77 return type(optimizer) in ZERO_SUPPORTED_OPTIMIZERS
78
79
80@instrument_w_nvtx

Callers 1

Calls 2

appendMethod · 0.80
get_rankMethod · 0.45

Tested by

no test coverage detected