DeepSpeedExamples icon indicating copy to clipboard operation
DeepSpeedExamples copied to clipboard

DeepSpeed Op Builder: Installed CUDA version 12.0 does not match the version torch was compiled with 11.8

Open yudonglee opened this issue 2 years ago • 1 comments

this is the error from training.log:

Traceback (most recent call last): File "/data/DeepSpeedExamples/applications/DeepSpeed-Chat/training/step1_supervised_finetuning/main.py", line 339, in main() File "/data/DeepSpeedExamples/applications/DeepSpeed-Chat/training/step1_supervised_finetuning/main.py", line 271, in main optimizer = AdamOptimizer(optimizer_grouped_parameters, File "/home/ps/anaconda3/envs/pt/lib/python3.10/site-packages/deepspeed/ops/adam/fused_adam.py", line 71, in init fused_adam_cuda = FusedAdamBuilder().load() File "/home/ps/anaconda3/envs/pt/lib/python3.10/site-packages/deepspeed/ops/op_builder/builder.py", line 449, in load return self.jit_load(verbose) File "/home/ps/anaconda3/envs/pt/lib/python3.10/site-packages/deepspeed/ops/op_builder/builder.py", line 462, in jit_load self.build_for_cpu = not assert_no_cuda_mismatch(self.name) File "/home/ps/anaconda3/envs/pt/lib/python3.10/site-packages/deepspeed/ops/op_builder/builder.py", line 93, in assert_no_cuda_mismatch raise Exception(f">- DeepSpeed Op Builder: Installed CUDA version {sys_cuda_version} does not match the " Exception: >- DeepSpeed Op Builder: Installed CUDA version 12.0 does not match the version torch was compiled with 11.8, unable to compile cuda/cpp extensions without a matching cuda version.

this is my command for installing pytorch:

conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

this is the output of the command for 'conda list | grep cuda':

cuda-cudart 11.8.89 0 nvidia cuda-cupti 11.8.87 0 nvidia cuda-libraries 11.8.0 0 nvidia cuda-nvrtc 11.8.89 0 nvidia cuda-nvtx 11.8.86 0 nvidia cuda-runtime 11.8.0 0 nvidia pytorch 2.0.0 py3.10_cuda11.8_cudnn8.7.0_0 pytorch pytorch-cuda 11.8 h7e8668a_3 pytorch pytorch-mutex 1.0 cuda pytorch

this is the output of the command for 'python -m torch.utils.collect_env':

Collecting environment information... PyTorch version: 2.0.0 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.3.0-1ubuntu1~22.04.1) 11.3.0 Clang version: Could not collect CMake version: Could not collect Libc version: glibc-2.35

Python version: 3.10.10 (main, Mar 21 2023, 18:45:11) [GCC 11.2.0] (64-bit runtime) Python platform: Linux-5.19.0-40-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: 12.0.140 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA A100-SXM4-80GB Nvidia driver version: 525.105.17 cuDNN version: Could not collect 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): 80 On-line CPU(s) list: 0-79 Vendor ID: GenuineIntel Model name: Intel(R) Xeon(R) Gold 6133 CPU @ 2.50GHz CPU family: 6 Model: 85 Thread(s) per core: 2 Core(s) per socket: 20 Socket(s): 2 Stepping: 4 CPU max MHz: 3000.0000 CPU min MHz: 1000.0000 BogoMIPS: 5000.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 pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 1.3 MiB (40 instances) L1i cache: 1.3 MiB (40 instances) L2 cache: 40 MiB (40 instances) L3 cache: 55 MiB (2 instances) NUMA node(s): 2 NUMA node0 CPU(s): 0-19,40-59 NUMA node1 CPU(s): 20-39,60-79 Vulnerability Itlb multihit: KVM: Mitigation: VMX disabled Vulnerability L1tf: Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable Vulnerability Mds: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Meltdown: Mitigation; PTI Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Retbleed: Mitigation; IBRS 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; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected Vulnerability Srbds: Not affected Vulnerability Tsx async abort: Mitigation; Clear CPU buffers; SMT vulnerable

Versions of relevant libraries: [pip3] numpy==1.23.5 [pip3] torch==2.0.0 [pip3] torchaudio==2.0.0 [pip3] torchvision==0.15.0 [conda] blas 1.0 mkl
[conda] ffmpeg 4.3 hf484d3e_0 pytorch [conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py310h7f8727e_0
[conda] mkl_fft 1.3.1 py310hd6ae3a3_0
[conda] mkl_random 1.2.2 py310h00e6091_0
[conda] numpy 1.23.5 py310hd5efca6_0
[conda] numpy-base 1.23.5 py310h8e6c178_0
[conda] pytorch 2.0.0 py3.10_cuda11.8_cudnn8.7.0_0 pytorch [conda] pytorch-cuda 11.8 h7e8668a_3 pytorch [conda] pytorch-mutex 1.0 cuda pytorch [conda] torchaudio 2.0.0 py310_cu118 pytorch [conda] torchtriton 2.0.0 py310 pytorch [conda] torchvision 0.15.0 py310_cu118 pytorch

Is there any way to fix this problem without downgrading my cuda version to 11.8 from 12.0 for my system environment ?

ps: I already installed pytorch with cuda 11.8 in my conda environment ('conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia')

yudonglee avatar Apr 20 '23 09:04 yudonglee

Nvidia recommends that the version match exactly, however we have found that matching major version is usually sufficient (e.g., 11.1 and 11.3 should be compatible). We have this assertion for mismatch of major version (e.g., 11.x and 12.x) because this is not well tested and could lead to incorrect results or errors. However, if you want to disable it anyway, you can comment out the assertion. See my comment here for how to do that: https://github.com/microsoft/DeepSpeed/issues/3223#issuecomment-1508966203

The recommended method if you do not wish to downgrade cuda is to build torch from source and compile with the cuda 12.0 on your system: https://github.com/pytorch/pytorch#from-source

mrwyattii avatar Apr 21 '23 20:04 mrwyattii

Nvidia recommends that the version match exactly, however we have found that matching major version is usually sufficient (e.g., 11.1 and 11.3 should be compatible). We have this assertion for mismatch of major version (e.g., 11.x and 12.x) because this is not well tested and could lead to incorrect results or errors. However, if you want to disable it anyway, you can comment out the assertion. See my comment here for how to do that: microsoft/DeepSpeed#3223 (comment)

The recommended method if you do not wish to downgrade cuda is to build torch from source and compile with the cuda 12.0 on your system: https://github.com/pytorch/pytorch#from-source

@mrwyattii Great~ Thank you for your help.

yudonglee avatar Apr 23 '23 07:04 yudonglee