From efbf097c9b1e698b64f5d1ec290a2cc1093db52b Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 14 Aug 2025 08:16:19 +0200 Subject: [PATCH 1/2] python313Packages.hyper-connections: init at 0.2.1 Module to make multiple residual streams https://github.com/lucidrains/hyper-connections --- .../hyper-connections/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/hyper-connections/default.nix diff --git a/pkgs/development/python-modules/hyper-connections/default.nix b/pkgs/development/python-modules/hyper-connections/default.nix new file mode 100644 index 000000000000..326afc16d2bc --- /dev/null +++ b/pkgs/development/python-modules/hyper-connections/default.nix @@ -0,0 +1,41 @@ +{ + lib, + buildPythonPackage, + einops, + fetchFromGitHub, + hatchling, + pytestCheckHook, + torch, +}: + +buildPythonPackage rec { + pname = "hyper-connections"; + version = "0.2.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "lucidrains"; + repo = "hyper-connections"; + tag = version; + hash = "sha256-9dMiyxzrZBlDxKeehXjoIjbzAkGSkAFxQZZX3LJJAig="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + einops + torch + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "hyper_connections" ]; + + meta = { + description = "Module to make multiple residual streams"; + homepage = "https://github.com/lucidrains/hyper-connections"; + changelog = "https://github.com/lucidrains/hyper-connections/releases/tag/${src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 075037751fe6..984198fbcbd5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6796,6 +6796,8 @@ self: super: with self; { hypchat = callPackage ../development/python-modules/hypchat { }; + hyper-connections = callPackage ../development/python-modules/hyper-connections { }; + hypercorn = callPackage ../development/python-modules/hypercorn { }; hyperframe = callPackage ../development/python-modules/hyperframe { }; From 03fe4efc3794fd7fcedf818d365f725e589ef9b3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 14 Aug 2025 08:19:02 +0200 Subject: [PATCH 2/2] python313Packages.local-attention: init at 1.11.2 Module for local windowed attention for language modeling https://github.com/lucidrains/local-attention --- .../local-attention/default.nix | 48 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 50 insertions(+) create mode 100644 pkgs/development/python-modules/local-attention/default.nix diff --git a/pkgs/development/python-modules/local-attention/default.nix b/pkgs/development/python-modules/local-attention/default.nix new file mode 100644 index 000000000000..1b1ae04a48e4 --- /dev/null +++ b/pkgs/development/python-modules/local-attention/default.nix @@ -0,0 +1,48 @@ +{ + lib, + buildPythonPackage, + einops, + fetchFromGitHub, + hyper-connections, + pytestCheckHook, + setuptools, + torch, +}: + +buildPythonPackage rec { + pname = "local-attention"; + version = "1.11.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "lucidrains"; + repo = "local-attention"; + tag = version; + hash = "sha256-2gBPALJAflLf7Y8L5wnNw4fHcvIOKjOncLsebkhrYkU="; + }; + + postPatch = '' + substituteInPlace setup.py \ + --replace-fail "'pytest-runner'," "" + ''; + + build-system = [ setuptools ]; + + dependencies = [ + einops + hyper-connections + torch + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "local_attention" ]; + + meta = { + description = "Module for local windowed attention for language modeling"; + homepage = "https://github.com/lucidrains/local-attention"; + changelog = "https://github.com/lucidrains/local-attention/releases/tag/${src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 984198fbcbd5..8833c43d5e0b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8645,6 +8645,8 @@ self: super: with self; { loca = callPackage ../development/python-modules/loca { }; + local-attention = callPackage ../development/python-modules/local-attention { }; + localimport = callPackage ../development/python-modules/localimport { }; localstack-client = callPackage ../development/python-modules/localstack-client { };