fixing channels_last on cond_conv2d; update nvfuser debug env variable

pull/1233/head
jjsjann123 3 years ago
parent 7d235c5a5f
commit f88c606fcf

@ -91,7 +91,8 @@ class CondConv2d(nn.Module):
bias = torch.matmul(routing_weights, self.bias) bias = torch.matmul(routing_weights, self.bias)
bias = bias.view(B * self.out_channels) bias = bias.view(B * self.out_channels)
# move batch elements with channels so each batch element can be efficiently convolved with separate kernel # move batch elements with channels so each batch element can be efficiently convolved with separate kernel
x = x.view(1, B * C, H, W) # reshape instead of view to work with channels_last input
x = x.reshape(1, B * C, H, W)
if self.dynamic_padding: if self.dynamic_padding:
out = conv2d_same( out = conv2d_same(
x, weight, bias, stride=self.stride, padding=self.padding, x, weight, bias, stride=self.stride, padding=self.padding,

@ -34,9 +34,9 @@ def set_jit_fuser(fuser):
torch._C._jit_override_can_fuse_on_gpu(True) torch._C._jit_override_can_fuse_on_gpu(True)
torch._C._jit_set_texpr_fuser_enabled(False) torch._C._jit_set_texpr_fuser_enabled(False)
elif fuser == "nvfuser" or fuser == "nvf": elif fuser == "nvfuser" or fuser == "nvf":
os.environ['PYTORCH_CUDA_FUSER_DISABLE_FALLBACK'] = '1' os.environ['PYTORCH_NVFUSER_DISABLE_FALLBACK'] = '1'
os.environ['PYTORCH_CUDA_FUSER_DISABLE_FMA'] = '1' os.environ['PYTORCH_NVFUSER_DISABLE_FMA'] = '1'
os.environ['PYTORCH_CUDA_FUSER_JIT_OPT_LEVEL'] = '0' os.environ['PYTORCH_NVFUSER_JIT_OPT_LEVEL'] = '0'
torch._C._jit_set_texpr_fuser_enabled(False) torch._C._jit_set_texpr_fuser_enabled(False)
torch._C._jit_set_profiling_executor(True) torch._C._jit_set_profiling_executor(True)
torch._C._jit_set_profiling_mode(True) torch._C._jit_set_profiling_mode(True)

Loading…
Cancel
Save