Repository: dmlc/dgl

Issue:
[GraphBolt] DistDGL requires graphbolt available
## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
For now, `GraphBolt` so is required to be available for DistDGL.
```
File "/home/ubuntu/workspace/dgl/examples/pytorch/graphsage/dist/train_dist.py", line 13, in <module>                   
    import dgl                                                                                                            
  File "/home/ubuntu/workspace/dgl/python/dgl/__init__.py", line 18, in <module>                                          
    from . import (                                                                                                       
  File "/home/ubuntu/workspace/dgl/python/dgl/dataloading/__init__.py", line 12, in <module>                              
    from .dataloader import *                                                                                             
  File "/home/ubuntu/workspace/dgl/python/dgl/dataloading/dataloader.py", line 24, in <module>                            
    from ..distributed import DistGraph                                                                                   
  File "/home/ubuntu/workspace/dgl/python/dgl/distributed/__init__.py", line 5, in <module>                               
    from .dist_graph import DistGraph, DistGraphServer, edge_split, node_split
  File "/home/ubuntu/workspace/dgl/python/dgl/distributed/dist_graph.py", line 37, in <module>
    from .partition import (
  File "/home/ubuntu/workspace/dgl/python/dgl/distributed/partition.py", line 29, in <module>
    from .. import graphbolt
  File "/home/ubuntu/workspace/dgl/python/dgl/graphbolt/__init__.py", line 38, in <module>
    load_graphbolt()
  File "/home/ubuntu/workspace/dgl/python/dgl/graphbolt/__init__.py", line 28, in load_graphbolt
    raise FileNotFoundError(
FileNotFoundError: Cannot find DGL C++ graphbolt library at /home/ubuntu/workspace/dgl/build/graphbolt/libgraphbolt_pytorc
h_2.0.1.so
```
## To Reproduce

Steps to reproduce the behavior:

1. build upon latest DGL.
2. run dist train

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment

 - DGL Version (e.g., 1.0):
 - Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3):
 - OS (e.g., Linux):
 - How you installed DGL (`conda`, `pip`, source):
 - Build command you used (if compiling from source):
 - Python version:
 - CUDA/cuDNN version (if applicable):
 - GPU models and configuration (e.g. V100):
 - Any other relevant information:

## Additional context

<!-- Add any other context about the problem here. -->



Discussion:

Resolving patch:
diff --git a/python/dgl/distributed/partition.py b/python/dgl/distributed/partition.py
--- a/python/dgl/distributed/partition.py
+++ b/python/dgl/distributed/partition.py
@@ -25,8 +25,6 @@
     RangePartitionBook,
 )
 
-if F.backend_name == "pytorch":
-    from .. import graphbolt
 
 RESERVED_FIELD_DTYPE = {
     "inner_node": F.uint8,  # A flag indicates whether the node is inside a partition.
@@ -1220,6 +1218,9 @@ def convert_dgl_partition_to_csc_sampling_graph(part_config):
     part_config : str
         The partition configuration JSON file.
     """
+    # As only this function requires GraphBolt for now, let's import here.
+    from .. import graphbolt
+
     part_meta = _load_part_config(part_config)
     num_parts = part_meta["num_parts"]
 


Test patch: