Relax runtime checks for activation recompute into Warnings - #3436
Relax runtime checks for activation recompute into Warnings#3436ghadiaravi13 wants to merge 3 commits into
Conversation
…_ScaledUnary class in activation.py Signed-off-by: Ravi Ghadia <rghadia@nvidia.com>
There was a problem hiding this comment.
This change is reasonable to me. Ignoring activation_recompute_in_mlp outside of the grouped MLP block makes it less brittle (downstream users don't need to be aware of the specifics of the op fuser), but it may also result in silent perf degradation.
I should clarify that the removed check is not redundant. In the grouped MLP fused op, activation_recompute_in_mlp=True means that we do not cache the FC2 input for use in the wgrad GEMM. Rather, we take the cached activation input, recompute the activation, and pass that to the wgrad GEMM. However, in the unfused case, the activation and FC2 have nothing to do with each other. We cache both the activation input and the FC2 input, so we have worst-case memory usage.
|
Can we add some unit test to it? |
…aledUnary class Signed-off-by: Ravi Ghadia <rghadia@nvidia.com>
…MLP path Signed-off-by: Ravi Ghadia <rghadia@nvidia.com>
Description
Relax runtime checks into Warnings for activation recompute in MLP from _ScaledUnary class in activation.py
The current gating is strict and doesn't support activation computation for
bf16layers whenactivation_recompute_in_mlpis set to true (which applies for NVFP4 layers which uses op_fuser for MoE, but not for bf16).Type of change
Checklist: