Repository: pytorch
Issue: RuntimeError in use torch 2.1.0 cuda 11.8 
Labels: module: cuda,triaged

### 🐛 Describe the bug

I use torch 2.1.0+cu118 and xformers==0.22.post+cu118 ，in [langchain-chatchat-0.2.7version](https://github.com/chatchat-space/Langchain-Chatchat) get error.

error message:
```
==============================Langchain-Chatchat Configuration==============================
操作系统：Linux-5.19.0-45-generic-x86_64-with-glibc2.35.
python版本：3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0]
项目版本：v0.2.7
langchain版本：0.0.336. fastchat版本：0.2.32


当前使用的分词器：ChineseRecursiveTextSplitter
当前启动的LLM模型：['chatglm3-6b'] @ cuda
{'device': 'cuda',
 'host': '0.0.0.0',
 'model_path': '/home/ai/llm/chatglm3-6b',
 'port': 20004}
当前Embbedings模型： m3e-base @ cuda
==============================Langchain-Chatchat Configuration==============================

2023-11-16 14:10:10 | ERROR | stderr | 
2023-11-16 14:10:11 | ERROR | stderr | Process model_worker - chatglm3-6b:
2023-11-16 14:10:11 | ERROR | stderr | Traceback (most recent call last):
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
2023-11-16 14:10:11 | ERROR | stderr |     self.run()
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/multiprocessing/process.py", line 108, in run
2023-11-16 14:10:11 | ERROR | stderr |     self._target(*self._args, **self._kwargs)
2023-11-16 14:10:11 | ERROR | stderr |   File "/home/ai/langchain-project/Langchain-Chatchat-0.2.7/startup.py", line 383, in run_model_worker
2023-11-16 14:10:11 | ERROR | stderr |     app = create_model_worker_app(log_level=log_level, **kwargs)
2023-11-16 14:10:11 | ERROR | stderr |   File "/home/ai/langchain-project/Langchain-Chatchat-0.2.7/startup.py", line 211, in create_model_worker_app
2023-11-16 14:10:11 | ERROR | stderr |     worker = ModelWorker(
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/fastchat/serve/model_worker.py", line 74, in __init__
2023-11-16 14:10:11 | ERROR | stderr |     self.model, self.tokenizer = load_model(
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/fastchat/model/model_adapter.py", line 320, in load_model
2023-11-16 14:10:11 | ERROR | stderr |     model.to(device)
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/transformers/modeling_utils.py", line 2271, in to
2023-11-16 14:10:11 | ERROR | stderr |     return super().to(*args, **kwargs)
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1160, in to
2023-11-16 14:10:11 | ERROR | stderr |     return self._apply(convert)
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
2023-11-16 14:10:11 | ERROR | stderr |     module._apply(fn)
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
2023-11-16 14:10:11 | ERROR | stderr |     module._apply(fn)
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
2023-11-16 14:10:11 | ERROR | stderr |     module._apply(fn)
2023-11-16 14:10:11 | ERROR | stderr |   [Previous line repeated 3 more times]
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/torch/nn/modules/module.py", line 833, in _apply
2023-11-16 14:10:11 | ERROR | stderr |     param_applied = fn(param)
2023-11-16 14:10:11 | ERROR | stderr |   File "/root/anaconda3/envs/env-langchain-chatchat-0.2.7-fschat/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1158, in convert
2023-11-16 14:10:11 | ERROR | stderr |     return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
2023-11-16 14:10:11 | ERROR | stderr | RuntimeError: handle_0 INTERNAL ASSERT FAILED at "../c10/cuda/driver_api.cpp":15, please report a bug to PyTorch.
```


### Versions

```
Collecting environment information...
PyTorch version: 2.1.0+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.27.7
Libc version: glibc-2.35

Python version: 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.19.0-45-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: 
GPU 0: NVIDIA Graphics Device
GPU 1: NVIDIA Graphics Device

Nvidia driver version: 520.61.05
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.1
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.1
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.1
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.1
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
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd amd_ppin brs arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
Virtualization:                  AMD-V
L1d cache:                       1 MiB (32 instances)
L1i cache:                       1 MiB (32 instances)
L2 cache:                        16 MiB (32 instances)
L3 cache:                        256 MiB (8 instances)
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 store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected

Versions of relevant libraries:
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.24.1
[pip3] onnx==1.15.0
[pip3] onnxruntime==1.15.1
[pip3] rapidocr-onnxruntime==1.3.8
[pip3] torch==2.1.0+cu118
[pip3] torchaudio==2.1.0+cu118
[pip3] torchvision==0.16.0+cu118
[pip3] triton==2.1.0
[conda] numpy                     1.24.1                   pypi_0    pypi
[conda] torch                     2.1.0+cu118              pypi_0    pypi
[conda] torchaudio                2.1.0+cu118              pypi_0    pypi
[conda] torchvision               0.16.0+cu118             pypi_0    pypi
[conda] triton                    2.1.0                    pypi_0    pypi
```

cc @ptrblck