You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
native_dropout does not scale the kept elements in training mode #25899
In training mode the portable native_dropout.out kernel (kernels/portable/cpu/op_native_dropout.cpp) zeroes the dropped elements but returns the kept ones unchanged. ATen returns x * mask / (1 - p), so with ExecuTorch the output mean is 1 - p times the eager one. It is the only kernel for this op, and F.dropout(training=True) and nn.Dropout in train() mode lower to it. I found this by reading the kernel and confirmed it against eager.
The existing tests only cover train=False and p equal to 0 or 1, where no scaling happens. I have a fix with a test and will open a PR linked to this issue.
Versions
ExecuTorch built from main at 035df43, PyTorch 2.15.0+cpu, Python 3.12.3, Ubuntu 24.04 on WSL2, x86_64.
This issue was written with the help of Claude Code (Anthropic); I verified the reproduction.
Activity