siliconflow / onediff

OneDiff: An out-of-the-box acceleration library for diffusion models.
https://github.com/siliconflow/onediff/wiki
Apache License 2.0
1.71k stars 105 forks source link

[Bug] cublas_fused_mlp_util.cuh:297] Check failed: cublasLtMatmulAlgoGetHeuristic( cuda_stream->cublas_lt_handle(), #1121

Open LukeLIN-web opened 1 month ago

LukeLIN-web commented 1 month ago

I am running onediff/benchmarks/image_to_video.py

Your current environment information

Collecting environment information... PyTorch version: 2.1.0a0+29c30b1 Is debug build: False CUDA used to build PyTorch: 12.2 ROCM used to build PyTorch: N/A

OneFlow version: path: ['/usr/local/lib/python3.10/dist-packages/oneflow'], version: 0.9.1.dev20240803+cu122, git_commit: d23c061, cmake_build_type: Release, rdma: True, mlir: True, enterprise: False Nexfort version: none OneDiff version: 1.2.1.dev24 OneDiffX version: 1.2.1.dev24+g9231f556

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.1 Libc version: glibc-2.35

Python version: 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (64-bit runtime) Python platform: Linux-4.15.0-213-generic-x86_64-with-glibc2.35 Is CUDA available: True CUDA runtime version: 12.2.128 CUDA_MODULE_LOADING set to: LAZY GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2080 Ti GPU 1: NVIDIA GeForce RTX 2080 Ti GPU 2: NVIDIA GeForce RTX 2080 Ti GPU 3: NVIDIA GeForce RTX 2080 Ti GPU 4: NVIDIA GeForce RTX 2080 Ti GPU 5: NVIDIA GeForce RTX 2080 Ti GPU 6: NVIDIA GeForce RTX 2080 Ti GPU 7: NVIDIA GeForce RTX 2080 Ti

Nvidia driver version: 535.113.01 cuDNN version: Probably one of the following: /usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.4 /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.4 /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.4 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.4 /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.4 /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.4 /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.4 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): 64 On-line CPU(s) list: 0-63 Vendor ID: GenuineIntel Model name: Intel(R) Xeon(R) Gold 5218 CPU @ 2.30GHz CPU family: 6 Model: 85 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 2 Stepping: 7 Frequency boost: enabled CPU max MHz: 2301.0000 CPU min MHz: 1000.0000 BogoMIPS: 4600.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 intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid 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 pku ospke avx512_vnni md_clear flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 1 MiB (32 instances) L1i cache: 1 MiB (32 instances) L2 cache: 32 MiB (32 instances) L3 cache: 44 MiB (2 instances) NUMA node(s): 2 NUMA node0 CPU(s): 0-15,32-47 NUMA node1 CPU(s): 16-31,48-63 Vulnerability Itlb multihit: KVM: Mitigation: Split huge pages Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Mitigation; Clear CPU buffers; SMT vulnerable Vulnerability Retbleed: Mitigation; Enhanced IBRS 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: Mitigation; TSX disabled

Versions of relevant libraries: [pip3] diffusers==0.30.3 [pip3] numpy==1.22.2 [pip3] onnx==1.14.0 [pip3] pytorch-quantization==2.1.2 [pip3] torch==2.1.0a0+29c30b1 [pip3] torch-tensorrt==2.0.0.dev0 [pip3] torchdata==0.7.0a0 [pip3] torchtext==0.16.0a0 [pip3] torchvision==0.16.0a0 [pip3] transformers==4.45.2 [pip3] triton==2.1.0+440fd1b [conda] Could not collect

🐛 Describe the bug

Begin warmup
F20241015 22:39:38.552948 13657 cublas_fused_mlp_util.cuh:297] Check failed: cublasLtMatmulAlgoGetHeuristic( cuda_stream->cublas_lt_handle(), matmul_grad_cache->operation_desc, matmul_grad_cache->cublas_a_desc, matmul_grad_cache->cublas_b_desc, matmul_grad_cache->cublas_c_desc, matmul_grad_cache->cublas_c_desc, matmul_grad_cache->cublas_preference, 1, &algo_heuristic_result, &algo_returned_result) : CUBLAS_STATUS_INVALID_VALUE (7) 
*** Check failure stack trace: ***
    @     0x7efcb9d7a1ca  google::LogMessage::Fail()
    @     0x7efcb9d7d101  google::LogMessage::SendToLog()
    @     0x7efcb9d79cf9  google::LogMessage::Flush()
    @     0x7efcb9d7d9e9  google::LogMessageFatal::~LogMessageFatal()
    @     0x7efcb343d733  oneflow::(anonymous namespace)::SetCublasAttr()
    @     0x7efcb343fabf  oneflow::(anonymous namespace)::FusedMatmulBiasKernel::Compute()
    @     0x7efcb54f6675  oneflow::one::StatefulOpKernel::Compute()
    @     0x7efcb1eb08da  _ZZN7oneflow2vm21OpCallInstructionUtil7ComputeEPNS0_23OpCallInstructionPolicyEPNS0_6StreamEbbENKUlvE_clEv
    @     0x7efcb1eb2208  oneflow::vm::OpCallInstructionUtil::Compute()
    @     0x7efcb1eaedfd  _ZZN7oneflow2vm23OpCallInstructionPolicy7ComputeEPNS0_11InstructionEENKUlPKcE_clES5_.constprop.0
    @     0x7efcb1eaf659  oneflow::vm::OpCallInstructionPolicy::Compute()
    @     0x7efcb1ea8278  oneflow::vm::Instruction::Compute()
    @     0x7efcb1ea4f75  oneflow::vm::EpStreamPolicyBase::Run()
    @     0x7efcb1f027d9  oneflow::vm::ThreadCtx::TryReceiveAndRun()
    @     0x7efcb1f06f5d  oneflow::(anonymous namespace)::WorkerLoop()
    @     0x7efcb1f076e8  _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN7oneflow2vm9ThreadCtxERKSt8functionIFvS6_EEES6_ZNS3_14VirtualMachine15CreateThreadCtxENS3_6SymbolINS3_6DeviceEEENS3_10StreamTypeEmEUlS6_E3_EEEEE6_M_runEv
    @     0x7efcb9d8f780  execute_native_thread_routine
    @     0x7efdff1e3b43  (unknown)
    @     0x7efdff274bb4  clone
Stack trace (most recent call last) in thread 13657:
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb9d8f77f, in 
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1f076e7, in 
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1f06f5c, in 
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1f027d8, in vm::ThreadCtx::TryReceiveAndRun()
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1ea4f74, in vm::EpStreamPolicyBase::Run(vm::Instruction*) const
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1ea8277, in vm::Instruction::Compute()
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1eaf658, in vm::OpCallInstructionPolicy::Compute(vm::Instruction*)
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1eaedfc, in 
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1eb2207, in vm::OpCallInstructionUtil::Compute(vm::OpCallInstructionPolicy*, vm::Stream*, bool, bool)
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb1eb08d9, in vm::OpCallInstructionUtil::Compute(vm::OpCallInstructionPolicy*, vm::Stream*, bool, bool)::{lambda()#1}::operator()() const
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb54f6674, in StatefulOpKernel::Compute(eager::CallContext*, ep::Stream*, user_op::OpKernel const*, user_op::OpKernelState*, user_op::OpKernelCache const*) const
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb343fabe, in (anonymous namespace)::FusedMatmulBiasKernel::Compute(user_op::KernelComputeContext*, user_op::OpKernelState*, user_op::OpKernelCache const*) const
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb343d732, in (anonymous namespace)::SetCublasAttr(ep::CudaStream*, (anonymous namespace)::CublasFusedMLPKernelCache const*, cublasComputeType_t, cudaDataType_t, bool, ep::primitive::BlasTransposeType, ep::primitive::BlasTransposeType, cublasLtEpilogue_t, void const*, void const*, unsigned long, unsigned long, unsigned long, long, long, long)
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb9d7d9e8, in 
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb9d79cf8, in 
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb9d7d100, in 
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efcb9d7a1c9, in 
   Object "/usr/local/lib/python3.10/dist-packages/oneflow/../oneflow.libs/liboneflow-82f4960f.so", at 0x7efca9eed2fa, in 

Aborted (Signal sent by tkill() 10092 0)
Aborted (core dumped)
LukeLIN-web commented 1 month ago

I use python3 benchmarks/image_to_video.py --model ~/.cache/huggingface/hub/models--siliconflow--stable-video-diffusion-img2vid-xt-int8/snapshots/37b3b3943ce72c5c0b2ea827072aa6a22c1f8cc3/ --deepcache --input-image output_image.png --output-video output_image.mp4

It has Loading pipeline components...: 40%|█████████████████████▏ | 2/5 [00:00<00:00, 4.92it/s] Traceback (most recent call last): File "/root/share/onediff/benchmarks/image_to_video.py", line 319, in main() File "/root/share/onediff/benchmarks/image_to_video.py", line 176, in main pipe = load_pipe( File "/root/share/onediff/benchmarks/image_to_video.py", line 129, in load_pipe pipe = pipeline_cls.from_pretrained( File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(args, kwargs) File "/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/pipeline_utils.py", line 876, in from_pretrained loaded_sub_model = load_sub_model( File "/usr/local/lib/python3.10/dist-packages/diffusers/pipelines/pipeline_loading_utils.py", line 700, in load_sub_model loaded_sub_model = load_method(os.path.join(cached_folder, name), loading_kwargs) File "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(args, **kwargs) File "/usr/local/lib/python3.10/dist-packages/diffusers/models/modeling_utils.py", line 747, in from_pretrained unexpected_keys = load_model_dict_into_meta( File "/usr/local/lib/python3.10/dist-packages/diffusers/models/model_loading_utils.py", line 159, in load_model_dict_into_meta set_module_tensor_to_device(model, param_name, device, value=param, dtype=dtype) File "/usr/local/lib/python3.10/dist-packages/accelerate/utils/modeling.py", line 365, in set_module_tensor_to_device new_value = param_cls(new_value, requires_grad=old_value.requires_grad).to(device) File "/usr/local/lib/python3.10/dist-packages/torch/nn/parameter.py", line 39, in new return torch.Tensor._make_subclass(cls, data, requires_grad) RuntimeError: Only Tensors of floating point and complex dtype can require gradients