Megatron-LM icon indicating copy to clipboard operation
Megatron-LM copied to clipboard

why `expand_as` is required in param backprop hook registering?

Open forrestjgq opened this issue 3 years ago • 1 comments

Your question In DDP tensor backprop processing, the param is expanded to get grad_fn and register a hook to that fn, why is that operation required? can we just get the param.grad_fn and register hook to that?

see code: https://github.com/NVIDIA/Megatron-LM/blob/main/megatron/model/distributed.py#L350

forrestjgq avatar Sep 25 '23 02:09 forrestjgq

Marking as stale. No activity in 60 days.

github-actions[bot] avatar Nov 24 '23 18:11 github-actions[bot]