FedML-AI / FedML

FEDML - The unified and scalable ML library for large-scale distributed training, model serving, and federated learning. FEDML Launch, a cross-cloud scheduler, further enables running any AI jobs on any GPU cloud or on-premise cluster. Built on this library, TensorOpera AI (https://TensorOpera.ai) is your generative AI platform at scale.
https://TensorOpera.ai
Apache License 2.0
4.17k stars 785 forks source link

FedGraphnn -- wandb utilization #2025

Open pleonidou opened 6 months ago

pleonidou commented 6 months ago

Hi, I would like to ask if there is an option to use the fedgraphnn examples with ego networks for node classification without the wandb?

I would like to store the results per client and server aggregation locally.

I am referring to this example: https://github.com/FedML-AI/FedML/tree/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf

fedml-dimitris commented 6 months ago

Hello @pleonidou thank you for reaching out. You can store any custom results you need either at the aggregator or the client side, by extending the following functions:

Aggregator: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_aggregator.py#L25

The test_all() function in the aggregator is executed at the end of every federation round.

Client: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_trainer.py#L22

The train() function at the client is executed at the beginning of the federation round and the test() function at the end of local training.

For overriding the wandb functionality you can refer to this line here: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_aggregator.py#L43

In general, you can also use the fedml.log() functionality to record your custom metrics, but by extending the functionality as described above in both the aggregator and the client class you have more control on what is being recorded.

pleonidou commented 6 months ago

Many thanks for the swift response!

On Tue, Apr 9, 2024 at 6:55 AM Dimitris Stripelis @.***> wrote:

Hello @pleonidou https://github.com/pleonidou thank you for reaching out. You can store any custom results you need either at the aggregator or the client side, by extending the following functions:

Aggregator: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_aggregator.py#L25

The test_all() function in the aggregator is executed at the end of every federation round.

Client: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_trainer.py#L22

The train() function at the client is executed at the beginning of the federation round and the test() function at the end of local training.

For overriding the wandb functionality you can refer to this line here: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_aggregator.py#L43

In general, you can also use the fedml.log() functionality to record your custom metrics, but by extending the functionality as described above in both the aggregator and the client class you have more control on what is being recorded.

— Reply to this email directly, view it on GitHub https://github.com/FedML-AI/FedML/issues/2025#issuecomment-2044103979, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQXJ52JUGN4EZ5GEQ6MAWT3Y4NREXAVCNFSM6AAAAABF4WM6VKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBUGEYDGOJXHE . You are receiving this because you were mentioned.Message ID: @.***>