MCPcopy Create free account
hub / github.com/alibaba/GraphScope / graphlearn_torch

Method graphlearn_torch

python/graphscope/client/session.py:1321–1392  ·  view source on GitHub ↗
(
        self,
        graph,
        edges,
        edge_weights=None,
        node_features=None,
        edge_features=None,
        node_labels=None,
        edge_dir="out",
        random_node_split=None,
        num_clients=1,
        manifest_path=None,
        client_folder_path="./",
        return_pyg_remote_backend=False,
    )

Source from the content-addressed store, hash-verified

1319 return g
1320
1321 def graphlearn_torch(
1322 self,
1323 graph,
1324 edges,
1325 edge_weights=None,
1326 node_features=None,
1327 edge_features=None,
1328 node_labels=None,
1329 edge_dir="out",
1330 random_node_split=None,
1331 num_clients=1,
1332 manifest_path=None,
1333 client_folder_path="./",
1334 return_pyg_remote_backend=False,
1335 ):
1336 from graphscope.learning.gl_torch_graph import GLTorchGraph
1337 from graphscope.learning.gs_feature_store import GsFeatureStore
1338 from graphscope.learning.gs_graph_store import GsGraphStore
1339 from graphscope.learning.utils import fill_params_in_yaml
1340 from graphscope.learning.utils import read_folder_files_content
1341
1342 handle = {
1343 "vineyard_socket": self._engine_config["vineyard_socket"],
1344 "vineyard_id": graph.vineyard_id,
1345 "fragments": graph.fragments,
1346 "num_servers": len(graph.fragments),
1347 "num_clients": num_clients,
1348 }
1349 manifest_params = {
1350 "NUM_CLIENT_NODES": handle["num_clients"],
1351 "NUM_SERVER_NODES": handle["num_servers"],
1352 "NUM_WORKER_REPLICAS": handle["num_clients"] - 1,
1353 }
1354 if manifest_path is not None:
1355 handle["manifest"] = fill_params_in_yaml(manifest_path, manifest_params)
1356 if client_folder_path is not None:
1357 handle["client_content"] = read_folder_files_content(client_folder_path)
1358
1359 handle = base64.b64encode(
1360 json.dumps(handle).encode("utf-8", errors="ignore")
1361 ).decode("utf-8", errors="ignore")
1362 config = {
1363 "edges": edges,
1364 "edge_weights": edge_weights,
1365 "node_features": node_features,
1366 "edge_features": edge_features,
1367 "node_labels": node_labels,
1368 "edge_dir": edge_dir,
1369 "random_node_split": random_node_split,
1370 }
1371 GLTorchGraph.check_params(graph.schema, config)
1372 config = GLTorchGraph.transform_config(config)
1373 config = base64.b64encode(
1374 json.dumps(config).encode("utf-8", errors="ignore")
1375 ).decode("utf-8", errors="ignore")
1376 handle, config, endpoints = self._grpc_client.create_learning_instance(
1377 graph.vineyard_id,
1378 handle,

Callers 5

graphlearn_torchFunction · 0.80
local.pyFile · 0.80
local_sc_ddp.pyFile · 0.80
k8s_launch.pyFile · 0.80

Calls 11

fill_params_in_yamlFunction · 0.90
GLTorchGraphClass · 0.90
GsFeatureStoreClass · 0.90
GsGraphStoreClass · 0.90
check_paramsMethod · 0.80
transform_configMethod · 0.80
decodeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected