Memory usage of Block?

Hi,

I understand DGLGraph’s implementation uses continuous Node id space. That is, even if I have one single edge of 0 → 1000. The underlying data structure will take a node id space of 1000 nodes, and proportional amount of RAM space.

Does the same thing apply to Block data structure as well? (Did some profiling, seems not the case. But in the meanwhile, Blocks is based on DGLGraph implementation.)

Asking this b/c for some reason I need to construct a Block of subgraph from scratch during training. I wonder if I should do a mapping within the subgraph, to avoid DGL lib repeatedly creating a large node id space.

Hi @HuangLED, it is true that block is built on top of DGLGraph, but when you call to_block to get a block, the result is automatically compacted. E.g, in your case, 1000 will be mapped to 2 in the block such that the RAM space will not be wasted.

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