EmbarkStudios / pdm-plugin-torch

A tool for managing torch-variants with PDM.
Apache License 2.0
32 stars 5 forks source link

Install instructions could do with some improvement #24

Open polarathene opened 4 months ago

polarathene commented 4 months ago

As someone not too familiar with PDM or Python environments, the install guide was a little vague/brief?:

https://github.com/EmbarkStudios/pdm-plugin-torch/blob/e3c1228b87ec0b7d91fac65c5ef3834caf2b168b/README.md?plain=1#L51-L54

Here's a plugin that is a bit more detailed: https://github.com/noirbizarre/pdm-dockerize#installation


I think it's fine to only advise a preferred approach to installing the PDM plugin as opposed to the various methods the referenced plugin project demonstrates.

There is the global pdm self add pdm-plugin-torch, or local-only install (creates a hidden subdir for plugins) with:

  1. Add to pyproject.toml (version pinning not required)

    [tool.pdm]
    plugins = [
      "pdm-plugin-torch",
    ]
  2. Run pdm install --plugins to install the latest version of the plugin.

  3. Optionally mention pinning the plugin version, but I'm not sure how important that is. For those more familiar with PDM and plugin management (or package management in general), they'd likely pin if it seemed beneficial to them. I don't mind it too much, looking up the latest GH release version was quick, but I wasn't familiar with if the version needed to be explicitly set just to try the plugin 😅


I don't have feedback beyond that as the plugin itself has been broken for 6 months: https://github.com/EmbarkStudios/pdm-plugin-torch/issues/21 (there has been a PR open since March to resolve it, but no engagement)

At a glance from the README, there is mention of a separate lock file for torch. I also see with the plugin installed that I have two subcommands with the plugin pdm torch lock and pdm torch install.

If I understand that correctly, that means it's distinct from pdm install / pdm sync? What about for packages that use torch but aren't hosted by the PyTorch sources? (torchsde is an example)

Likewise, from the example and other discussion activity on the repo it seems that you're expected to maintain explicit version pinning with == for each package? (despite the separate lock files the plugin is meant to generate) Is there no resolution supported via PDM? How do you go about updating packages and ensuring compatibility with the main pyproject.toml deps?

The questions might be a bit redundant if I could actually use the plugin 😅 I'm just trying to understand if the plugin is still relevant. I've been trying to grasp what is an appropriate solution at https://github.com/pdm-project/pdm/discussions/2968