python312Packages.tinygrad: add optional-dependencies (#351006)

This commit is contained in:
Gaétan Lepage
2024-10-27 23:49:04 +01:00
committed by GitHub
@@ -9,14 +9,17 @@
rocmSupport ? config.rocmSupport,
cudaPackages,
ocl-icd,
stdenv,
rocmPackages,
stdenv,
# build-system
setuptools,
# dependencies
llvmlite,
numpy,
triton,
unicorn,
# tests
blobfile,
@@ -25,9 +28,9 @@
hexdump,
hypothesis,
librosa,
networkx,
onnx,
pillow,
pydot,
pytest-xdist,
pytestCheckHook,
safetensors,
@@ -101,6 +104,12 @@ buildPythonPackage rec {
# pyobjc-framework-metal
];
optional-dependencies = {
llvm = [ llvmlite ];
arm = [ unicorn ];
triton = [ triton ];
};
pythonImportsCheck =
[
"tinygrad"
@@ -116,9 +125,9 @@ buildPythonPackage rec {
hexdump
hypothesis
librosa
networkx
onnx
pillow
pydot
pytest-xdist
pytestCheckHook
safetensors
@@ -127,7 +136,7 @@ buildPythonPackage rec {
torch
tqdm
transformers
];
] ++ networkx.optional-dependencies.extra;
preCheck = ''
export HOME=$(mktemp -d)