Skip to content

Make Monai (Random) Transforms work in a multi-threaded environment #7582

Open
@johnzielke

Description

@johnzielke

With PEP 703 being accepted and implementation of it underway python/cpython#108219 I think it would be great to prepare the Monai transforms early for execution on multiple threads. Especially with the large tensor sizes and the advantages of running transforms on GPU, I'm hoping for free-threading to have a big benefit in (3D) medical imaging AI.

I think the biggest issue here would be the Randomizable transforms, which currently can't be executed inside a threaded environment.

AFAIK, the free-threading is pushed by Meta, and I'm therefore expecting pytorch to be compatible with it relatively early, since one of the talks on no-gil python talked about testing it with a pytorch DL project internally at Meta.

This might be a great opportunity to work on #6854 as well, which might eventually require breaking changes in the Randomizable API as well.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions