Skip to content

Commit

Permalink
fix a bug when module is missing in low version of bitsandbytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben-Louis committed Oct 11, 2023
1 parent 6c5eebb commit 2135d37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmengine/optim/optimizer/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def register_bitsandbytes_optimizers() -> List[str]:
'PagedAdamW8bit', 'LAMB8bit', 'LARS8bit', 'RMSprop8bit',
'Lion8bit', 'PagedLion8bit', 'SGD8bit'
]:
_optim = getattr(bnb.optim, module_name)
_optim = getattr(bnb.optim, module_name, None)
if inspect.isclass(_optim) and issubclass(_optim,
torch.optim.Optimizer):
OPTIMIZERS.register_module(module=_optim)
Expand Down

0 comments on commit 2135d37

Please sign in to comment.