Live data from Hacker News

Using uv with PyTorch

docs.astral.sh

31–40 of 56 posts

Re: Using uv with PyTorch

#31
post #19

Earlier quoted context omitted.

Joining your aside to tout the benefits of uv. We use uv combined with a simple proxy I wrote, to cache python dependencies, and then install them in parallel. UV also makes it simple to regenerate a requirements file and know who requires the dependencies, which in turn makes it easy to manage the ecosystem, analyze packages, and determine if we can reduce our footprint. Between that latter feature, the proxy, the p…

Is your caching proxy open source?

It's just nginx. Here's a link to something someone did. It's close enough to be honest, unless you have our specialized needs.

https://github.com/hauntsaninja/nginx_pypi_cache

Re: Using uv with PyTorch

#32

I recently watched a talk by the author of uv that was surprisingly fascinating [1]. He goes into a few of the more notable hacks that they had to come up with to make it as fast as it is. The most interesting thing for me was that package resolution in python given constraints defined (eg. in requirements.txt) maps to a boolean satisfiability problem which is NP-complete. So uv uses a custom SAT solver to do this. I…

I haven’t used Conda since 2021 but recall it had a SAT solver that was very slow especially on degenerate cases.

How does uv’s sat solver compare?

Re: Using uv with PyTorch

#37

Does uv support global Python install now? I need something like Mise for this.

Yes via the "--system" option of the different commands.

Or via the global "python-preference" option set to "only-system".

Cf https://docs.astral.sh/uv/concepts/python-versions/#adjustin... and https://docs.astral.sh/uv/reference/settings/#python-prefere...

Re: Using uv with PyTorch

#38
In a nutshell, what do I gain from switching to uv from my current workflow, which is: 1) create a venv (`python3.xx -m venv venv`) 2) install packages from a requirements.txt into that venv?

One limitation I know of are the inability to detect stale packages.

Apart from „blazing fast“, which I‘m not convinced it really matters to me as I rarely touch the dependencies, what are the main reasons why uv is gaining traction?

Re: Using uv with PyTorch

#39

In a nutshell, what do I gain from switching to uv from my current workflow, which is: 1) create a venv (`python3.xx -m venv venv`) 2) install packages from a requirements.txt into that venv? One limitation I know of are the inability to detect stale packages. Apart from „blazing fast“, which I‘m not convinced it really matters to me as I rarely touch the dependencies, what are the main reasons why uv is gaining trac…

PS: one thing I like about my current workflow is no extra tools needed, base python install is all that‘s required.

Re: Using uv with PyTorch

#40

In a nutshell, what do I gain from switching to uv from my current workflow, which is: 1) create a venv (`python3.xx -m venv venv`) 2) install packages from a requirements.txt into that venv? One limitation I know of are the inability to detect stale packages. Apart from „blazing fast“, which I‘m not convinced it really matters to me as I rarely touch the dependencies, what are the main reasons why uv is gaining trac…

You get correct version resolution (checking compatibility across the entire tree of deps-of-deps, including against different Python versions) and a lock file which represents a global state of the entire tree and gives you reproducibility of a working setup.
Post reply on HN