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

Method __init__

tests/test_optimizer/test_adam_kernel.py:92–98  ·  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

90
91class CPUAdamKernel(AdamKernel):
92 def __init__(self, lr: float, beta1: float, beta2: float, eps: float, weight_decay: float, use_adamw: bool) -> None:
93 super().__init__(lr, beta1, beta2, eps, weight_decay, use_adamw)
94 from colossalai.kernel.kernel_loader import CPUAdamLoader
95
96 cpu_optim = CPUAdamLoader().load()
97
98 self.cpu_adam_op = cpu_optim.CPUAdamOptimizer(lr, beta1, beta2, eps, weight_decay, use_adamw)
99
100 def update(self, step: int, param: Tensor, grad: Tensor, exp_avg: Tensor, exp_avg_sq: Tensor):
101 self.cpu_adam_op.step(

Callers

nothing calls this directly

Calls 3

CPUAdamLoaderClass · 0.90
__init__Method · 0.45
loadMethod · 0.45

Tested by

no test coverage detected