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

[DistNeighborLoader]TypeError: cannot unpack non-iterable NoneType object #9959

Open
Yukun-Cui opened this issue Jan 18, 2025 · 0 comments
Open
Labels

Comments

@Yukun-Cui
Copy link

Yukun-Cui commented Jan 18, 2025

🐛 Describe the bug

I'm developing a distributed inference server system with data partition across two machines. When using DistNeighborLoader as follow code, I've encountered an issue: it requires both machines to execute sampling operations synchronously and with the same number of executions. These conditions are difficult to meet in real-world scenarios. What solutions are available?

graph = LocalGraphStore.from_partition(...)
feature = LocalFeatureStore.from_partition(...)
partition_data = (feature, graph)
model = torch.load(...)
model.eval()
dist_context = DistContext(
    world_size=2,
    rank=rank,  // 0 or 1
    global_world_size=2,
    global_rank=rank,
    group_name=...
)
with torch.no_grad():
    while True:
        request = request_queue.get()  
        loader = DistNeighborLoader(
            data=partition_data,
            input_nodes=request,
            current_ctx=dist_context
            num_neighbors=[-1],
            batch_size=len(request),
            master_addr=...,
            master_port=...,
        )
        subgraph = next(iter(loader))
        out = model(subgraph.x, subgraph.edge_index)
        result_queue.put()

If the execution times of DistNeighborLoader are not the same, the following error will be reported:

Exception in thread Thread-1 (server):
Traceback (most recent call last):
  File ".../main.py", line 46, in server
    loader = DistNeighborLoader(
                   ^^^^^^^^^^^^^^
  File ".../python3.12/site-packages/torch_geometric/distributed/dist_neighbor_loader.py", line 90, in __init__
    DistLoader.__init__(
  File ".../python3.12/site-packages/torch_geometric/distributed/dist_loader.py", line 92, in __init__
    self.worker_init_fn(0)
  File ".../python3.12/site-packages/torch_geometric/distributed/dist_loader.py", line 135, in worker_init_fn
    self.dist_sampler.register_sampler_rpc()
  File ".../python3.12/site-packages/torch_geometric/distributed/dist_neighbor_sampler.py", line 123, in register_sampler_rpc
    partition2workers = rpc_partition_to_workers(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../python3.12/site-packages/torch/distributed/rpc/api.py", line 94, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File ".../python3.12/site-packages/torch_geometric/distributed/rpc.py", line 123, in rpc_partition_to_workers
    for worker_name, (role, nparts, idx) in gathered_results.items():
                     ^^^^^^^^^^^^^^^^^^^
TypeError: cannot unpack non-iterable NoneType object

Versions

Collecting environment information...
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 20.04.6 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Clang version: 10.0.0-4ubuntu1 
CMake version: version 3.25.0
Libc version: glibc-2.31

Python version: 3.12.8 | packaged by Anaconda, Inc. | (main, Dec 11 2024, 16:31:09) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.0-117-generic-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 535.183.01
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
架构:                                x86_64
CPU 运行模式:                        32-bit, 64-bit
字节序:                              Little Endian
Address sizes:                        46 bits physical, 48 bits virtual
CPU:                                  20
在线 CPU 列表:                       0-19
每个核的线程数:                      2
每个座的核数:                        10
座:                                  1
NUMA 节点:                           1
厂商 ID:                             GenuineIntel
CPU 系列:                            6
型号:                                85
型号名称:                            Intel(R) Core(TM) i9-10900X CPU @ 3.70GHz
步进:                                7
CPU MHz:                             3700.000
CPU 最大 MHz:                        4700.0000
CPU 最小 MHz:                        1200.0000
BogoMIPS:                            7399.70
虚拟化:                              VT-x
L1d 缓存:                            320 KiB
L1i 缓存:                            320 KiB
L2 缓存:                             10 MiB
L3 缓存:                             19.3 MiB
NUMA 节点0 CPU:                      0-19
Vulnerability Gather data sampling:   Mitigation; Microcode
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 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 and seccomp
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 SW loop, KVM SW loop
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Mitigation; TSX disabled
标记:                                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 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 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad 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 hwp hwp_act_window hwp_epp hwp_pkg_req avx512_vnni md_clear flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==2.2.1
[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+pt25cu124
[pip3] torch-geometric==2.6.1
[pip3] torch_scatter==2.1.2+pt25cu124
[pip3] torch_sparse==0.6.18+pt25cu124
[pip3] torch_spline_conv==1.2.2+pt25cu124
[pip3] triton==3.1.0
[conda] numpy                     2.2.1                    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+pt25cu124          pypi_0    pypi
[conda] torch-geometric           2.6.1                    pypi_0    pypi
[conda] torch-scatter             2.1.2+pt25cu124          pypi_0    pypi
[conda] torch-sparse              0.6.18+pt25cu124          pypi_0    pypi
[conda] torch-spline-conv         1.2.2+pt25cu124          pypi_0    pypi
[conda] triton                    3.1.0                    pypi_0    pypi
@Yukun-Cui Yukun-Cui added the bug label Jan 18, 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