cudaPackagesGoogle: deprecate as only used by tensorflow

This commit is contained in:
Gaetan Lepage 2024-04-13 02:01:53 +02:00
parent cdf5d71153
commit 9c9f01b670
5 changed files with 14 additions and 19 deletions

View File

@ -22,7 +22,7 @@
, tensorboard
, config
, cudaSupport ? config.cudaSupport
, cudaPackagesGoogle
, cudaPackages
, zlib
, python
, keras-applications
@ -43,7 +43,7 @@ assert ! (stdenv.isDarwin && cudaSupport);
let
packages = import ./binary-hashes.nix;
inherit (cudaPackagesGoogle) cudatoolkit cudnn;
inherit (cudaPackages) cudatoolkit cudnn;
in buildPythonPackage {
pname = "tensorflow" + lib.optionalString cudaSupport "-gpu";
inherit (packages) version;
@ -199,10 +199,6 @@ in buildPythonPackage {
"tensorflow.python.framework"
];
passthru = {
cudaPackages = cudaPackagesGoogle;
};
meta = with lib; {
description = "Computation using data flow graphs for scalable machine learning";
homepage = "http://tensorflow.org";

View File

@ -19,8 +19,8 @@
# https://groups.google.com/a/tensorflow.org/forum/#!topic/developers/iRCt5m4qUz0
, config
, cudaSupport ? config.cudaSupport
, cudaPackagesGoogle
, cudaCapabilities ? cudaPackagesGoogle.cudaFlags.cudaCapabilities
, cudaPackages
, cudaCapabilities ? cudaPackages.cudaFlags.cudaCapabilities
, mklSupport ? false, mkl
, tensorboardSupport ? true
# XLA without CUDA is broken
@ -50,15 +50,15 @@ let
# __ZN4llvm11SmallPtrSetIPKNS_10AllocaInstELj8EED1Ev in any of the
# translation units, so the build fails at link time
stdenv =
if cudaSupport then cudaPackagesGoogle.backendStdenv
if cudaSupport then cudaPackages.backendStdenv
else if originalStdenv.isDarwin then llvmPackages.stdenv
else originalStdenv;
inherit (cudaPackagesGoogle) cudatoolkit nccl;
inherit (cudaPackages) cudatoolkit nccl;
# use compatible cuDNN (https://www.tensorflow.org/install/source#gpu)
# cudaPackages.cudnn led to this:
# https://github.com/tensorflow/tensorflow/issues/60398
cudnnAttribute = "cudnn_8_6";
cudnn = cudaPackagesGoogle.${cudnnAttribute};
cudnn = cudaPackages.${cudnnAttribute};
gentoo-patches = fetchzip {
url = "https://dev.gentoo.org/~perfinion/patches/tensorflow-patches-2.12.0.tar.bz2";
hash = "sha256-SCRX/5/zML7LmKEPJkcM5Tebez9vv/gmE4xhT/jyqWs=";
@ -490,8 +490,8 @@ let
broken =
stdenv.isDarwin
|| !(xlaSupport -> cudaSupport)
|| !(cudaSupport -> builtins.hasAttr cudnnAttribute cudaPackagesGoogle)
|| !(cudaSupport -> cudaPackagesGoogle ? cudatoolkit);
|| !(cudaSupport -> builtins.hasAttr cudnnAttribute cudaPackages)
|| !(cudaSupport -> cudaPackages ? cudatoolkit);
} // lib.optionalAttrs stdenv.isDarwin {
timeout = 86400; # 24 hours
maxSilent = 14400; # 4h, double the default of 7200s
@ -594,7 +594,6 @@ in buildPythonPackage {
# Regression test for #77626 removed because not more `tensorflow.contrib`.
passthru = {
cudaPackages = cudaPackagesGoogle;
deps = bazel-build.deps;
libtensorflow = bazel-build.out;
};

View File

@ -3,7 +3,6 @@
recurseIntoAttrs,
cudaPackages,
cudaPackagesGoogle,
cudaPackages_10_0,
cudaPackages_10_1,

View File

@ -7136,10 +7136,6 @@ with pkgs;
cudaPackages_12_3 = callPackage ./cuda-packages.nix { cudaVersion = "12.3"; };
cudaPackages_12 = cudaPackages_12_2; # Latest supported by cudnn
# Use the older cudaPackages for tensorflow and jax, as determined by cudnn
# compatibility: https://www.tensorflow.org/install/source#gpu
cudaPackagesGoogle = cudaPackages_11;
cudaPackages = recurseIntoAttrs cudaPackages_12;
# TODO: move to alias

View File

@ -14879,6 +14879,8 @@ self: super: with self; {
tensorflow-bin = callPackage ../development/python-modules/tensorflow/bin.nix {
inherit (pkgs.config) cudaSupport;
# https://www.tensorflow.org/install/source#gpu
cudaPackages = pkgs.cudaPackages_11;
};
tensorflow-build = let
@ -14886,6 +14888,8 @@ self: super: with self; {
protobufTF = pkgs.protobuf_21.override {
abseil-cpp = pkgs.abseil-cpp_202301;
};
# https://www.tensorflow.org/install/source#gpu
cudaPackagesTF = pkgs.cudaPackages_11;
grpcTF = (pkgs.grpc.overrideAttrs (
oldAttrs: rec {
# nvcc fails on recent grpc versions, so we use the latest patch level
@ -14931,6 +14935,7 @@ self: super: with self; {
inherit (pkgs.darwin.apple_sdk.frameworks) Foundation Security;
flatbuffers-core = pkgs.flatbuffers;
flatbuffers-python = self.flatbuffers;
cudaPackages = compat.cudaPackagesTF;
protobuf-core = compat.protobufTF;
protobuf-python = compat.protobuf-pythonTF;
grpc = compat.grpcTF;