nixpkgs/pkgs/development/python-modules/torchtitan/default.nix
2026-07-06 15:45:37 +00:00

87 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
setuptools,
# dependencies
datasets,
einops,
fsspec,
pillow,
tensorboard,
tokenizers,
tomli,
torch,
torchdata,
transformers,
tyro,
# tests
expecttest,
pytestCheckHook,
tomli-w,
triton,
writableTmpDirAsHomeHook,
}:
buildPythonPackage (finalAttrs: {
pname = "torchtitan";
version = "0.2.2";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "pytorch";
repo = "torchtitan";
tag = "v${finalAttrs.version}";
hash = "sha256-YXbbqNjmPBIFDRbvagHRIy5ph1pZmSerUxlqaF6f4cY=";
};
build-system = [
setuptools
];
dependencies = [
datasets
einops
fsspec
pillow
tensorboard
tokenizers
tomli
torch
torchdata
tyro
];
pythonImportsCheck = [ "torchtitan" ];
nativeCheckInputs = [
expecttest
pytestCheckHook
tomli-w
transformers
triton
writableTmpDirAsHomeHook
];
disabledTests = [
# Require internet access
"test_list_files"
];
disabledTestPaths = [
# Require internet access
"tests/unit_tests/test_tokenizer.py"
];
meta = {
description = "PyTorch native platform for training generative AI models";
homepage = "https://github.com/pytorch/torchtitan";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ GaetanLepage ];
};
})