Running the advanced pytorch example in google colab

Hi
So i have redesigned the advanced pytorch example to my specific use case. It runs fine on my machine, but I dont have that much compute power, so I wanted to run it from google colabs instead, where I have GPU power.

According to the documentation: Run simulations - Flower Framework

I should use this, to run in colab:
run_simulation(
server_app=server_app,
client_app=client_app,
num_supernodes=10, # equivalent to setting num-supernodes in the pyproject.toml
)

But when i do this, it seems like the configs from the pyproject.toml is not properly loaded, so the context in the server_fn and client_fn is showing errors. So I tried loading the configs manually into a context variable and give it to the server_fn(context). This kinda works, until i get an error of not being able to find “partition-id” in the client_fn, since I guess this is normally configurated automatically with the flwr run?

So my question is, how do i fix this? Or should i just use the flwr run command in colab as !flwr run. But I guess there might be a problem with this, since multiprocessing on colab is not working?

Hope someone can help!

Best regards,
Johan

1 Like