Skip to content

Commit

Permalink
python312Packages.torchbench: 0.0.31 (#349472)
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol authored Oct 20, 2024
2 parents f8f1811 + 1f8a363 commit d5627df
Show file tree
Hide file tree
Showing 5 changed files with 238 additions and 0 deletions.
58 changes: 58 additions & 0 deletions pkgs/development/python-modules/monkeytype/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
libcst,
mypy-extensions,
pytestCheckHook,
}:

buildPythonPackage rec {
pname = "monkeytype";
version = "23.3.0";
pyproject = true;

src = fetchFromGitHub {
owner = "Instagram";
repo = "MonkeyType";
rev = "refs/tags/v${version}";
hash = "sha256-DQ/3go53+0PQkhZcL2dX8MI/z4Iq7kTYd5EbacMNxT4=";
};

build-system = [
setuptools
];

dependencies = [
libcst
mypy-extensions
];

pythonImportsCheck = [
"monkeytype"
];

nativeCheckInputs = [
pytestCheckHook
];

disabledTests = [
# Disable broken tests
"test_excludes_site_packages"
"test_callee_throws_recovers"
"test_nested_callee_throws_recovers"
"test_caller_handles_callee_exception"
"test_generator_trace"
"test_return_none"
"test_access_property"
];

meta = {
description = "Python library that generates static type annotations by collecting runtime types";
homepage = "https://github.com/Instagram/MonkeyType/";
changelog = "https://github.com/Instagram/MonkeyType/blob/${src.rev}/CHANGES.rst";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ drupol ];
};
}
52 changes: 52 additions & 0 deletions pkgs/development/python-modules/sotabenchapi/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
click,
requests,
tabulate,
}:

let
version = "0.0.16";
pname = "sotabenchapi";
in
buildPythonPackage {
inherit pname version;
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-thbVH4aLmEgi8K17PkmbUg4nHqGj+dEiXPDILjvQMzk=";
};

# requirements.txt is missing in the Pypi archive and this makes the setup.py script fails
postPatch = ''
touch requirements.txt
'';

build-system = [
setuptools
];

dependencies = [
click
requests
tabulate
];

pythonImportsCheck = [
"sotabenchapi"
];

# No tests
doCheck = false;

meta = {
description = "Easily benchmark Machine Learning models on selected tasks and datasets";
homepage = "https://pypi.org/project/sotabenchapi/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ drupol ];
};
}
62 changes: 62 additions & 0 deletions pkgs/development/python-modules/submitit/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
cloudpickle,
flit-core,
typing-extensions,
pytestCheckHook,
pytest-asyncio,
}:

buildPythonPackage rec {
pname = "submitit";
version = "1.5.2";
pyproject = true;

src = fetchFromGitHub {
owner = "facebookincubator";
repo = "submitit";
rev = "refs/tags/${version}";
hash = "sha256-PDQLzqQjoBAZM9FKsoRby26Pbh4nik3SltIHUw/xWcY=";
};

build-system = [
setuptools
];

dependencies = [
cloudpickle
flit-core
typing-extensions
];

nativeCheckInputs = [
pytestCheckHook
pytest-asyncio
];

pythonImportsCheck = [
"submitit"
];

disabledTests = [
# These tests are broken
"test_snapshot"
"test_snapshot_excludes"
"test_job_use_snapshot_cwd"
"test_job_use_snapshot_modules"
"test_nested_pickling"
"test_setup"
"test_requeuing"
];

meta = {
changelog = "https://github.com/facebookincubator/submitit/releases/tag/${version}";
description = "Python 3.8+ toolbox for submitting jobs to Slurm";
homepage = "https://github.com/facebookincubator/submitit";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ drupol ];
};
}
58 changes: 58 additions & 0 deletions pkgs/development/python-modules/torchbench/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
numpy,
opencv4,
sotabenchapi,
torch,
torchvision,
tqdm,
}:

let
version = "0.0.31";
pname = "torchbench";
in
buildPythonPackage {
inherit pname version;
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-EBZzcnRT50KREIOPrr/OZTJ4639ZUEejcelh3QSBcZ8=";
};

# requirements.txt is missing in the Pypi archive and this makes the setup.py script fails
postPatch = ''
touch requirements.txt
'';

build-system = [
setuptools
];

dependencies = [
numpy
opencv4
sotabenchapi
torch
torchvision
tqdm
];

pythonImportsCheck = [
"torchbench"
];

# No tests
doCheck = false;

meta = {
description = "Easily benchmark machine learning models in PyTorch";
homepage = "https://github.com/paperswithcode/torchbench";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ drupol ];
};
}
8 changes: 8 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8151,6 +8151,8 @@ self: super: with self; {

monkeyhex = callPackage ../development/python-modules/monkeyhex { };

monkeytype = callPackage ../development/python-modules/monkeytype { };

monosat = pkgs.monosat.python {
inherit buildPythonPackage;
inherit (self) cython pytestCheckHook;
Expand Down Expand Up @@ -14649,6 +14651,8 @@ self: super: with self; {

sortedcontainers = callPackage ../development/python-modules/sortedcontainers { };

sotabenchapi = callPackage ../development/python-modules/sotabenchapi { };

soundcard = callPackage ../development/python-modules/soundcard { };

soundcloud-v2 = callPackage ../development/python-modules/soundcloud-v2 { };
Expand Down Expand Up @@ -15146,6 +15150,8 @@ self: super: with self; {

subliminal = callPackage ../development/python-modules/subliminal { };

submitit = callPackage ../development/python-modules/submitit { };

subprocess-tee = callPackage ../development/python-modules/subprocess-tee { };

subunit = callPackage ../development/python-modules/subunit {
Expand Down Expand Up @@ -15774,6 +15780,8 @@ self: super: with self; {
triton = self.triton-bin;
};

torchbench = callPackage ../development/python-modules/torchbench { };

torchsnapshot = callPackage ../development/python-modules/torchsnapshot { };

torchWithCuda = self.torch.override {
Expand Down

0 comments on commit d5627df

Please sign in to comment.