DeepGraphLearning / graphvite

GraphVite: A General and High-performance Graph Embedding System
https://graphvite.io
Apache License 2.0
1.23k stars 154 forks source link

slow training on wikidata5m knowledge graph #71

Open saedr opened 4 years ago

saedr commented 4 years ago

Hi,

I'm using the following code snippet to compute the embeddings of the wikidata5m dataset.

import graphvite as gv

KG = gv.graph.KnowledgeGraph()
KG.load(gv.dataset.wikidata5m.train)

solver = gv.solver.KnowledgeGraphSolver(dim=128)
solver.build(KG)
solver.train()

But this is very slow.

Is this normal because wikidata5m is very large or am I missing something?

KiddoZhu commented 4 years ago

The code snap seems good. How slow is it? The benchmark here shows 2.1 hrs on 4 V100 GPUs, with the same negative samples and epochs as your default hyperparameters.

If you can afford some accuracy loss, you may reduce the number of negative samples and also the training epochs. I think num_negative=32 and num_epoch=500 would be acceptably good.