[QUESTION]About HybridDeviceOptimizer CPU Offloading Behavior #1577
Replies: 1 comment
-
|
both the optimizer states and FP32 master parameters offloaded to the CPU |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the HybridDeviceOptimizer's CPU offloading implementation(https://github.com/NVIDIA/Megatron-LM/blob/main/megatron/core/optimizer/cpu_offloading/hybrid_optimizer.py ), which components (gradients, optimizer states and FP32 master parameters)? are both the optimizer states and FP32 master parameters offloaded to the CPU?
From the code, it appears that optimizer updates are performed on both CPU and GPU. Could you clarify why CPU-side updates are necessary?
# Step the sub-optimizers.
if self.gpu_optimizer:
self.gpu_optimizer.step(closure)
Beta Was this translation helpful? Give feedback.
All reactions