Repository: pytorch
Issue: test/test_vulkan.py fails with vulkan_prepack::conv2d_clamp_prepack not found
Labels: oncall: mobile,module: vulkan

### 🐛 Describe the bug

As of 77d979f748508b1ceeeda1edb769caad79dca60e `test/test_vulkan.py` fails with `vulkan_prepack::conv2d_clamp_prepack`  not found error:
```
$ python test/test_vulkan.py
/home/dvrogozh/venv/pytorch-vulkan/lib/python3.10/site-packages/transformers/utils/generic.py:441: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  _torch_pytree._register_pytree_node(
E
======================================================================
ERROR: test_conv (__main__.TestVulkanRewritePass)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/dvrogozh/git/pytorch/pytorch/torch/testing/_internal/common_utils.py", line 2674, in wrapper
    method(*args, **kwargs)
  File "/home/dvrogozh/git/pytorch/pytorch/test/test_vulkan.py", line 86, in test_conv
    TestVulkanRewritePass.validate_transformed_module(Conv2D(), pattern_count_map, data_shape)
  File "/home/dvrogozh/git/pytorch/pytorch/test/test_vulkan.py", line 45, in validate_transformed_module
    FileCheck().check_count(pattern, v, exactly=True).run(deserialized_scripted_model.graph)
RuntimeError: Expected to find "vulkan_prepack::conv2d_clamp_prepack" but did not find it
Searched string:
graph(%self.1 : __torch__.Conv2D,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
      %x.1 : Tensor):
  %37 : NoneType = prim::Constant()
  %weight.1 : Tensor = prim::GetAttr[name="weight"](%self.1)
From CHECK-COUNT-1: vulkan_prepack::conv2d_clamp_prepack


To execute this test, run the following from the base repo dir:
     python test/test_vulkan.py -k test_conv

This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0

----------------------------------------------------------------------
Ran 1 test in 0.401s

FAILED (errors=1)
```

I built pytorch with `USE_VULKAN=1 python3 setup.py develop`. Note that while above python test fails, the following works:
* `./build/bin/vulkan_api_test` works with clear load on GPU and only 1 test getting skipped:
```
/home/dvrogozh/git/pytorch/pytorch/aten/src/ATen/test/vulkan_api_test.cpp:8179: Skipped
QueryPool is not available
[  SKIPPED ] VulkanAPITest.querypool_flushed_shader_log (0 ms)
[----------] 419 tests from VulkanAPITest (17217 ms total)

[----------] Global test environment tear-down
[==========] 419 tests from 1 test suite ran. (17217 ms total)
[  PASSED  ] 418 tests.
[  SKIPPED ] 1 test, listed below:
[  SKIPPED ] VulkanAPITest.querypool_flushed_shader_log

  YOU HAVE 11 DISABLED TESTS
```

* Running mobilenetv2 following https://pytorch.org/tutorials/prototype/vulkan_workflow.html and modifying example at https://pytorch.org/hub/pytorch_vision_mobilenet_v2/ for vulkan also works for me with clear load on GPU


### Versions

I was building pytorch under Ubuntu 22.04 with `USE_VULKAN=1` under python virtual environment. Ran on Intel GPU. See output of `collect_env.py` below.
```
$ python ./torch/utils/collect_env.py
Collecting environment information...
PyTorch version: 2.3.0a0+git77d979f
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.22.1
Libc version: glibc-2.35

Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-89-generic-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      46 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             20
On-line CPU(s) list:                0-19
Vendor ID:                          GenuineIntel
Model name:                         13th Gen Intel(R) Core(TM) i5-13500
CPU family:                         6
Model:                              191
Thread(s) per core:                 2
Core(s) per socket:                 14
Socket(s):                          1
Stepping:                           2
CPU max MHz:                        4800.0000
CPU min MHz:                        800.0000
BogoMIPS:                           4992.00
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req umip pku ospke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr flush_l1d arch_capabilities
Virtualization:                     VT-x
L1d cache:                          544 KiB (14 instances)
L1i cache:                          704 KiB (14 instances)
L2 cache:                           11.5 MiB (8 instances)
L3 cache:                           24 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-19
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected

Versions of relevant libraries:
[pip3] clip-anytorch==2.5.2
[pip3] CoCa-pytorch==0.1.0
[pip3] dalle2-pytorch==1.14.2
[pip3] ema-pytorch==0.3.1
[pip3] functorch==1.14.0a0+b71aa0b
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.23.5
[pip3] onnx==1.15.0
[pip3] open-clip-torch==2.23.0
[pip3] optree==0.10.0
[pip3] pytorch-warmup==0.1.1
[pip3] rotary-embedding-torch==0.3.3
[pip3] torch==2.3.0a0+git77d979f
[pip3] torch-fidelity==0.3.0
[pip3] torch_geometric==2.4.0
[pip3] torchmetrics==1.2.1
[pip3] torchvision==0.18.0a0+26fb5ef
[pip3] vector-quantize-pytorch==1.12.5
[conda] Could not collect
```

cc @ezyang @gchanan @zou3519 @kadeng @frank-wei @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10