← Back to context

Comment by alkh

2 days ago

I enjoy using uv a lot but am getting afraid that it is getting bloated for no reason. For ex., the number of niche flags that a lot of subcommands support is very high + some of them seemingly achieve the same result(uv run --no-project and uv run --active). I'd rather them working on improving existing tools and documentation than adding new (redundant) functionality

It's really difficult to do Python projects in a sound, reproducible, reasonably portable way. uv sync is in general able to build you only a package set that it can promise to build again.

But it can't in general build torch-tensorrt or flash-attn because it has no way of knowing if Mercury was in retrograde when you ran pip. They are trying to thread a delicate an economically pivotal needle: the Python community prizes privatizing the profits and socializing the costs of "works on my box".

The cost of making the software deployable, secure, repeatable, reliable didn't go away! It just became someone else's problem at a later time in a different place with far fewer degrees of freedom.

Doing this in a way that satisfies serious operations people without alienating the "works on my box...sometimes" crowd is The Lord's Work.

  • > But it can't in general build torch-tensorrt or flash-attn because it has no way of knowing if Mercury was in retrograde when you ran pip.

    This is a self-inflicted wound, since flash attention insist on building a native C++ extension which is completely unnecessary in this case.

    What you can do is the following:

    1) Compile your CUDA kernels offline. 2) Include those compiled kernels in a package you push to pypi. 3) Call into the kernels with pure Python, without going through a C++ extension.

    I do this for the CUDA kernels I maintain and it works great.

    Flash attention currently publishes 48 (!) different packages[1], for different combinations of pytorch and C++ ABI. With this approach it would have to only publish one, and it would work for every combination of Python and pytorch.

    [1] - https://github.com/Dao-AILab/flash-attention/releases/tag/v2...

    • While shipping binary kernels may be a workaround for some users, it goes against what many people would consider "good etiquette" for various valid reasons, such as hackability, security, or providing free (as in liberty) software.

      9 replies →

I don’t understand why adding a subcommand to uv is being considered bloat.

uv is already a complex tool, but it has excellent documentation. Adding a straightforward, self-explanatory subcommand like this doesn’t seem out of place.

  • Developing a good and configurable formatter is a project almost as complex as uv's main focus, managing packages. As such it will divert time and attention from its main purpose and the outcome is questionable, considering how many bad formatters are out there. For example the "opinionated" black is terrible and has no awareness of semantics.

  • > I don’t understand why adding a subcommand to uv is being considered bloat.

    It's simple:

    - Everything I use and I see: good

    - Everything I don't use and I see: bloat

    - Everything I use and I don't see: good

    - Everything I think I don't use and I don't see: Java

When talking about uv, this comes across similar to saying that "the 'make' command has too many targets".

Are they baked into the main executable or are they separate binaries (a la apt, cargo, etc)?

  • It's a separate binary -- we install Ruff if you invoke `uv format`. So if you don't invoke `uv format`, there's no impact on the binary size, etc.

    • But, for example, my project already uses Ruff, and I have to worry about having a "managed" extra copy of Ruff that subtly alters the normal functioning both of "uv tool run" and of ruff itself.

      1 reply →