You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Seed nodes not the first ones in a NeighborLoader batch
Hello,
I have a problem with some NeighborLoaders where the input nodes are not the first ones in the batch.
I had opened a topic (#9822) on the Discussions here but maybe it's better to ask directly there. please let me know if I should delete this post or the other one.
I had a problem with my scripts where I was using different Neighborloaders and for some batches, the input nodes where not the first ones in the batch. To confirm that it was not just a problem from my data, I had run it on the example provided there and I encountered the same problem.
I run the beginning of the script to download the file and these lines at the end:
import argparse
import os.path as osp
import torch
import torch_geometric.transforms as T
from torch_geometric.datasets import OGB_MAG
from torch_geometric.loader import NeighborLoader
parser = argparse.ArgumentParser()
parser.add_argument('--use_hgt_loader', action='store_true')
args = parser.parse_args()
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
path = osp.join(osp.dirname(osp.realpath(__file__)), '../../data/OGB')
transform = T.ToUndirected(merge=True)
dataset = OGB_MAG(path, preprocess='metapath2vec', transform=transform)
# Already send node features/labels to GPU for faster access during sampling:
data = dataset[0].to(device, 'x', 'y')
train_input_nodes = ('paper', data['paper'].train_mask)
val_input_nodes = ('paper', data['paper'].val_mask)
kwargs = {'batch_size': 1024, 'num_workers': 6, 'persistent_workers': True}
train_loader = NeighborLoader(data, num_neighbors=[10] * 2, shuffle=True,
input_nodes=train_input_nodes, **kwargs)
batch = next(iter(train_loader))
batch_size = batch['paper'].batch_size
print(batch['paper'].input_id)
print(batch['paper'].n_id)
print("XXXXXXXXXXXX")
tmp = (batch['paper'].input_id == batch['paper'].n_id[:batch_size])
print(f"This tensor is of shape: {tmp.shape}")
print(f"The dtype is: {tmp.dtype}")
print(f"The sum is: {tmp.sum()}")
And the output is:
tensor([386806, 75261, 112052, ..., 423035, 408100, 602305])
tensor([386891, 75340, 112134, ..., 317089, 617977, 570291])
XXXXXXXXXXXX
This tensor is of shape: torch.Size([1024])
The dtype is: torch.bool
The sum is: 0
This seems to confirm, that the seed_nodes (i.e. those given by input_id) are not the first nodes in the batch in my instance.
Did I misunderstand what it should be ? Or do you think that there is a problem with my pyg installlation ? Or pyg-lib, torch-scatter etc. ? Could it be that it's not working when I have already some other scripts running in the background but on a different GPU ?
Versions
PyTorch version: 2.1.2+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A
OS: CentOS Linux 7 (Core) (x86_64)
GCC version: (GCC) 4.9.2
Clang version: Could not collect
CMake version: version 2.8.12.2
Libc version: glibc-2.17
Python version: 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-3.10.0-1160.81.1.el7.x86_64-x86_64-with-glibc2.17
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 2080 Ti
GPU 1: NVIDIA GeForce RTX 2080 Ti
Nvidia driver version: 510.39.01
cuDNN version: Probably one of the following:
/usr/lib64/libcudnn.so.8.4.1
/usr/lib64/libcudnn_adv_infer.so.8.4.1
/usr/lib64/libcudnn_adv_train.so.8.4.1
/usr/lib64/libcudnn_cnn_infer.so.8.4.1
/usr/lib64/libcudnn_cnn_train.so.8.4.1
/usr/lib64/libcudnn_ops_infer.so.8.4.1
/usr/lib64/libcudnn_ops_train.so.8.4.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Architecture : x86_64
Mode(s) opératoire(s) des processeurs : 32-bit, 64-bit
Boutisme : Little Endian
Processeur(s) : 72
Liste de processeur(s) en ligne : 0-71
Thread(s) par cœur : 2
Cœur(s) par socket : 18
Socket(s) : 2
Nœud(s) NUMA : 2
Identifiant constructeur : GenuineIntel
Famille de processeur : 6
Modèle : 85
Nom de modèle : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
Révision : 4
Vitesse du processeur en MHz : 2300.000
BogoMIPS : 4600.00
Virtualisation : VT-x
Cache L1d : 32K
Cache L1i : 32K
Cache L2 : 1024K
Cache L3 : 25344K
Nœud NUMA 0 de processeur(s) : 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70
Nœud NUMA 1 de processeur(s) : 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71
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 aperfmperf eagerfpu 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 epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba rsb_ctxsw ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid 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 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities
Seed nodes not the first ones in a NeighborLoader batch
Hello,
I have a problem with some NeighborLoaders where the input nodes are not the first ones in the batch.
I had opened a topic (#9822) on the Discussions here but maybe it's better to ask directly there. please let me know if I should delete this post or the other one.
I am using these versions of these packages:
I had a problem with my scripts where I was using different Neighborloaders and for some batches, the input nodes where not the first ones in the batch. To confirm that it was not just a problem from my data, I had run it on the example provided there and I encountered the same problem.
I run the beginning of the script to download the file and these lines at the end:
And the output is:
This seems to confirm, that the seed_nodes (i.e. those given by input_id) are not the first nodes in the batch in my instance.
Did I misunderstand what it should be ? Or do you think that there is a problem with my pyg installlation ? Or pyg-lib, torch-scatter etc. ? Could it be that it's not working when I have already some other scripts running in the background but on a different GPU ?
Versions
PyTorch version: 2.1.2+cu118
Is debug build: False
CUDA used to build PyTorch: 11.8
ROCM used to build PyTorch: N/A
OS: CentOS Linux 7 (Core) (x86_64)
GCC version: (GCC) 4.9.2
Clang version: Could not collect
CMake version: version 2.8.12.2
Libc version: glibc-2.17
Python version: 3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-3.10.0-1160.81.1.el7.x86_64-x86_64-with-glibc2.17
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 2080 Ti
GPU 1: NVIDIA GeForce RTX 2080 Ti
Nvidia driver version: 510.39.01
cuDNN version: Probably one of the following:
/usr/lib64/libcudnn.so.8.4.1
/usr/lib64/libcudnn_adv_infer.so.8.4.1
/usr/lib64/libcudnn_adv_train.so.8.4.1
/usr/lib64/libcudnn_cnn_infer.so.8.4.1
/usr/lib64/libcudnn_cnn_train.so.8.4.1
/usr/lib64/libcudnn_ops_infer.so.8.4.1
/usr/lib64/libcudnn_ops_train.so.8.4.1
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Architecture : x86_64
Mode(s) opératoire(s) des processeurs : 32-bit, 64-bit
Boutisme : Little Endian
Processeur(s) : 72
Liste de processeur(s) en ligne : 0-71
Thread(s) par cœur : 2
Cœur(s) par socket : 18
Socket(s) : 2
Nœud(s) NUMA : 2
Identifiant constructeur : GenuineIntel
Famille de processeur : 6
Modèle : 85
Nom de modèle : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
Révision : 4
Vitesse du processeur en MHz : 2300.000
BogoMIPS : 4600.00
Virtualisation : VT-x
Cache L1d : 32K
Cache L1i : 32K
Cache L2 : 1024K
Cache L3 : 25344K
Nœud NUMA 0 de processeur(s) : 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70
Nœud NUMA 1 de processeur(s) : 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71
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 aperfmperf eagerfpu 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 epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba rsb_ctxsw ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid 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 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities
Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] torch==2.1.2+cu118
[pip3] torch-cluster==1.6.3+pt21cu118
[pip3] torch_geometric==2.4.0
[pip3] torch-scatter==2.1.2+pt21cu118
[pip3] torch-sparse==0.6.18+pt21cu118
[pip3] torch-spline-conv==1.2.2+pt21cu118
[pip3] torchaudio==2.1.2+cu118
[pip3] torchvision==0.16.2+cu118
[pip3] triton==2.1.0
[conda] cudatoolkit 11.8.0 h6a678d5_0
[conda] cudnn 8.9.2.26 cuda11_0
[conda] numpy 1.26.4 pypi_0 pypi
[conda] torch 2.1.2+cu118 pypi_0 pypi
[conda] torch-cluster 1.6.3+pt21cu118 pypi_0 pypi
[conda] torch-geometric 2.4.0 pypi_0 pypi
[conda] torch-scatter 2.1.2+pt21cu118 pypi_0 pypi
[conda] torch-sparse 0.6.18+pt21cu118 pypi_0 pypi
[conda] torch-spline-conv 1.2.2+pt21cu118 pypi_0 pypi
[conda] torchaudio 2.1.2+cu118 pypi_0 pypi
[conda] torchvision 0.16.2+cu118 pypi_0 pypi
[conda] triton 2.1.0 pypi_0 pypi
The text was updated successfully, but these errors were encountered: