Unverified Commit 205ef081 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

python3Packages.flashinfer: 0.6.1 -> 0.6.4 (#495151)

parents f9ddc75f 8ad1990c
Loading
Loading
Loading
Loading
+69 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  cmake,
  cython,
  ninja,
  scikit-build-core,
  setuptools-scm,

  # dependencies
  typing-extensions,

  # tests
  numpy,
  pytestCheckHook,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "apache-tvm-ffi";
  version = "0.1.9";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "apache";
    repo = "tvm-ffi";
    tag = "v${finalAttrs.version}";
    fetchSubmodules = true;
    hash = "sha256-XnlM//WW2TbjbmzYBq6itJQ7R3J646UMVQUVhV5Afwc=";
  };

  build-system = [
    cmake
    cython
    ninja
    scikit-build-core
    setuptools-scm
  ];
  dontUseCmakeConfigure = true;

  dependencies = [
    typing-extensions
  ];

  optional-dependencies = {
    cpp = [
      ninja
    ];
  };

  pythonImportsCheck = [ "tvm_ffi" ];

  nativeCheckInputs = [
    numpy
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  meta = {
    description = "Open ABI and FFI for Machine Learning Systems";
    changelog = "https://github.com/apache/tvm-ffi/releases/tag/${finalAttrs.src.tag}";
    homepage = "https://github.com/apache/tvm-ffi";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
})
+52 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools,
  setuptools-scm,

  # tests
  pytest-mock,
  pytestCheckHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "cuda-pathfinder";
  version = "1.4.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "NVIDIA";
    repo = "cuda-python";
    tag = "cuda-pathfinder-v${finalAttrs.version}";
    hash = "sha256-Bsou6vLyMBNbVMPT4vtnWpoi05lXG6pjhuee6Hg/Mm8=";
  };

  sourceRoot = "${finalAttrs.src.name}/cuda_pathfinder";

  build-system = [
    setuptools
    setuptools-scm
  ];

  pythonImportsCheck = [
    "cuda"
    "cuda.pathfinder"
  ];

  nativeCheckInputs = [
    pytest-mock
    pytestCheckHook
  ];

  meta = {
    description = "one-stop solution for locating CUDA components";
    homepage = "https://github.com/NVIDIA/cuda-python/tree/main/cuda_pathfinder";
    changelog = "https://nvidia.github.io/cuda-python/cuda-pathfinder/${finalAttrs.version}/release/${finalAttrs.version}-notes.html";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ GaetanLepage ];
    platforms = lib.platforms.linux;
  };
})
+30 −18
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  cython,
  fastrlock,
  numpy,
  pytestCheckHook,
  mock,
  setuptools,

  # nativeBuildInputs
  cudaPackages,
  addDriverRunpath,
  symlinkJoin,
  addDriverRunpath,

  # dependencies
  numpy,
  cuda-pathfinder,

  # tests
  pytest-mock,
  pytestCheckHook,
}:

let
@@ -39,8 +46,7 @@ let
      libcurand
      libcusolver
      libcusparse
      # NOTE: libcusparse_lt is too new for CuPy, so we must do without.
      # libcusparse_lt
      libcusparse_lt # cusparseLt.h
    ]
  );
  cudatoolkit-joined = symlinkJoin {
@@ -49,19 +55,26 @@ let
      outpaths ++ lib.concatMap (outpath: lib.map (output: outpath.${output}) outpath.outputs) outpaths;
  };
in
buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {
buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } (finalAttrs: {
  pname = "cupy";
  version = "13.6.0";
  version = "14.0.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "cupy";
    repo = "cupy";
    tag = "v${version}";
    hash = "sha256-nU3VL0MSCN+mI5m7C5sKAjBSL6ybM6YAk5lJiIDY0ck=";
    tag = "v${finalAttrs.version}";
    fetchSubmodules = true;
    hash = "sha256-TaEJ0BveUCXCRrNq9L49Tfbu0334+cANcVm5qnSOE1Q=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail \
        "Cython>=3.1,<3.2" \
        "Cython"
  '';

  env = {
    LDFLAGS = toString [
      # Fake libcuda.so (the real one is deployed impurely)
@@ -83,7 +96,6 @@ buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {

  build-system = [
    cython
    fastrlock
    setuptools
  ];

@@ -100,13 +112,13 @@ buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {
  ];

  dependencies = [
    fastrlock
    cuda-pathfinder
    numpy
  ];

  nativeCheckInputs = [
    pytest-mock
    pytestCheckHook
    mock
  ];

  # Won't work with the GPU, whose drivers won't be accessible from the build
@@ -124,12 +136,12 @@ buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {
  meta = {
    description = "NumPy-compatible matrix library accelerated by CUDA";
    homepage = "https://cupy.chainer.org/";
    changelog = "https://github.com/cupy/cupy/releases/tag/${src.tag}";
    changelog = "https://github.com/cupy/cupy/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    platforms = [
      "aarch64-linux"
      "x86_64-linux"
    ];
    maintainers = [ ];
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
}
})
+10 −15
Original line number Diff line number Diff line
@@ -9,9 +9,9 @@
  config,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch2,

  # build-system
  apache-tvm-ffi,
  setuptools,

  # nativeBuildInputs
@@ -29,30 +29,24 @@
  tqdm,
}:

buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
  pname = "flashinfer";
  version = "0.6.1";
  version = "0.6.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "flashinfer-ai";
    repo = "flashinfer";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    fetchSubmodules = true;
    hash = "sha256-NRjas11VvvCY6MZiZaYtxG5MXEaFqfbhJxflUT/uraE=";
    hash = "sha256-Hq3oTeEJHRvXwThI8vc06E3Ot/FnPP0sZUfze3ISa2o=";
  };

  patches = [
    # TODO: remove patch with update to v0.5.2+
    # Switch pynvml to nvidia-ml-py
    (fetchpatch2 {
      url = "https://github.com/flashinfer-ai/flashinfer/commit/a42f99255d68d1a54b689bd4985339c6b44963a6.patch?full_index=1";
      hash = "sha256-3XJFcdQeZ/c5fwiQvd95z4p9BzTn8pjle21WzeBxUgk=";
    })
  build-system = [
    apache-tvm-ffi
    setuptools
  ];

  build-system = [ setuptools ];

  nativeBuildInputs = [
    cmake
    ninja
@@ -91,6 +85,7 @@ buildPythonPackage rec {

  pythonRemoveDeps = [
    "nvidia-cudnn-frontend"
    "nvidia-cutlass-dsl"
  ];
  dependencies = [
    click
@@ -119,4 +114,4 @@ buildPythonPackage rec {
      daniel-fahey
    ];
  };
}
})
+14 −4
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  hatch-vcs,
  hatchling,
  lib,

  # dependencies
  tomlkit,
}:

buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
  pname = "hatch-min-requirements";
  version = "0.2.0";
  pyproject = true;
@@ -14,7 +19,7 @@ buildPythonPackage rec {
  src = fetchFromGitHub {
    owner = "tlambert03";
    repo = "hatch-min-requirements";
    tag = "v${version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-QKO5fVvjSqwY+48Fc8sAiZazrxZ4eBYxzVElHr2lcEA=";
  };

@@ -23,6 +28,10 @@ buildPythonPackage rec {
    hatch-vcs
  ];

  dependencies = [
    tomlkit
  ];

  # As of v0.1.0 all tests attempt to use the network
  doCheck = false;

@@ -31,9 +40,10 @@ buildPythonPackage rec {
  meta = {
    description = "Hatchling plugin to create optional-dependencies pinned to minimum versions";
    homepage = "https://github.com/tlambert03/hatch-min-requirements";
    changelog = "https://github.com/tlambert03/hatch-min-requirements/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [
      samuela
    ];
  };
}
})
Loading