←back to thread

Using uv with PyTorch

(docs.astral.sh)
167 points charliermarsh | 5 comments | | HN request time: 0.422s | source
1. thundergolfer ◴[] No.42190458[source]
Kind of an aside as this doc is about the complexities of installing particular PyTorch versions, but will say that uv is way faster at installing PyTorch than pip.

We run internal benchmarks of our custom container image builder and in the 'install torch' benchmark the p50 time saved when using `uv` is 25 seconds! (71.4s vs. 43.74s)

---

Aside 2: Seems there's a missing "involves" in this sentence: "As such, installing PyTorch typically often configuring a project to use the PyTorch index."

replies(1): >>42191116 #
2. cik ◴[] No.42191116[source]
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 parallelization we've reduced build times across ~100 engineers by a solid 10 minutes. There are other things we do as well, but uv is a must have nowadays.

replies(2): >>42191669 #>>42191693 #
3. freetonik ◴[] No.42191669[source]
Is your caching proxy open source?
replies(1): >>42191983 #
4. campbel ◴[] No.42191693[source]
working on switching over a lot of our python usage to UV, seeing similar speedups in builds and local environments
5. cik ◴[] No.42191983{3}[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