NA-MIC / ProjectWeek

Website for NA-MIC Project Weeks
https://projectweek.na-mic.org
82 stars 284 forks source link

Project: Enabling PyTorch3D on Windows and Optimizing Miniconda for Slicer Extensions #1090

Closed GaelleLeroux closed 3 months ago

GaelleLeroux commented 3 months ago

Draft Status

Ready - team will start page creating immediately

Category

Infrastructure

Presenter Location

In-person

Key Investigators

Project Description

This project focuses on enhancing compatibility and usability in two key areas. Firstly, we aim to enable the use of PyTorch3D on the Windows platform. By leveraging the Windows Subsystem for Linux (WSL2) and a virtual Miniconda environment, we intend to bypass the traditional limitations and provide Windows users with full access to PyTorch3D’s capabilities. Secondly, the project seeks to improve the integration of Miniconda with Slicer extensions. Our goal is to simplify the process of creating and managing virtual environments for Slicer extensions, thereby making the procedure more intuitive. This will not only ease the use of various analytical tools and libraries but also streamline the setup process within WSL, especially for tools incompatible with Windows. This approach aims to bridge the gap in functionality and user experience across different platforms.

Objective

Our project aims to achieve three primary objectives:

Operationalizing PyTorch3D on Windows: The first goal is to make PyTorch3D, typically unsupported on the Windows platform, fully functional. We plan to employ the Windows Subsystem for Linux (WSL2) combined with a virtual Miniconda environment to overcome this limitation. This strategy is designed to provide Windows users with complete access to the extensive functionalities of PyTorch3D.

Improving Miniconda Integration for Slicer Extensions: Our second objective is to enhance the use of Miniconda as a virtual environment manager specifically for Slicer extensions. We aim to streamline the process of creating and managing new virtual environments that are utilized by Slicer extensions, making the procedure more intuitive and user-friendly. This advancement will facilitate the use of specialized libraries required for a variety of analytical tools, which are currently not integrable directly into Slicer. Additionally, this approach will assist in the setup of Miniconda3 and the creation of new environments within WSL, particularly for tools that are not available on Windows.

Updating Modules Previously Unavailable on Windows Due to PyTorch3D: The third goal is to leverage the advancements made in the second objective to update several modules that were previously inaccessible on Windows due to PyTorch3D's limitations. Specifically, we aim to enhance:

Approach and Plan

Progress and Next Steps

Progress :

Next Step:

Illustrations

SlicerConda Icon

CondaSetUp_icon_big_format

Background and References

No response

pieper commented 3 months ago

Thanks for putting this project together. As I understood from the planning call the source pytorch3d package doesn't provide wheels for windows and you are trying to work around this. It would be good to know the root reason that wheels aren't available. There was some discussion that the build process is difficult but it wasn't exactly clear why and maybe that detail could be added to this page.

Also we discussed that WSL2 is not going to be an easy solution for many windows users, as it may be technically difficult or administratively prohibitive on their machines. For that reason it may have broader usability to explore building pytorch3d as part of the Slicer extension build, where we know exactly which python versions and dependencies are available.

lassoan commented 3 months ago

Fully agree, WSL2 would not be an acceptable workaround for most users.

@GaelleLeroux could you please contact the author of pytorch3d to see what is preventing him from supporting Windows wheels? Does he need help with setting up a build system that works for Windows? If we send a pull request that fixes Windows issues, is he going to merge it? Is he then going to create Windows wheels?

cpinter commented 3 months ago

the author of pytorch3d

I think the author is Meta, and from what I heard they are not responsive and the PyTorch3D package can be used "as is" and that's it.

We talked with @GaelleLeroux at the last project week, and it seemed they are committed to follow this approach. I have raised similar concerns, and asked if we could rather collaborate in an alternative way that is more "user friendly". Since then we have worked on another approach for trying to run PyTorch3D on Windows: using ONNX to convert a trained PyTorch3D model and use ONNX Runtime to do the inference, but this attempt was not successful. If you are interested in the partial results the person who worked on this achieved, I can share it (but I have no idea what he did in the last few weeks he worked on this project, as I cannot contact him at all).

lassoan commented 3 months ago

If you look at github insights then you will see that it is mainly developed and maintained by the github user bottler - a.k.a. Jeremy F Reizenstein at a Meta-funded research lab at University of Cambridge.

Large companies do not do any software development work, just make very high-level strategic decisions that are in the end implemented by thousands of small independent "companies" (entities within the company with their own leadership, goals and interests, budget, and people). Most technical decisions are made by individual contributors and their managers, so you don't need to reach out to "Meta", just to Jeremy. If you feel that you are being ignored on github then you can try to post your questions with somewhat provocative headline like "Future of this project" or "Is this project still developed?", which maintainers will probably not leave unanswered. You can also try to contact him via LinkedIn or at email addresses provided as contact information in papers he coauthored.

github-actions[bot] commented 3 months ago

Project Page Pull Request Creation

:white_check_mark: COMPLETED: See https://github.com/NA-MIC/ProjectWeek/pull/1095

cpinter commented 3 months ago

Good to know @lassoan . I don't have any personal experience, I just said what my own "subcontractors" told me. It could be worth contacting Jeremy.

pty0220 commented 3 months ago

Hello everyone,

I'm not sure if you've tried the following method already, but I've been using pytorch3D in Windows-Slicer as follows:

I've tested this method and it works well. I hope it helps.