pixi icon indicating copy to clipboard operation
pixi copied to clipboard

Pixi 0.27.1 does not take conda packages as dependencies of pypi packages correctly like 0.26.1

Open 183amir opened this issue 2 years ago • 3 comments

Checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

This pixi.toml file:

[project]
name = "test_pytorch_as_pypi_dependency"
version = "0.1.0"
description = "Add a short description here"
channels = ["conda-forge"]
platforms = ["linux-64"]

[tasks]

[dependencies]
pytorch = "2.3.1.*"
torchvision = "*"
ftfy = "*"
packaging = "*"
pillow = "*"
tqdm = "*"
regex = "*"

[system-requirements]
linux = "5.4"
cuda = "11"

[pypi-dependencies]
clip = { git = "https://github.com/openai/CLIP" }

will have very different pixi.lock files depending on the pixi versions 0.26.1 and 0.27.1. In 0.26.1, the pytorch conda package is correctly taken as a dep for clip but in 0.27.1, the torch pypi package gets installed.

When using pixi 0.27.1, these extra packages get added to the lock file:

      - pypi: https://files.pythonhosted.org/packages/37/6d/121efd7382d5b0284239f4ab1fc1590d86d34ed4a4a2fdb13b30ca8e5740/nvidia_cublas_cu12-12.1.3.1-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/7e/00/6b218edd739ecfc60524e585ba8e6b00554dd908de2c9c66c1af3e44e18d/nvidia_cuda_cupti_cu12-12.1.105-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/b6/9f/c64c03f49d6fbc56196664d05dba14e3a561038a81a638eeb47f4d4cfd48/nvidia_cuda_nvrtc_cu12-12.1.105-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/eb/d5/c68b1d2cdfcc59e72e8a5949a37ddb22ae6cade80cd4a57a84d4c8b55472/nvidia_cuda_runtime_cu12-12.1.105-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/9f/fd/713452cd72343f682b1c7b9321e23829f00b842ceaedcda96e742ea0b0b3/nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/86/94/eb540db023ce1d162e7bea9f8f5aa781d57c65aed513c33ee9a5123ead4d/nvidia_cufft_cu12-11.0.2.54-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/44/31/4890b1c9abc496303412947fc7dcea3d14861720642b49e8ceed89636705/nvidia_curand_cu12-10.3.2.106-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/bc/1d/8de1e5c67099015c834315e333911273a8c6aaba78923dd1d1e25fc5f217/nvidia_cusolver_cu12-11.4.5.107-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/65/5b/cfaeebf25cd9fdec14338ccb16f6b2c4c7fa9163aefcf057d86b9cc248bb/nvidia_cusparse_cu12-12.1.0.106-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/4b/2a/0a131f572aa09f741c30ccd45a8e56316e8be8dfc7bc19bf0ab7cfef7b19/nvidia_nccl_cu12-2.20.5-py3-none-manylinux2014_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/59/65/7ff0569494fbaea45ad2814972cc88da843d53cc96eb8554fcd0908941d9/nvidia_nvjitlink_cu12-12.6.20-py3-none-manylinux2014_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/da/d3/8057f0587683ed2fcd4dbfbdfdfa807b9160b809976099d36b8f60d08f03/nvidia_nvtx_cu12-12.1.105-py3-none-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/6e/ec/06715d912351edc453e37f93f3fc80dcffd5ca0e70386c87529aca296f05/setuptools-72.2.0-py3-none-any.whl
      - pypi: https://files.pythonhosted.org/packages/bf/55/b6c74df4695f94a9c3505021bc2bd662e271d028d055b3b2529f3442a3bd/torch-2.4.0-cp312-cp312-manylinux1_x86_64.whl
      - pypi: https://files.pythonhosted.org/packages/fe/7b/7757205dee3628f75e7991021d15cd1bd0c9b044ca9affe99b50879fc0e1/triton-3.0.0-1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

which I think is a regression in the new version.

Issue description

newer version of pixi does not resolve the pypi dependencies correctly.

Expected behavior

pixi should take the pytorch conda package as a dependency for the pypi packages.

183amir avatar Aug 19 '24 12:08 183amir

Thanks for sharing, we found the reason and are working on a fix.

The issue is that our conda-pypi hash map has an issue with the pytorch packages. This is one of them: https://conda-mapping.prefix.dev/hash-v0/615509113f8a8abdac6ce351afbbc9c07541b400f920856510348efcdf9ac491

It says it's not a pypi package but it obviously should say that it maps to torch.

ruben-arts avatar Aug 20 '24 07:08 ruben-arts

Hey @183amir !

I am happy to inform you that this problem was fixed.

You just need to run pixi clean cache --mapping to remove some wrong mapped hashesh, and using latest pixi ,

this will be the only pypi library in lock file

- pypi: git+https://github.com/openai/CLIP@dcba3cb2e2827b402d2701e7e1c7d9fed8a20ef1

let me know if it works for you

nichtmacho avatar Sep 11 '24 14:09 nichtmacho

I'm closing this issue as I'm not able to reproduce this problem anymore.

@183amir feel free to reopen it if you face it again / or open another issue

nichtmacho avatar Sep 13 '24 08:09 nichtmacho