openai's CLIP model not working with pytorch 1.12 in some environments
### System Info

- `transformers` version: 4.20.1
- Platform: Linux-5.4.170+-x86_64-with-glibc2.31
- Python version: 3.9.12
- Huggingface_hub version: 0.8.1
- PyTorch version (GPU?): 1.11.0+cu113 (True)
- Tensorflow version (GPU?): 2.7.0 (False)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using GPU in script?: yes
- Using distributed or parallel set-up in script?: no

### Who can help?

@patil-suraj

### Information

- [ ] The official example scripts
- [X] My own modified scripts

### Tasks

- [ ] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [X] My own task or dataset (give details below)

### Reproduction

The following works as expected with torch 1.11, but generates the below error in version 1.12:

``` python
import io
import requests

import torch
from PIL import Image
from transformers import CLIPModel, CLIPProcessor


def load_image(bytes, max_width=100, max_height=100, force_rgb=True):
    """Create and optionally resize an image from bytes."""
    img = Image.open(io.BytesIO(bytes))

    width, height = img.size
    if width > max_width or height > max_height:
        img.thumbnail(size=(max_width, max_height))

    if img.mode != "RGB" and force_rgb:
        img = img.convert("RGB")

    return img

urls = [
    "https://placekitten.com/408/287",
    "https://placekitten.com/200/138"
]

images = [load_image(requests.get(url).content) for url in urls]

name = "openai/clip-vit-base-patch32"
proc = CLIPProcessor.from_pretrained(name)
model = CLIPModel.from_pretrained(name)
model.to(torch.device("cuda"))

inputs = proc(images=images, return_tensors="pt").to(torch.device("cuda"))
embeddings = model.get_image_features(**inputs).detach().cpu().numpy()
```

This results in:

``` log
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Input In [1], in <cell line: 41>()
     38 model.to(torch.device("cuda"))
     40 inputs = proc(images=images, return_tensors="pt").to(torch.device("cuda"))
---> 41 embeddings = model.get_image_features(**inputs).detach().cpu().numpy()

RuntimeError: CUDA error: an illegal memory access was encountered
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
```

Here is how I test the different versions, keep all else the same:

```
!pip uninstall -y torch torchvision torchaudio
!pip install --no-cache-dir torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
# !pip install --no-cache-dir torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
```

And here some more info about the hardware environment:

``` log

┌─────────── System Report ────────────┐
│ Linux                                │
│ Linux-5.4.170+-x86_64-with-glibc2.31 │
│                                      │
│ CPUs                                 │
│ ┌──────────┬────────┐                │
│ │ cores    │      # │                │
│ ├──────────┼────────┤                │
│ │ logical  │      2 │                │
│ │ physical │      1 │                │
│ │ usable   │ [0, 1] │                │
│ └──────────┴────────┘                │
│ RAM                                  │
│ ┌───────────┬──────┐                 │
│ │ kind      │   gb │                 │
│ ├───────────┼──────┤                 │
│ │ total     │  7.3 │                 │
│ │ available │  5.6 │                 │
│ │ used      │  1.5 │                 │
│ │ free      │  3.1 │                 │
│ │ active    │  2.7 │                 │
│ │ inactive  │  1.1 │                 │
│ │ buffers   │  0.4 │                 │
│ │ cached    │  2.4 │                 │
│ │ shared    │  0.0 │                 │
│ │ slab      │  0.3 │                 │
│ └───────────┴──────┘                 │
│ Disk (/home)                         │
│ ┌───────┬──────┐                     │
│ │ kind  │   gb │                     │
│ ├───────┼──────┤                     │
│ │ total │ 48.9 │                     │
│ │ used  │  2.3 │                     │
│ │ free  │ 46.6 │                     │
│ └───────┴──────┘                     │
│ GPU                                  │
│ ┌────────────────┬─────────────────┐ │
│ │ property       │           value │ │
│ ├────────────────┼─────────────────┤ │
│ │ name           │       Tesla K80 │ │
│ │ driver_version │      450.119.04 │ │
│ │ vbios_version  │  80.21.25.00.04 │ │
│ │ memory.total   │       11441 MiB │ │
│ │ memory.free    │       11438 MiB │ │
│ │ memory.used    │           3 MiB │ │
│ └────────────────┴─────────────────┘ │
│ Packages                             │
│ ┌──────────────┬──────────────┐      │
│ │ Package      │      Version │      │
│ ├──────────────┼──────────────┤      │
│ │ numpy        │       1.22.0 │      │
│ │ torch        │ 1.12.0+cu113 │      │
│ │ transformers │       4.20.1 │      │
│ └──────────────┴──────────────┘      │
└──────────────────────────────────────┘
```

### Expected behavior

The code should run without CUDA errors.
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.<|||||>Hey @buhrmann, there are some known issues with torch 1.12. Torch 1.12.1 was released 4 days ago, do you get the same issues with it?<|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.