Как добавить flash_attn в pixi.toml без привязок сборкиPython

Программы на Python
Ответить
Anonymous
 Как добавить flash_attn в pixi.toml без привязок сборки

Сообщение Anonymous »

Я устанавливаю Flash-внимание с помощью этой команды:

Код: Выделить всё

pixi run pip  install flash_attn --no-build-isolation
Проблема в том, что эта установка не является постоянной, поскольку она не записана в файле pixi.toml. Поэтому я добавил эти строки сам:

Код: Выделить всё

[tool.pixi.pypi-options]
no-build-isolation = ["flash_attn"]

[tool.uv.extra-build-dependencies]
flash_attn = ["torch"]

[pypi-dependencies]
flash_attn = "*"
Выдает эту ошибку:

Код: Выделить всё

Error:   × Failed to update PyPI packages for environment 'default'
├─▶ Failed to prepare distributions
├─▶ Failed to build `flash-attn==2.8.3`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit status: 1)

[stderr]
/a/temp/user/tmp/.cache/xdg/rattler/cache/uv-cache/builds-v0/.tmprJkDeL/lib/python3.11/site-packages/setuptools/_vendor/wheel/bdist_wheel.py:4: FutureWarning: The 'wheel' package is no longer the canonical location of the
'bdist_wheel' command, and will be removed in a future release. Please update to setuptools v70.1 or later which contains an integrated version of this command.
warn(
Traceback (most recent call last):
File "", line 14, in 
File "/a/temp/user/tmp/.cache/xdg/rattler/cache/uv-cache/builds-v0/.tmprJkDeL/lib/python3.11/site-packages/setuptools/build_meta.py", line 333, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/a/temp/user/tmp/.cache/xdg/rattler/cache/uv-cache/builds-v0/.tmprJkDeL/lib/python3.11/site-packages/setuptools/build_meta.py", line 301, in _get_build_requires
self.run_setup()
File "/a/temp/user/tmp/.cache/xdg/rattler/cache/uv-cache/builds-v0/.tmprJkDeL/lib/python3.11/site-packages/setuptools/build_meta.py", line 520, in run_setup
super().run_setup(setup_script=setup_script)
File "/a/temp/plorenz/tmp/.cache/xdg/rattler/cache/uv-cache/builds-v0/.tmprJkDeL/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
exec(code, locals())
File "", line 22, in 
ModuleNotFoundError: No module named 'torch'

hint: This error likely indicates that `flash-attn@2.8.3` depends on `torch`, but doesn't declare it as a build dependency. If `flash-attn` is a first-party package, consider adding `torch` to its `build-system.requires`. Otherwise,
either add it to your `pyproject.toml` under:

[tool.uv.extra-build-dependencies]
flash-attn = ["torch"]

or `uv pip install torch` into the environment and re-run with `--no-build-isolation`.
Ссылка:

https://pypi.org/project/flash-attn/
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Python»