Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions pkgs/development/python-modules/apache-tvm-ffi/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
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 changes: 52 additions & 0 deletions pkgs/development/python-modules/cuda-pathfinder/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
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;
};
})
48 changes: 30 additions & 18 deletions pkgs/development/python-modules/cupy/default.nix
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
{
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
Expand Down Expand Up @@ -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 {
Expand All @@ -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)
Expand All @@ -83,7 +96,6 @@ buildPythonPackage.override { stdenv = cudaPackages.backendStdenv; } rec {

build-system = [
cython
fastrlock
setuptools
];

Expand All @@ -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
Expand All @@ -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 ];
};
}
})
25 changes: 10 additions & 15 deletions pkgs/development/python-modules/flashinfer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
config,
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,

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

# nativeBuildInputs
Expand All @@ -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
Expand Down Expand Up @@ -91,6 +85,7 @@ buildPythonPackage rec {

pythonRemoveDeps = [
"nvidia-cudnn-frontend"
"nvidia-cutlass-dsl"
];
dependencies = [
click
Expand Down Expand Up @@ -119,4 +114,4 @@ buildPythonPackage rec {
daniel-fahey
];
};
}
})
18 changes: 14 additions & 4 deletions pkgs/development/python-modules/hatch-min-requirements/default.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
{
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;

src = fetchFromGitHub {
owner = "tlambert03";
repo = "hatch-min-requirements";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-QKO5fVvjSqwY+48Fc8sAiZazrxZ4eBYxzVElHr2lcEA=";
};

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

dependencies = [
tomlkit
];

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

Expand All @@ -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
];
};
}
})
15 changes: 11 additions & 4 deletions pkgs/development/python-modules/kmapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
pytestCheckHook,
}:

buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "kmapper";
version = "2.1.0";
pyproject = true;

src = fetchFromGitHub {
owner = "scikit-tda";
repo = "kepler-mapper";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-i909J0yI8v8BqGbCkcjBAdA02Io+qpILdDkojZj0wv4=";
};

Expand All @@ -55,11 +55,18 @@ buildPythonPackage rec {
pytestCheckHook
];

disabledTests = [
# UnboundLocalError: cannot access local variable 'X_blend' where it is not associated with a value
"test_tuple_projection"
"test_tuple_projection_fit"
];

meta = {
description = "Python implementation of Mapper algorithm for Topological Data Analysis";
homepage = "https://kepler-mapper.scikit-tda.org/";
changelog = "https://github.com/scikit-tda/kepler-mapper/releases/tag/v${version}";
downloadPage = "https://github.com/scikit-tda/kepler-mapper";
changelog = "https://github.com/scikit-tda/kepler-mapper/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.mit;
maintainers = [ ];
};
}
})
Loading
Loading