Skip to content

Commit 001688d

Browse files
authored
Merge pull request #1233 from jjsjann123/nhwc_cond_conv2d
fixing channels_last on cond_conv2d; update nvfuser debug env variable
2 parents 7d235c5 + f88c606 commit 001688d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

timm/models/layers/cond_conv2d.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ def forward(self, x, routing_weights):
9191
bias = torch.matmul(routing_weights, self.bias)
9292
bias = bias.view(B * self.out_channels)
9393
# move batch elements with channels so each batch element can be efficiently convolved with separate kernel
94-
x = x.view(1, B * C, H, W)
94+
# reshape instead of view to work with channels_last input
95+
x = x.reshape(1, B * C, H, W)
9596
if self.dynamic_padding:
9697
out = conv2d_same(
9798
x, weight, bias, stride=self.stride, padding=self.padding,

timm/utils/jit.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ def set_jit_fuser(fuser):
3434
torch._C._jit_override_can_fuse_on_gpu(True)
3535
torch._C._jit_set_texpr_fuser_enabled(False)
3636
elif fuser == "nvfuser" or fuser == "nvf":
37-
os.environ['PYTORCH_CUDA_FUSER_DISABLE_FALLBACK'] = '1'
38-
os.environ['PYTORCH_CUDA_FUSER_DISABLE_FMA'] = '1'
39-
os.environ['PYTORCH_CUDA_FUSER_JIT_OPT_LEVEL'] = '0'
37+
os.environ['PYTORCH_NVFUSER_DISABLE_FALLBACK'] = '1'
38+
os.environ['PYTORCH_NVFUSER_DISABLE_FMA'] = '1'
39+
os.environ['PYTORCH_NVFUSER_JIT_OPT_LEVEL'] = '0'
4040
torch._C._jit_set_texpr_fuser_enabled(False)
4141
torch._C._jit_set_profiling_executor(True)
4242
torch._C._jit_set_profiling_mode(True)

0 commit comments

Comments
 (0)