Specifying conda channels for matching / CUDA torch versions
I'm creating environments for several different versions of topaz (including 0.3.7) and I've noticed that with a command like:
mamba create -n topaz python=3.11 topaz fsspec pytorch-cuda=11.8 -c tbepler -c pytorch -c nvidia
then some packages like torchvision are installed from conda base or conda-forge and not pytorch. I used the pytorch::package syntax to make sure the pytorch version with the matching CUDA are installed. I've seen it for torchvision and the base pytorch package (even though the correct pytorch-cuda from pytorch was installed).
Something like the command below seem to correct it. I'm not sure if this is my mistake, the environment solver, or the way the dependencies are listed in the topaz meta.yaml, but perhaps this will help others if they run into the issue.
mamba install python=3.11 topaz=0.2.5 'pytorch::pytorch<=2.3.1' 'pytorch::pytorch-cuda=11.8' 'pytorch::torchvision' -c tbepler -c pytorch -c nvidia
The cuda-version metapackage seems to end up at 12.8 but correcting that seems unimportant so far.
Is this using fresh environments that have never used conda-forge? I think if you've installed something from there, the channel remains on your list channels to search from.
Ah, I see. It's caused by using miniforge, then: conda-forge is always on the list.
Hello @asarnow , can you tell me if there's any issue with using the conda-forge packages with topaz? I was thinking that the package could belong to Conda-forge/Bioconda organizations, and would be willing to help registering there.
Hi @PertuyF , using conda-forge dependencies should be okay as long as they are compatible (not mixing anaconda defaults and conda-forge). We are working on releasing a new version to conda that prioritizes use with conda-forge.
As I recall it was falling back to CPU until I used the pytorch packages I indicated.
Here's the PR, I tested locally and the dependencies should dynamically change bewteen CPU and GPU depending on hardware availability. It's possible to force installing GPU version with this trick. Could you help me review the PR and to test the output package @asarnow @DarnellGranberry @tbepler ?