MCPcopy
hub / github.com/hpcaitech/ColossalAI / __init__

Method __init__

tests/test_optimizer/test_adam_kernel.py:66–72  ·  view source on GitHub ↗
(self, lr: float, beta1: float, beta2: float, eps: float, weight_decay: float, use_adamw: bool)

Source from the content-addressed store, hash-verified

64
65class FusedAdamKernel(AdamKernel):
66 def __init__(self, lr: float, beta1: float, beta2: float, eps: float, weight_decay: float, use_adamw: bool) -> None:
67 super().__init__(lr, beta1, beta2, eps, weight_decay, use_adamw)
68 from colossalai.kernel.kernel_loader import FusedOptimizerLoader
69
70 fused_optim = FusedOptimizerLoader().load()
71 self.fused_adam = fused_optim.multi_tensor_adam
72 self.dummy_overflow_buf = torch.tensor([0], dtype=torch.int, device=get_accelerator().get_current_device())
73
74 def update(self, step: int, param: Tensor, grad: Tensor, exp_avg: Tensor, exp_avg_sq: Tensor):
75 multi_tensor_applier(

Callers

nothing calls this directly

Calls 5

get_acceleratorFunction · 0.90
__init__Method · 0.45
loadMethod · 0.45
get_current_deviceMethod · 0.45

Tested by

no test coverage detected