Skip to content

Model training on multiple GPUs failed #24

Description

@Larrycpan

Since I have a large dataset (millions of cells) and want to include as many as possible genes (e.g. n_var_genes= 15000 in c2f.utils.get_training_data), I want to perform mod.train using multiple GPUs. Given the pytorch_lightening version (1.5.10post0) in cell2fate environment only supporting DDPPlugin, the training process is adapted to

mod.train(accelerator = "gpu", devices=-1, strategy=DDPPlugin(find_unused_parameters=True), lr=1e-04, batch_size=1024)

However, I encountered the error

RuntimeError: DistributedDataParallel is not needed when a module doesn't have any parameter that requires a gradient.

Changing find_unused_parameters=True to find_unused_parameters=False did not resolve the problem. But when I train the model using one GPU, like

mod.train(accelerator = "gpu", devices=1, lr=1e-04, batch_size=1024)

everything goes smoothly. Does cell2fate support training on multiple GPUs? If yes, how can I adapt the tutorial code? Thanks for your help.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions