←back to thread

Using uv with PyTorch

(docs.astral.sh)
167 points charliermarsh | 1 comments | | HN request time: 0.209s | source
Show context
kolja005 ◴[] No.42191388[source]
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 totally under-appreciated how much goes into this software and I'm bummed I have to use Poetry at work after having watched this talk.

[1] https://www.youtube.com/watch?v=gSKTfG1GXYQ

edit: NP-complete not NP-hard

replies(1): >>42191993 #
wenc ◴[] No.42191993[source]
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?

replies(3): >>42192963 #>>42194275 #>>42194910 #
1. sa1 ◴[] No.42192963[source]
There are such cases in uv as well, and I’ve hit them quite often when I didn’t specify lower bounds (especially for boto3).