(self, lr: float, beta1: float, beta2: float, eps: float, weight_decay: float, use_adamw: bool)
| 90 | |
| 91 | class 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( |
nothing calls this directly
no test coverage detected