# Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=standalone PYTHON_COMPAT=( python3_{12..14} ) DISTUTILS_SINGLE_IMPL=1 inherit distutils-r1 pypi DESCRIPTION="FlashInfer: kernel library for LLM serving (Python frontend)" HOMEPAGE=" https://github.com/flashinfer-ai/flashinfer https://pypi.org/project/flashinfer-python/ " LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 MIT NVIDIA-CUDA NVIDIA-SDK" SLOT="0" KEYWORDS="~amd64" # Required JIT sources carry NVIDIA proprietary and TensorRT source-code # notices. The sdist has no runnable project test suite; its testing helpers # and meaningful JIT checks require a CUDA device and nvcc. RESTRICT="bindist mirror test" # The wheel build itself is pure Python, but the installed CUDA sources and # vendored CUTLASS, spdlog and CCCL headers are compiled with nvcc on demand. # Keep the runtime JIT self-contained rather than relying on an undeclared # user-provided CUDA toolchain. RDEPEND=" app-alternatives/ninja dev-util/nvidia-cuda-toolkit:= sci-ml/pytorch[${PYTHON_SINGLE_USEDEP}] sci-ml/caffe2[cuda,-rocm] sys-devel/gcc:*[cxx] $(python_gen_cond_dep ' >=dev-python/apache-tvm-ffi-0.1.6[${PYTHON_USEDEP}] =dev-python/cuda-tile-bin-1.4.0[${PYTHON_USEDEP}] dev-python/einops[${PYTHON_USEDEP}] dev-python/filelock[${PYTHON_USEDEP}] dev-python/jinja2[${PYTHON_USEDEP}] dev-python/numpy[${PYTHON_USEDEP}] >=dev-python/nvidia-cudnn-frontend-1.13.0[${PYTHON_USEDEP}] >=dev-python/nvidia-cutlass-dsl-4.5.0[${PYTHON_USEDEP}] dev-python/nvidia-ml-py[${PYTHON_USEDEP}] >=dev-python/packaging-24.2[${PYTHON_USEDEP}] dev-python/requests[${PYTHON_USEDEP}] dev-python/tabulate[${PYTHON_USEDEP}] dev-python/tqdm[${PYTHON_USEDEP}] dev-python/typing-extensions[${PYTHON_USEDEP}] ~dev-python/flashinfer-cubin-'${PV}'[${PYTHON_USEDEP}] ') " BDEPEND=" $(python_gen_cond_dep ' >=dev-python/setuptools-77[${PYTHON_USEDEP}] >=dev-python/packaging-24[${PYTHON_USEDEP}] >=dev-python/apache-tvm-ffi-0.1.6[${PYTHON_USEDEP}]