Unexpected genericTranspose_kernel when enabling channel_last in Pytorch with amp

Wenjing_ZHU: <p>Hi experts:</p>
<p>I enable according to this tutorial <a href="https://pytorch.org/tutorials/intermediate/memory_format_tutorial.html" class="inline-onebox" rel="noopener nofollow ugc">(beta) Channels Last Memory Format in PyTorch — PyTorch Tutorials 2.2.0+cu121 documentation</a> and amp in the same time. When I profiling it with nsight system, I found a lot of unexpected <strong>genericTranspose_kernel</strong> when the input shape is <strong>[3, 512, 960]</strong><br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/e/d/ed5953d4429c58e4f5b6abbc83139ac77b35ad80.png" data-download-href="https://discuss.pytorch.org/uploads/default/ed5953d4429c58e4f5b6abbc83139ac77b35ad80" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/ed5953d4429c58e4f5b6abbc83139ac77b35ad80_2_392x500.png" alt="image" data-base62-sha1="xRGxHWWtIsHMTurbCGqcNa82HXq" width="392" height="500" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/ed5953d4429c58e4f5b6abbc83139ac77b35ad80_2_392x500.png, https://discuss.pytorch.org/uploads/default/optimized/3X/e/d/ed5953d4429c58e4f5b6abbc83139ac77b35ad80_2_588x750.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/e/d/ed5953d4429c58e4f5b6abbc83139ac77b35ad80.png 2x" data-dominant-color="F4F4F3"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">746×950 122 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
And the <strong>genericTranspose_kernel</strong> are around cutlass kernels<br>
And I want to know why the kernels show up so I change the input shape. When the input shape is <strong>[32, 128, 240]</strong>, the <strong>genericTranspose_kernel</strong>  is gone</p>
<p>Any insights on that? Thank you!</p>

Wenjing_ZHU: <p>The <strong>genericTranspose_kernel</strong> are around cutlass kernels<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/1/1/11f6b7218ddd8fd76df25ba5e74199b0309eb8bb.png" data-download-href="https://discuss.pytorch.org/uploads/default/11f6b7218ddd8fd76df25ba5e74199b0309eb8bb" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/1/1/11f6b7218ddd8fd76df25ba5e74199b0309eb8bb_2_690x431.png" alt="image" data-base62-sha1="2yUHxibFC5WomQpuAuIYkE2CFWr" width="690" height="431" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/1/1/11f6b7218ddd8fd76df25ba5e74199b0309eb8bb_2_690x431.png, https://discuss.pytorch.org/uploads/default/optimized/3X/1/1/11f6b7218ddd8fd76df25ba5e74199b0309eb8bb_2_1035x646.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/1/1/11f6b7218ddd8fd76df25ba5e74199b0309eb8bb.png 2x" data-dominant-color="E3E4E8"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1296×810 112 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

ptrblck: <p>cuDNN might not have native channels-last kernels for the input shapes provided by you and would transpose the input instead of failing.</p>