Remove redundant runtime checks for activation recompute - #3436
Remove redundant runtime checks for activation recompute#3436ghadiaravi13 wants to merge 1 commit 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? |
Description
Remove redundant runtime checks for activation recompute in MLP from _ScaledUnary class in activation.py
The current gating is redudant, because the non-fused path already behaves as
activation_recompute_in_mlp = truealways.Type of change
Checklist: