Why the training time of sampling methods for RGCN is slower than normal training RGCN?

Hi, for RGCN Entity Classification task, dgl/README.md at master · dmlc/dgl · GitHub
I tested the training time of normal training and training with minibatch, but the training time with minibatch is slower than normal training? Why happened this result? For my understanding, shouldn’t the sampling method is faster than full training?

python entity_sample.py -d aifb --wd 0 --gpu 0 --fanout='20,20' --batch-size 128
Total training time: : 3.6941s | Mean training time: : 0.0348s

python entity.py -d aifb --wd 0 --gpu 0
Total training time: : 1.7009s | Mean training time: : 0.0129s

python entity_sample.py -d mutag --n-bases 30 --gpu 0 --batch-size 64 --fanout='-1,-1' --use-self-loop --n-epochs 20 --dropout 0.5
Total training time: : 3.7873s | Mean training time: : 0.1016s

python entity.py -d mutag --n-bases 30 --gpu 0
Total training time: : 1.2327s | Mean training time: : 0.0152s

python entity_sample.py -d bgs --n-bases 40 --gpu 0 --fanout='-1,-1'  --n-epochs=16 --batch-size=16 --dropout 0.3
Total training time: : 5.3474s | Mean training time: : 0.1831s

python entity.py -d bgs --n-bases 40 --gpu 0
Total training time: : 2.3911s | Mean training time: : 0.0385s

python entity_sample.py -d am --n-bases 40 --gpu 0 --fanout='35,35' --batch-size 64 --n-hidden 16 --use-self-loop --n-epochs=20 --dropout 0.7
Total training time: : 10.7282s | Mean training time: : 0.3294s

python entity.py -d am --n-bases 40 --n-hidden 10 --gpu 0
Total training time: : 10.6672s | Mean training time: : 0.2053s

The example only serves as a demonstration for sampling-based training. Sampling-based training is most useful when the graph is too large for full-graph GPU training while the datasets used in this example are quite small. Sampling-based training is not necessarily faster than full-graph training.

I see, thanks. Is there any larger dataset to test in DGL?

You might find this helpful: dgl/examples/pytorch/ogb/ogbn-mag at master · dmlc/dgl · GitHub

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.