rye
rye copied to clipboard
Known Problematic Packages
This is a meta issue tracking issues with packages where the issue is with the upstream package.
-
flash-attn
(https://github.com/Dao-AILab/flash-attention/issues/773): Package does not build wheels and the build dependencies are incorrectly defined. -
jax[cuda12_pip]
refuses to install (https://github.com/mitsuhiko/rye/issues/420)
uv
supports --no-build-isolation
flag(related PR) as of version v0.1.16
. I confirmed that running uv pip install flash-attn --no-build-isolation
is successfully built and installed flash-attn
package. But I couldn't found a way to integrate this flag to rye add
command. It would be awesome if rye supports it in the near future.
I wish rye
would support building these packages (e.g. by allowing me to specify their build dependencies in my pyproject.toml
) as it doesn't look like they'll get fixed anytime soon, if ever.
In the meantime I have found a workaround to install them; not sure if this is the best way to do it (probably not), but it seems to work. For example, to get the flash attention package installed you can do this (note: I'm using the uv
backend for rye
):
-
rye init -p 3.11.8 foobar
(not strictly necessary to specify the version, but some of the widely used ML packages are still broken on 3.12 that would otherwise get used by default) -
cd foobar
- Add build deps as dependencies:
rye add wheel setuptools packaging pip torch
- Paste this as
setup.sh
:
#!/bin/bash
set -euxo pipefail
FLASH_ATTENTION_TAG=v2.5.6
FLASH_ATTENTION_WHEEL="flash_attn-2.5.6-cp311-cp311-linux_x86_64.whl"
CWD="$(pwd)"
source .venv/bin/activate
rye sync --no-dev
if [ ! -d "/tmp/flash-attention" ]; then
git clone "https://github.com/Dao-AILab/flash-attention.git" /tmp/flash-attention
fi
if [ ! -f "$CWD/.venv/wheels/$FLASH_ATTENTION_WHEEL" ]; then
cd /tmp/flash-attention
git checkout $FLASH_ATTENTION_TAG
if [ ! -f "dist/$FLASH_ATTENTION_WHEEL" ]; then
python setup.py bdist_wheel
fi
mkdir -p "$CWD/.venv/wheels/"
cp dist/$FLASH_ATTENTION_WHEEL "$CWD/.venv/wheels/"
fi
cd $CWD
rye add --dev --no-sync "flash_attn @ file://.venv/wheels/$FLASH_ATTENTION_WHEEL"
rye sync
- Run
setup.sh
. From now on when you want to fetch and install all of the dependencies from scratch runsetup.sh
instead ofrye sync
.
Will there be any official future work here @mitsuhiko ? Thanks
@koute : How does this fix/workaround affect your lockfile?