Merge pull request #290059 from mweinelt/accelerate-cudatoolkit-optional

python311Packages.accelerate: make cudatoolkit usage conditional
This commit is contained in:
Martin Weinelt 2024-02-20 01:32:53 +01:00 committed by GitHub
commit b56485b679
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,6 +11,7 @@
, pyyaml
, safetensors
, torch
, config
, cudatoolkit
, evaluate
, parameterized
@ -51,7 +52,7 @@ buildPythonPackage rec {
preCheck = ''
export HOME=$(mktemp -d)
export PATH=$out/bin:$PATH
'' + lib.optionalString (lib.meta.availableOn stdenv.hostPlatform cudatoolkit) ''
'' + lib.optionalString config.cudaSupport ''
export TRITON_PTXAS_PATH="${cudatoolkit}/bin/ptxas"
'';
pytestFlagsArray = [ "tests" ];
@ -75,7 +76,8 @@ buildPythonPackage rec {
] ++ lib.optionals (stdenv.isLinux && stdenv.isAarch64) [
# usual aarch64-linux RuntimeError: DataLoader worker (pid(s) <...>) exited unexpectedly
"CheckpointTest"
# requires ptxas from cudatoolkit, which is unavailable on aarch64-linux
] ++ lib.optionals (!config.cudaSupport) [
# requires ptxas from cudatoolkit, which is unfree
"test_dynamo_extract_model"
] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# RuntimeError: torch_shm_manager: execl failed: Permission denied