Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] error in compile sdxl unet using nexfort #1107

Open
zhangvia opened this issue Sep 9, 2024 · 0 comments
Open

[Bug] error in compile sdxl unet using nexfort #1107

zhangvia opened this issue Sep 9, 2024 · 0 comments
Labels
Request-bug Something isn't working

Comments

@zhangvia
Copy link

zhangvia commented Sep 9, 2024

Your current environment information

Collecting environment information...
PyTorch version: 2.4.1+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A

OneFlow version: none
Nexfort version: 0.1.dev271
OneDiff version: 1.2.0
OneDiffX version: none

OS: Ubuntu 20.04.2 LTS (x86_64)
GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.31

Python version: 3.9.18 (main, Sep 11 2023, 13:41:44) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.2.14-050214-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 11.8.89
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA GeForce RTX 4090
GPU 1: NVIDIA GeForce RTX 4090
GPU 2: NVIDIA GeForce RTX 4090
GPU 3: NVIDIA GeForce RTX 4090
GPU 4: NVIDIA GeForce RTX 4090
GPU 5: NVIDIA GeForce RTX 4090
GPU 6: NVIDIA GeForce RTX 4090
GPU 7: NVIDIA GeForce RTX 4090

Nvidia driver version: 535.161.07
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
Byte Order: Little Endian
Address sizes: 46 bits physical, 48 bits virtual
CPU(s): 72
On-line CPU(s) list: 0-71
Thread(s) per core: 2
Core(s) per socket: 18
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6240 CPU @ 2.60GHz
Stepping: 7
CPU MHz: 1019.904
CPU max MHz: 3900.0000
CPU min MHz: 1000.0000
BogoMIPS: 5200.00
Virtualization: VT-x
L1d cache: 1.1 MiB
L1i cache: 1.1 MiB
L2 cache: 36 MiB
L3 cache: 49.5 MiB
NUMA node0 CPU(s): 0-17,36-53
NUMA node1 CPU(s): 18-35,54-71
Vulnerability L1tf: Not affected
Vulnerability Mds: Not affected
Vulnerability Meltdown: 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
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 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 pku ospke avx512_vnni md_clear flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] diffusers==0.25.1
[pip3] numpy==1.26.0
[pip3] onnx==1.15.0
[pip3] onnxruntime-gpu==1.16.3
[pip3] pytorch-lightning==2.1.3
[pip3] torch==2.4.1+cu118
[pip3] torchaudio==2.4.1+cu118
[pip3] torchmetrics==1.3.0.post0
[pip3] torchvision==0.19.1+cu118
[pip3] transformers==4.44.2
[pip3] triton==3.0.0
[conda] blas 1.0 mkl http://mirrors.aliyun.com/anaconda/pkgs/main
[conda] ffmpeg 4.3 hf484d3e_0 http://mirrors.aliyun.com/anaconda/cloud/pytorch
[conda] mkl 2023.1.0 h213fc3f_46344 http://mirrors.aliyun.com/anaconda/pkgs/main
[conda] mkl-service 2.4.0 py39h5eee18b_1 http://mirrors.aliyun.com/anaconda/pkgs/main
[conda] mkl_fft 1.3.8 py39h5eee18b_0 http://mirrors.aliyun.com/anaconda/pkgs/main
[conda] mkl_random 1.2.4 py39hdb19cb5_0 http://mirrors.aliyun.com/anaconda/pkgs/main
[conda] numpy 1.26.0 py39h5f9d8c6_0 http://mirrors.aliyun.com/anaconda/pkgs/main
[conda] numpy-base 1.26.0 py39hb5e798b_0 http://mirrors.aliyun.com/anaconda/pkgs/main
[conda] pytorch-cuda 11.8 h7e8668a_5 http://mirrors.aliyun.com/anaconda/cloud/pytorch
[conda] pytorch-lightning 2.1.3 pypi_0 pypi
[conda] pytorch-mutex 1.0 cuda http://mirrors.aliyun.com/anaconda/cloud/pytorch
[conda] torch 2.4.1+cu118 pypi_0 pypi
[conda] torchaudio 2.4.1+cu118 pypi_0 pypi
[conda] torchmetrics 1.3.0.post0 pypi_0 pypi
[conda] torchvision 0.19.1+cu118 pypi_0 pypi
[conda] triton 3.0.0 pypi_0 pypi

🐛 Describe the bug

error log:

sample, res_samples,ref_attn_idx = downsample_block(
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/media/74nvme/research/ArcVirtualTryon/models/models/unet_3d_blocks.py", line 452, in forward
    hidden_states,ref_attn_idx = attn(
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/media/74nvme/research/VirtualTryon/models/models/transformer_3d.py", line 143, in forward
    hidden_states,ref_attn_idx = block(
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1553, in _wrapped_call_impl
    return self._call_impl(*args, **kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1562, in _call_impl
    return forward_call(*args, **kwargs)
  File "/media/74nvme/research/VirtualTryon/models/models/attention_3d.py", line 400, in forward
    reference_feature = reference_features[ref_attn_idx[0]]
  File "/media/74nvme/research/VirtualTryon/models/models/attention_3d.py", line 400, in torch_dynamo_resume_in_forward_at_400
    reference_feature = reference_features[ref_attn_idx[0]]
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_dynamo/eval_frame.py", line 600, in _fn
    return fn(*args, **kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_functorch/aot_autograd.py", line 987, in forward
    return compiled_fn(full_args)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_functorch/_aot_autograd/runtime_wrappers.py", line 217, in runtime_wrapper
    all_outs = call_func_at_runtime_with_args(
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_functorch/_aot_autograd/utils.py", line 120, in call_func_at_runtime_with_args
    out = normalize_as_list(f(args))
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_functorch/_aot_autograd/runtime_wrappers.py", line 451, in wrapper
    return compiled_fn(runtime_args)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_inductor/codecache.py", line 1131, in __call__
    return self.current_callable(inputs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_inductor/compile_fx.py", line 944, in run
    return model(new_inputs)
  File "/tmp/torchinductor_root/fe/cfe3caoq35se5raepmzvrsbzez3363u3hhpujbam2zyuhtll5l4l.py", line 772, in call
    buf8.copy_(arg5_1)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/utils/_stats.py", line 21, in wrapper
    return fn(*args, **kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 724, in __torch_dispatch__
    return func(*args, **kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_ops.py", line 667, in __call__
    return self_._op(*args, **kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/utils/_stats.py", line 21, in wrapper
    return fn(*args, **kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1061, in __torch_dispatch__
    return self.dispatch(func, types, args, kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1450, in dispatch
    return self._cached_dispatch_impl(func, types, args, kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1153, in _cached_dispatch_impl
    output = self._dispatch_impl(func, types, args, kwargs)
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1539, in _dispatch_impl
    (flat_args, flat_arg_fake_tensors) = self.validate_and_convert_non_fake_tensors(
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1832, in validate_and_convert_non_fake_tensors
    validated_args = [validate(a) for a in flat_args]
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1832, in <listcomp>
    validated_args = [validate(a) for a in flat_args]
  File "/media/74nvme/software/miniconda3/envs/model/lib/python3.9/site-packages/torch/_subclasses/fake_tensor.py", line 1822, in validate
    raise AssertionError(
AssertionError: Please convert all Tensors to FakeTensors first or instantiate FakeTensorMode with 'allow_non_fake_inputs'. Found in aten.copy_.default(tensor([...], device='cuda:0', size=(2,)), FakeTensor(..., size=(2,)))

i'm using nexfort to accelerate this repo IDM-VTON, i compile the tryon unet which is based on sd-xl. but add two more input variables. one is features from the other unet, one is the idx to get the current feature which current attention block use. the error log is above.

i think the reason maybe the idx is int, so i change the idx to tensor. but it still gets error when i use idx[0] as a subscript. is there anyway to solve this?

@zhangvia zhangvia added the Request-bug Something isn't working label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant