Skip to content

[FEATURE] Running cellpose distribute on a SLURM cluster #1111

Open

Description

@ozlembahar

Hi,

Thanks a lot developing such a great tool. With the latest advancements to segmenting large images, I am looking forward to try it out on my images.

@GFleishman Would it be possible to implement this on SLURM?

all the best,
ozba

Activity

  1. added
    enhancement
    on Feb 16, 2025
  2. GFleishman commented on Feb 17, 2025

    @GFleishman
    Contributor

    Hi Ozba - I am willing to add a SLURM cluster to distributed Cellpose if you are willing to be a pro-active beta tester. This would require you to:

    • Create a new conda environment and install my fork of Cellpose from source - you must be proficient with conda and git
    • Run Cellpose from the Python API similar to the examples in the Big Data section of the Cellpose documentation
    • Find times when we can both be working at the same time, where I push code changes and you test them on your SLURM cluster
    • Your cluster must have some documentation that I can access while building so I can confirm that I am interfacing distributed Cellpose with the cluster correctly

    If that sounds reasonable to you then we can work on it together. I already have a SLURM cluster implementation which works on another system, but it's not quite ready to be added to Cellpose yet. So I have a head start. Just let me know.

  3. ozlembahar commented on Feb 18, 2025

    @ozlembahar
    Author

    Hi, I would be happy to help and I am sure we can find time to test changes quickly. Regarding the last point: What information would you need roughly?

  4. GFleishman commented on Feb 18, 2025

    @GFleishman
    Contributor

    Some systems have maximum quotas for CPUs, RAM, and GPUs. Some systems assign resources together in bundles, such as, "every CPU requested comes with 15GB RAM" or "you must request a ratio of 8-to-1 CPUs to GPUs." Some systems have preferred locations for temporary files. We want to be sure that we're respecting all these parameters, or at least giving the user the right options to make sure their submissions are compatible with the cluster's specific requirements. Building systems that move easily from one cluster to another is difficult because cluster management is not standardized like personal computers are.

    Let's first just meet and get my fork of distributed Cellpose installed on your cluster. Then I can add my existing SLURM implementation, you can pull the addition, and we'll see how well it runs. Then we'll determine what adaptations need to be made.

    I'm not really available for this until the second week of March. I would prefer to meet on a Friday if you can. I am in the GMT-5 time zone, it appears you are in GMT+1? Times that make sense for our time difference would probably be between 9am and 12pm GMT-5 (3pm - 6pm GMT+1). How does that sound?

  5. GFleishman commented on Mar 4, 2025

    @GFleishman
    Contributor

    Hi @ozlembahar - just checking in with you again if you're still interested in this.

  6. ralfox commented on Mar 10, 2025

    @ralfox
    Contributor

    Hi @GFleishman. Could I help with testing? What are the minimum system requirements? Direct access to the cluster by external parties may be an issue. Is there a convenient way to forward relevant results, logs etc?

  7. GFleishman commented on Mar 10, 2025

    @GFleishman
    Contributor

    Hi @ralfox - I do not need direct access to your cluster. But you need to know enough about your cluster to help me accommodate any specific requirements it might have. Access to your cluster documentation, or at least you relaying any necessary information from that documentation to me, is probably necessary. That is something we could accomplish working together over a zoom meeting for example. Repeating these here:

    • Create a new conda environment and install my fork of Cellpose from source - you must be proficient with conda and git
    • Run Cellpose from the Python API similar to the examples in the Big Data section of the Cellpose documentation
    • Find times when we can both be working at the same time, where I push code changes and you test them on your SLURM cluster
    • Your cluster must have some documentation that I can access while building so I can confirm that I am interfacing distributed Cellpose with the cluster correctly
  8. ralfox commented on Mar 10, 2025

    @ralfox
    Contributor

    Thank you @GFleishman. No issue re points 1-3 (configuring environment, running cellpose, test). As of cluster documentation - I have to rely on the IT team operating the cluster.
    Can you provide data for testing?

  9. ralfox commented on Mar 11, 2025

    @ralfox
    Contributor

    For testing purposes, would it be meaningful to use a local SLURM workload manager.
    It is very simple to spin up with, e.g., this repository:
    https://github.com/Cellular-Imaging-Amsterdam-UMC/NL-BIOMERO-Local-Slurm

  10. GFleishman commented on Mar 11, 2025

    @GFleishman
    Contributor

    @ralfox - Interesting, I was not aware of the possibility of a local SLURM workload manager. I'm not sure how those work. If I get one of those running, say on my Linux workstation, does that create a SLURM interface for my own system ? Like something I can submit jobs to using SLURM syntax, and it knows how to translate that into resource allocation and execution on my native system? If that is the case, I can see it being very useful, but also creating more work for me to learn how to use it and what its benefits/limits are as a testing environment. I'm not opposed to doing that, but adding SLURM to distributed Cellpose is not really something I need personally for my own work, it's just something I'm willing to do for the community if there is demand (which it seems there is). If it is overall fewer required hours, I would prefer to just test on an actual SLURM cluster with the help of someone who will actually be executing on that cluster.

    Yes, I can provide a small 512^3 crop of data for testing.

  11. ralfox commented on Mar 13, 2025

    @ralfox
    Contributor

    @GFleishman My understanding is that https://github.com/Cellular-Imaging-Amsterdam-UMC/NL-BIOMERO-Local-Slurm/blob/master/docker-compose.yml configures all services required to run a SLURM system across a set of Docker containers. In this instance, there appear to be two containers named c1 and c2 for running the workloads. The difference to running a cluster on bare metal may only be to ssh into slurm@host.docker.internal instead of a real machine, and retrieving results from within the Docker containers.
    I am happy to give this a try and share the process and outcomes here.

  12. nm728 commented on Apr 28, 2025

    @nm728

    Hi, there are a number of researchers in my institution who have been asking about this. I would be happy to take part in any testing you need, and can meet your requirements.

  13. karimi-ali commented on Aug 1, 2025

    @karimi-ali

    Hey @GFleishman and others:

    We have volumes of a cephalopod brain that were imaged using Synchrotron X-ray. We were able to run cellpose locally on some of them but get memory issues on larger ones.

    We have a SLURM cluster and here's how you request GPUs:
    https://docs.mpcdf.mpg.de/doc/computing/raven-user-guide.html#gpu-job-using-1-2-or-4-gpus-on-a-single-node

    There are resource limits on the jobs:
    https://docs.mpcdf.mpg.de/doc/computing/raven-user-guide.html#slurm-batch-system:~:text=Overview%20of%20the%20available,16%20%20%20%20%20%20%2024%3A00%3A00%0A%20%20%20%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D%2D

    as well as interactive nodes (access point to the cluster):
    https://docs.mpcdf.mpg.de/doc/computing/raven-user-guide.html#resource-limits

    I'd be happy to meet and test your code for parallelised implementation of cellpose.

  14. LukasHats commented on Sep 18, 2025

    @LukasHats

    Is there any progress here?

  15. MrMupfel commented on Jan 16, 2026

    @MrMupfel

    @GFleishman

    Checking in to see if anyone has tried this on a SLURM cluster (with Nvidia Gpus) on large scale 2D data?

    From what I understand the distributed functionality is mainly intended for 3D data but it would be interesting to see if this could be adapted for large scale 2D images and then be run on the cluster (currently maxing out our microscope at 100gb for one large image).

    The way I would go about this right now is to handle the tiling manually first and then just push individual SLURM jobs for eeach tile and let SLURM figure out the parallelization with available ressources on the cluster. However doing it like this would come with the extra step of putting the results back together, taking care of overlap and edges, ...

    Cheers,
    Florian

  16. karimi-ali commented on May 5, 2026

    @karimi-ali

    @GFleishman and others. I opened two PRs (one for v3 and one for v4 cellpose) for adding slurm support. I have tested them on Max Planck's RAVEN cluster:https://docs.mpcdf.mpg.de/doc/computing/raven-user-guide.html

    Let me know what you think.

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

    distributedenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions