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

Function is_zero_supported_optimizer

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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 2

get_rankMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected