Skip to content

How to install flash-attn and transformer-engine[pytorch] using uv sync in a clean environment (e.g., Docker) #13959

@pplmx

Description

@pplmx

Question

Here is my trial:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "test"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
    "megatron-core==0.11.0; sys_platform == 'linux'",
    "numpy>=2.2.3",
    "torch>=2.6.0",
    "flash-attn",  
    "transformer-engine[pytorch]",  
]

[tool.uv]
no-build-isolation-package = ["transformer-engine-torch", "flash-attn"]

[[tool.uv.dependency-metadata]]
name = "flash-attn"
requires-dist = ["torch", "einops"]

[[tool.uv.dependency-metadata]]
name = "transformer-engine-torch"
requires-dist = ["setuptools"]

Platform

Linux 5.4.0-42-generic x86_64 GNU/Linux

Version

uv 0.7.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for clarification or support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions