←back to thread

Using uv with PyTorch

(docs.astral.sh)
167 points charliermarsh | 1 comments | | HN request time: 0s | source
Show context
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 #
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 #
freetonik ◴[] No.42191669[source]
Is your caching proxy open source?
replies(1): >>42191983 #
1. cik ◴[] No.42191983[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