diff options
Diffstat (limited to 'nixpkgs/pkgs/development/cuda-modules/cutensor')
11 files changed, 544 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/extension.nix b/nixpkgs/pkgs/development/cuda-modules/cutensor/extension.nix new file mode 100644 index 000000000000..b762fd22ede8 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/extension.nix @@ -0,0 +1,164 @@ +# Support matrix can be found at +# https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-880/support-matrix/index.html +# +# TODO(@connorbaker): +# This is a very similar strategy to CUDA/CUDNN: +# +# - Get all versions supported by the current release of CUDA +# - Build all of them +# - Make the newest the default +# +# Unique twists: +# +# - Instead of providing different releases for each version of CUDA, CuTensor has multiple subdirectories in `lib` +# -- one for each version of CUDA. +{ + cudaVersion, + flags, + hostPlatform, + lib, + mkVersionedPackageName, +}: +let + inherit (lib) + attrsets + lists + modules + versions + strings + trivial + ; + + redistName = "cutensor"; + pname = "libcutensor"; + + cutensorVersions = [ + "1.3.3" + "1.4.0" + "1.5.0" + "1.6.2" + "1.7.0" + ]; + + # Manifests :: { redistrib, feature } + + # Each release of cutensor gets mapped to an evaluated module for that release. + # From there, we can get the min/max CUDA versions supported by that release. + # listOfManifests :: List Manifests + listOfManifests = + let + configEvaluator = + fullCutensorVersion: + modules.evalModules { + modules = [ + ../modules + # We need to nest the manifests in a config.cutensor.manifests attribute so the + # module system can evaluate them. + { + cutensor.manifests = { + redistrib = trivial.importJSON (./manifests + "/redistrib_${fullCutensorVersion}.json"); + feature = trivial.importJSON (./manifests + "/feature_${fullCutensorVersion}.json"); + }; + } + ]; + }; + # Un-nest the manifests attribute set. + releaseGrabber = evaluatedModules: evaluatedModules.config.cutensor.manifests; + in + lists.map + (trivial.flip trivial.pipe [ + configEvaluator + releaseGrabber + ]) + cutensorVersions; + + # Our cudaVersion tells us which version of CUDA we're building against. + # The subdirectories in lib/ tell us which versions of CUDA are supported. + # Typically the names will look like this: + # + # - 10.2 + # - 11 + # - 11.0 + # - 12 + + # libPath :: String + libPath = + let + cudaMajorMinor = versions.majorMinor cudaVersion; + cudaMajor = versions.major cudaVersion; + in + if cudaMajorMinor == "10.2" then cudaMajorMinor else cudaMajor; + + # A release is supported if it has a libPath that matches our CUDA version for our platform. + # LibPath are not constant across the same release -- one platform may support fewer + # CUDA versions than another. + redistArch = flags.getRedistArch hostPlatform.system; + # platformIsSupported :: Manifests -> Boolean + platformIsSupported = + {feature, ...}: + (attrsets.attrByPath + [ + pname + redistArch + ] + null + feature + ) != null; + + # TODO(@connorbaker): With an auxilliary file keeping track of the CUDA versions each release supports, + # we could filter out releases that don't support our CUDA version. + # However, we don't have that currently, so we make a best-effort to try to build TensorRT with whatever + # libPath corresponds to our CUDA version. + # supportedManifests :: List Manifests + supportedManifests = builtins.filter platformIsSupported listOfManifests; + + # Compute versioned attribute name to be used in this package set + # Patch version changes should not break the build, so we only use major and minor + # computeName :: RedistribRelease -> String + computeName = {version, ...}: mkVersionedPackageName redistName version; +in +final: _: +let + # buildCutensorPackage :: Manifests -> AttrSet Derivation + buildCutensorPackage = + {redistrib, feature}: + let + drv = final.callPackage ../generic-builders/manifest.nix { + inherit pname redistName libPath; + redistribRelease = redistrib.${pname}; + featureRelease = feature.${pname}; + }; + fixedDrv = drv.overrideAttrs ( + prevAttrs: { + buildInputs = + prevAttrs.buildInputs + ++ lists.optionals (strings.versionOlder cudaVersion "11.4") [final.cudatoolkit] + ++ lists.optionals (strings.versionAtLeast cudaVersion "11.4") ( + [final.libcublas.lib] + # For some reason, the 1.4.x release of cuTENSOR requires the cudart library. + ++ lists.optionals (strings.hasPrefix "1.4" redistrib.${pname}.version) [final.cuda_cudart.lib] + ); + meta = prevAttrs.meta // { + description = "cuTENSOR: A High-Performance CUDA Library For Tensor Primitives"; + homepage = "https://developer.nvidia.com/cutensor"; + maintainers = prevAttrs.meta.maintainers ++ [lib.maintainers.obsidian-systems-maintenance]; + license = lib.licenses.unfreeRedistributable // { + shortName = "cuTENSOR EULA"; + name = "cuTENSOR SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS"; + url = "https://docs.nvidia.com/cuda/cutensor/license.html"; + }; + }; + } + ); + in + attrsets.nameValuePair (computeName redistrib.${pname}) fixedDrv; + + extension = + let + nameOfNewest = computeName (lists.last supportedManifests).redistrib.${pname}; + drvs = builtins.listToAttrs (lists.map buildCutensorPackage supportedManifests); + containsDefault = attrsets.optionalAttrs (drvs != {}) {cutensor = drvs.${nameOfNewest};}; + in + drvs // containsDefault; +in +extension diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.3.3.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.3.3.json new file mode 100644 index 000000000000..99679aecbc44 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.3.3.json @@ -0,0 +1,44 @@ +{ + "libcutensor": { + "linux-ppc64le": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-sbsa": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "windows-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": false, + "sample": false, + "static": false + } + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.4.0.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.4.0.json new file mode 100644 index 000000000000..99679aecbc44 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.4.0.json @@ -0,0 +1,44 @@ +{ + "libcutensor": { + "linux-ppc64le": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-sbsa": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "windows-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": false, + "sample": false, + "static": false + } + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.5.0.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.5.0.json new file mode 100644 index 000000000000..99679aecbc44 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.5.0.json @@ -0,0 +1,44 @@ +{ + "libcutensor": { + "linux-ppc64le": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-sbsa": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "windows-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": false, + "sample": false, + "static": false + } + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.6.2.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.6.2.json new file mode 100644 index 000000000000..99679aecbc44 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.6.2.json @@ -0,0 +1,44 @@ +{ + "libcutensor": { + "linux-ppc64le": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-sbsa": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "windows-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": false, + "sample": false, + "static": false + } + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.7.0.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.7.0.json new file mode 100644 index 000000000000..99679aecbc44 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/feature_1.7.0.json @@ -0,0 +1,44 @@ +{ + "libcutensor": { + "linux-ppc64le": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-sbsa": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "linux-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": true, + "sample": false, + "static": true + } + }, + "windows-x86_64": { + "outputs": { + "bin": false, + "dev": true, + "doc": false, + "lib": false, + "sample": false, + "static": false + } + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.3.3.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.3.3.json new file mode 100644 index 000000000000..ca12b8c92e98 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.3.3.json @@ -0,0 +1,32 @@ +{ + "release_date": "2021-09-22", + "libcutensor": { + "name": "NVIDIA cuTENSOR", + "license": "cuTensor", + "version": "1.3.3.2", + "linux-x86_64": { + "relative_path": "libcutensor/linux-x86_64/libcutensor-linux-x86_64-1.3.3.2-archive.tar.xz", + "sha256": "2e9517f31305872a7e496b6aa8ea329acda6b947b0c1eb1250790eaa2d4e2ecc", + "md5": "977699555cfcc8d2ffeff018a0f975b0", + "size": "201849628" + }, + "linux-ppc64le": { + "relative_path": "libcutensor/linux-ppc64le/libcutensor-linux-ppc64le-1.3.3.2-archive.tar.xz", + "sha256": "79f294c4a7933e5acee5f150145c526d6cd4df16eefb63f2d65df1dbc683cd68", + "md5": "1f632c9d33ffef9c819e10c95d69a134", + "size": "202541908" + }, + "linux-sbsa": { + "relative_path": "libcutensor/linux-sbsa/libcutensor-linux-sbsa-1.3.3.2-archive.tar.xz", + "sha256": "0b62d5305abfdfca4776290f16a1796c78c1fa83b203680c012f37d44706fcdb", + "md5": "e476675490aff0b154f2f38063f0c10b", + "size": "149059520" + }, + "windows-x86_64": { + "relative_path": "libcutensor/windows-x86_64/libcutensor-windows-x86_64-1.3.3.2-archive.zip", + "sha256": "3abeacbe7085af7026ca1399a77c681c219c10a1448a062964e97aaac2b05851", + "md5": "fe75f031c53260c00ad5f7c5d69d31e5", + "size": "374926147" + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.4.0.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.4.0.json new file mode 100644 index 000000000000..45008c2d0af9 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.4.0.json @@ -0,0 +1,32 @@ +{ + "release_date": "2021-11-19", + "libcutensor": { + "name": "NVIDIA cuTENSOR", + "license": "cuTensor", + "version": "1.4.0.6", + "linux-x86_64": { + "relative_path": "libcutensor/linux-x86_64/libcutensor-linux-x86_64-1.4.0.6-archive.tar.xz", + "sha256": "467ba189195fcc4b868334fc16a0ae1e51574139605975cc8004cedebf595964", + "md5": "5d4009390be0226fc3ee75d225053123", + "size": "218277136" + }, + "linux-ppc64le": { + "relative_path": "libcutensor/linux-ppc64le/libcutensor-linux-ppc64le-1.4.0.6-archive.tar.xz", + "sha256": "5da44ff2562ab7b9286122653e54f28d2222c8aab4bb02e9bdd4cf7e4b7809be", + "md5": "6058c728485072c980f652c2de38b016", + "size": "218951992" + }, + "linux-sbsa": { + "relative_path": "libcutensor/linux-sbsa/libcutensor-linux-sbsa-1.4.0.6-archive.tar.xz", + "sha256": "6b06d63a5bc49c1660be8c307795f8a901c93dcde7b064455a6c81333c7327f4", + "md5": "a6f3fd515c052df43fbee9508ea87e1e", + "size": "163596044" + }, + "windows-x86_64": { + "relative_path": "libcutensor/windows-x86_64/libcutensor-windows-x86_64-1.4.0.6-archive.zip", + "sha256": "4f01a8aac2c25177e928c63381a80e3342f214ec86ad66965dcbfe81fc5c901d", + "md5": "d21e0d5f2bd8c29251ffacaa85f0d733", + "size": "431385567" + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.5.0.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.5.0.json new file mode 100644 index 000000000000..fe1852f261f2 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.5.0.json @@ -0,0 +1,32 @@ +{ + "release_date": "2022-03-08", + "libcutensor": { + "name": "NVIDIA cuTENSOR", + "license": "cuTensor", + "version": "1.5.0.3", + "linux-x86_64": { + "relative_path": "libcutensor/linux-x86_64/libcutensor-linux-x86_64-1.5.0.3-archive.tar.xz", + "sha256": "4fdebe94f0ba3933a422cff3dd05a0ef7a18552ca274dd12564056993f55471d", + "md5": "7e1b1a613b819d6cf6ee7fbc70f16105", + "size": "208925360" + }, + "linux-ppc64le": { + "relative_path": "libcutensor/linux-ppc64le/libcutensor-linux-ppc64le-1.5.0.3-archive.tar.xz", + "sha256": "ad736acc94e88673b04a3156d7d3a408937cac32d083acdfbd8435582cbe15db", + "md5": "bcdafb6d493aceebfb9a420880f1486c", + "size": "208384668" + }, + "linux-sbsa": { + "relative_path": "libcutensor/linux-sbsa/libcutensor-linux-sbsa-1.5.0.3-archive.tar.xz", + "sha256": "5b9ac479b1dadaf40464ff3076e45f2ec92581c07df1258a155b5bcd142f6090", + "md5": "62149d726480d12c9a953d27edc208dc", + "size": "156512748" + }, + "windows-x86_64": { + "relative_path": "libcutensor/windows-x86_64/libcutensor-windows-x86_64-1.5.0.3-archive.zip", + "sha256": "de76f7d92600dda87a14ac756e9d0b5733cbceb88bcd20b3935a82c99342e6cd", + "md5": "66feef08de8c7fccf7269383e663fd06", + "size": "421810766" + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.6.2.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.6.2.json new file mode 100644 index 000000000000..95b3706fc56f --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.6.2.json @@ -0,0 +1,32 @@ +{ + "release_date": "2022-12-12", + "libcutensor": { + "name": "NVIDIA cuTENSOR", + "license": "cuTensor", + "version": "1.6.2.3", + "linux-x86_64": { + "relative_path": "libcutensor/linux-x86_64/libcutensor-linux-x86_64-1.6.2.3-archive.tar.xz", + "sha256": "0f2745681b1d0556f9f46ff6af4937662793498d7367b5f8f6b8625ac051629e", + "md5": "b84a2f6712e39314f6c54b429152339f", + "size": "538838404" + }, + "linux-ppc64le": { + "relative_path": "libcutensor/linux-ppc64le/libcutensor-linux-ppc64le-1.6.2.3-archive.tar.xz", + "sha256": "558329fa05409f914ebbe218a1cf7c9ccffdb7aa2642b96db85fd78b5ad534d1", + "md5": "8d5d129aa7863312a95084ab5a27b7e7", + "size": "535585612" + }, + "linux-sbsa": { + "relative_path": "libcutensor/linux-sbsa/libcutensor-linux-sbsa-1.6.2.3-archive.tar.xz", + "sha256": "7d4d9088c892bb692ffd70750b49625d1ccbb85390f6eb7c70d6cf582df6d935", + "md5": "f6e0cce3a3b38ced736e55a19da587a3", + "size": "450705724" + }, + "windows-x86_64": { + "relative_path": "libcutensor/windows-x86_64/libcutensor-windows-x86_64-1.6.2.3-archive.zip", + "sha256": "07cb312d7cafc7bb2f33d775e1ef5fffd1703d5c6656e785a7a8f0f01939907e", + "md5": "5ae1c56bf4d457933dc1acb58a4ac995", + "size": "1063805254" + } + } +} diff --git a/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.7.0.json b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.7.0.json new file mode 100644 index 000000000000..f09abaa62940 --- /dev/null +++ b/nixpkgs/pkgs/development/cuda-modules/cutensor/manifests/redistrib_1.7.0.json @@ -0,0 +1,32 @@ +{ + "release_date": "2023-03-16", + "libcutensor": { + "name": "NVIDIA cuTENSOR", + "license": "cuTensor", + "version": "1.7.0.1", + "linux-x86_64": { + "relative_path": "libcutensor/linux-x86_64/libcutensor-linux-x86_64-1.7.0.1-archive.tar.xz", + "sha256": "dd3557891371a19e73e7c955efe5383b0bee954aba6a30e4892b0e7acb9deb26", + "md5": "7c7e655e2ef1c57ede351f5f5c7c59be", + "size": "542970468" + }, + "linux-ppc64le": { + "relative_path": "libcutensor/linux-ppc64le/libcutensor-linux-ppc64le-1.7.0.1-archive.tar.xz", + "sha256": "af4ad5e29dcb636f1bf941ed1fd7fc8053eeec4813fbc0b41581e114438e84c8", + "md5": "30739decf9f5267f2a5f28c7c1a1dc3d", + "size": "538487672" + }, + "linux-sbsa": { + "relative_path": "libcutensor/linux-sbsa/libcutensor-linux-sbsa-1.7.0.1-archive.tar.xz", + "sha256": "c31f8e4386539434a5d1643ebfed74572011783b4e21b62be52003e3a9de3720", + "md5": "3185c17e8f32c9c54f591006b917365e", + "size": "454324456" + }, + "windows-x86_64": { + "relative_path": "libcutensor/windows-x86_64/libcutensor-windows-x86_64-1.7.0.1-archive.zip", + "sha256": "cdbb53bcc1c7b20ee0aa2dee781644a324d2d5e8065944039024fe22d6b822ab", + "md5": "7d20a5823e94074e273525b0713f812b", + "size": "1070143817" + } + } +} |