Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FutureWarning] Resolving warnings caused by deprecated function usage. #1867

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apex/contrib/cudnn_gbn/batch_norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from torch import Tensor
import peer_memory_cuda as pm
import cudnn_gbn_lib
from torch.cuda.amp import custom_fwd, custom_bwd
from torch.amp import custom_fwd, custom_bwd

class _GroupBatchNorm2d(torch.autograd.Function):

@staticmethod
@custom_fwd
@custom_fwd(device_type='cuda')
def forward(ctx, input, weight, bias, running_mean, running_variance,
minibatch_mean, minibatch_inv_var, momentum, eps, group_size, group_rank, fwd_buffers, bwd_buffers):
ctx.save_for_backward(input, weight, minibatch_mean, minibatch_inv_var)
Expand All @@ -21,7 +21,7 @@ def forward(ctx, input, weight, bias, running_mean, running_variance,
minibatch_mean, minibatch_inv_var, momentum, eps, group_size, group_rank, fwd_buffers)

@staticmethod
@custom_bwd
@custom_bwd(device_type='cuda')
def backward(ctx, grad_output):
x, scale, minibatch_mean, minibatch_inv_var = ctx.saved_variables
eps = ctx.eps
Expand Down