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

Collate error when running Batch.from_data_list() in forward() method of model #9985

Open
eurunuela opened this issue Jan 28, 2025 · 0 comments
Labels

Comments

@eurunuela
Copy link
Contributor

eurunuela commented Jan 28, 2025

🐛 Describe the bug

I am trying to create graphs within the forward() method of my model using CNN decoder embeddings, but I am getting the following error:

W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0] Graph break from `Tensor.item()`, consider setting:
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0]     torch._dynamo.config.capture_scalar_outputs = True
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0] or:
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0]     env TORCHDYNAMO_CAPTURE_SCALAR_OUTPUTS=1
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0] to include these operations in the captured graph.
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0]
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0] Graph break: from user code at:
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0]   File "/home/eneko/conda_envs/nnunet/lib/python3.10/site-packages/torch_geometric/data/collate.py", line 170, in _collate
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0]     if incs.dim() > 1 or int(incs[-1]) != 0:
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0]
W0127 17:36:14.565000 549981 site-packages/torch/_dynamo/variables/tensor.py:776] [28/0]
*** TypeError: super(type, obj): obj must be an instance or subtype of type

Just so you have an idea, I am trying to batch these two graphs:

Graph 0:
  Type: <class 'torch_geometric.data.data.Data'>
  x shape: torch.Size([1310720, 32]), dtype: torch.float16, device: cuda:0
  edge_index shape: torch.Size([2, 32721128]), dtype: torch.int64, device: cuda:0
  edge_attr shape: torch.Size([32721128, 1]), dtype: torch.float32, device: cuda:0
Graph 1:
  Type: <class 'torch_geometric.data.data.Data'>
  x shape: torch.Size([1310720, 32]), dtype: torch.float16, device: cuda:0
  edge_index shape: torch.Size([2, 32721128]), dtype: torch.int64, device: cuda:0
  edge_attr shape: torch.Size([32721128, 1]), dtype: torch.float32, device: cuda:0

When I try to create the batch with random data I don't get this error. It only happens when I use the function in the forward() method.

Versions

PyTorch version: 2.5.1+cu124
Is debug build: False
CUDA used to build PyTorch: 12.4
ROCM used to build PyTorch: N/A

OS: Ubuntu 24.04.1 LTS (x86_64)
GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.39

Python version: 3.10.16 | packaged by conda-forge | (main, Dec  5 2024, 14:16:10) [GCC 13.3.0] (64-bit runtime)
Python platform: Linux-6.8.0-36-generic-x86_64-with-glibc2.39
Is CUDA available: True
CUDA runtime version: 12.0.140
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 550.100
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:                        39 bits physical, 48 bits virtual
Byte Order:                           Little Endian
CPU(s):                               16
On-line CPU(s) list:                  0-15
Vendor ID:                            GenuineIntel
Model name:                           11th Gen Intel(R) Core(TM) i7-11700KF @ 3.60GHz
CPU family:                           6
Model:                                167
Thread(s) per core:                   2
Core(s) per socket:                   8
Socket(s):                            1
Stepping:                             1
CPU(s) scaling MHz:                   29%
CPU max MHz:                          5000.0000
CPU min MHz:                          800.0000
BogoMIPS:                             7200.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 tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx avx512f avx512dq rdseed adx smap avx512ifma clflushopt intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm md_clear flush_l1d arch_capabilities
Virtualization:                       VT-x
L1d cache:                            384 KiB (8 instances)
L1i cache:                            256 KiB (8 instances)
L2 cache:                             4 MiB (8 instances)
L3 cache:                             16 MiB (1 instance)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-15
Vulnerability Gather data sampling:   Mitigation; Microcode
Vulnerability Itlb multihit:          Not affected
Vulnerability L1tf:                   Not affected
Vulnerability Mds:                    Not affected
Vulnerability Meltdown:               Not affected
Vulnerability Mmio stale data:        Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Reg file data sampling: Not affected
Vulnerability Retbleed:               Mitigation; Enhanced IBRS
Vulnerability Spec rstack overflow:   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; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS SW sequence; BHI Syscall hardening, KVM SW loop
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

Versions of relevant libraries:
[pip3] fft-conv-pytorch==1.2.0
[pip3] numpy==1.26.4
[pip3] nvidia-cublas-cu12==12.4.5.8
[pip3] nvidia-cuda-cupti-cu12==12.4.127
[pip3] nvidia-cuda-nvrtc-cu12==12.4.127
[pip3] nvidia-cuda-runtime-cu12==12.4.127
[pip3] nvidia-cudnn-cu12==9.1.0.70
[pip3] nvidia-cufft-cu12==11.2.1.3
[pip3] nvidia-curand-cu12==10.3.5.147
[pip3] nvidia-cusolver-cu12==11.6.1.9
[pip3] nvidia-cusparse-cu12==12.3.1.170
[pip3] nvidia-nccl-cu12==2.21.5
[pip3] nvidia-nvjitlink-cu12==12.4.127
[pip3] nvidia-nvtx-cu12==12.4.127
[pip3] torch==2.5.1
[pip3] torch_cluster==1.6.3
[pip3] torch_geometric==2.5.3
[pip3] torch_scatter==2.1.2
[pip3] torch_sparse==0.6.18
[pip3] triton==3.1.0
[conda] fft-conv-pytorch          1.2.0                    pypi_0    pypi
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-cublas-cu12        12.4.5.8                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.4.127                 pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.4.127                 pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.4.127                 pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.1.0.70                 pypi_0    pypi
[conda] nvidia-cufft-cu12         11.2.1.3                 pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.5.147               pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.6.1.9                 pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.3.1.170               pypi_0    pypi
[conda] nvidia-nccl-cu12          2.21.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.4.127                 pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.4.127                 pypi_0    pypi
[conda] torch                     2.5.1                    pypi_0    pypi
[conda] torch-cluster             1.6.3                    pypi_0    pypi
[conda] torch-geometric           2.5.3                    pypi_0    pypi
[conda] torch-scatter             2.1.2                    pypi_0    pypi
[conda] torch-sparse              0.6.18                   pypi_0    pypi
[conda] triton                    3.1.0                    pypi_0    pypi
@eurunuela eurunuela added the bug label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant