onnxruntime: init at 1.10.0 (resurrected)

authored by

Brian McKenna and committed by
Jonathan Ringer
579237db 953213ab

+137 -1
+135
pkgs/development/libraries/onnxruntime/default.nix
···
··· 1 + { stdenv 2 + , lib 3 + , fetchFromGitHub 4 + , fetchpatch 5 + , runCommand 6 + , patchutils 7 + , pkg-config 8 + , glibcLocales 9 + , cmake 10 + , python3 11 + , libpng 12 + , zlib 13 + , eigen 14 + , protobuf 15 + , nsync 16 + , flatbuffers 17 + , howard-hinnant-date 18 + , re2 19 + , nlohmann_json 20 + , boost 21 + , oneDNN 22 + }: 23 + 24 + let 25 + externals = { 26 + pytorch_cpuinfo = fetchFromGitHub { 27 + owner = "pytorch"; 28 + repo = "cpuinfo"; 29 + rev = "5916273f79a21551890fd3d56fc5375a78d1598d"; 30 + sha256 = "sha256-nXBnloVTuB+AVX59VDU/Wc+Dsx94o92YQuHp3jowx2A="; 31 + }; 32 + onnx = fetchFromGitHub { 33 + owner = "onnx"; 34 + repo = "onnx"; 35 + rev = "be76ca7148396176784ba8733133b9fb1186ea0d"; 36 + sha256 = "sha256-WwbfUijV67LL69RPgz+4m6EcwSyBNFweGUe0jkYRpbg="; 37 + }; 38 + "SafeInt/safeint" = fetchFromGitHub { 39 + owner = "dcleblanc"; 40 + repo = "SafeInt"; 41 + rev = "a104e0cf23be4fe848f7ef1f3e8996fe429b06bb"; 42 + sha256 = "sha256-LmQNIoHPqvl8asn86P33SDn+lCg8LpLfxUmoG9CGEdc="; 43 + }; 44 + }; 45 + in 46 + stdenv.mkDerivation rec { 47 + pname = "onnxruntime"; 48 + version = "1.10.0"; 49 + 50 + src = fetchFromGitHub { 51 + owner = "microsoft"; 52 + repo = "onnxruntime"; 53 + rev = "v${version}"; 54 + sha256 = "sha256-kWl0xrbTQL2FBSvpiqTcaj8uZV+ZV8gJJvj4/I0jopw="; 55 + }; 56 + 57 + preConfigure = lib.concatStringsSep "\n" (lib.mapAttrsToList (name: path: '' 58 + rmdir cmake/external/${name} 59 + ln -s ${path} cmake/external/${name} 60 + '') externals); 61 + 62 + patches = [ 63 + # Exclude the flatbuffers change which breaks things 64 + (runCommand "filtered" { 65 + AUR_PATCH = fetchpatch { 66 + name = "aur-build-fixes.patch"; 67 + url = "https://aur.archlinux.org/cgit/aur.git/plain/build-fixes.patch?h=python-onnxruntime&id=0185531906bda3a9aba93bbb0f3dcfeb0ae671ad"; 68 + sha256 = "sha256-bAJWThTbECQaoqDdkjHLneg6I1BshGMyCWaj7nfACvA="; 69 + }; 70 + } '' 71 + ${patchutils}/bin/filterdiff --hunks 1,2 $AUR_PATCH > $out 72 + '') 73 + (fetchpatch { 74 + name = "system-dnnl.patch"; 75 + url = "https://aur.archlinux.org/cgit/aur.git/plain/system-dnnl.diff?h=python-onnxruntime&id=0185531906bda3a9aba93bbb0f3dcfeb0ae671ad"; 76 + sha256 = "sha256-58RBrQnAWNtc/1pmFs+PkZ6qCsL1LfMY3P0exMKzotA="; 77 + }) 78 + ]; 79 + 80 + # TODO: build server, and move .so's to lib output 81 + outputs = [ "out" "dev" ]; 82 + 83 + nativeBuildInputs = [ 84 + cmake 85 + pkg-config 86 + python3 87 + ]; 88 + 89 + buildInputs = [ 90 + libpng 91 + zlib 92 + protobuf 93 + nsync 94 + flatbuffers 95 + howard-hinnant-date 96 + re2 97 + nlohmann_json 98 + boost 99 + oneDNN 100 + ]; 101 + 102 + cmakeDir = "../cmake"; 103 + 104 + cmakeFlags = [ 105 + "-Donnxruntime_PREFER_SYSTEM_LIB=ON" 106 + "-Donnxruntime_BUILD_SHARED_LIB=ON" 107 + "-Donnxruntime_ENABLE_LTO=ON" 108 + "-Donnxruntime_BUILD_UNIT_TESTS=OFF" 109 + "-Donnxruntime_USE_PREINSTALLED_EIGEN=ON" 110 + "-Donnxruntime_USE_MPI=ON" 111 + "-Deigen_SOURCE_PATH=${eigen.src}" 112 + "-Donnxruntime_USE_DNNL=YES" 113 + ]; 114 + 115 + enableParallelBuilding = true; 116 + 117 + meta = { 118 + description = "Cross-platform, high performance scoring engine for ML models"; 119 + longDescription = '' 120 + ONNX Runtime is a performance-focused complete scoring engine 121 + for Open Neural Network Exchange (ONNX) models, with an open 122 + extensible architecture to continually address the latest developments 123 + in AI and Deep Learning. ONNX Runtime stays up to date with the ONNX 124 + standard with complete implementation of all ONNX operators, and 125 + supports all ONNX releases (1.2+) with both future and backwards 126 + compatibility. 127 + ''; 128 + homepage = "https://github.com/microsoft/onnxruntime"; 129 + changelog = "https://github.com/microsoft/onnxruntime/releases"; 130 + # https://github.com/microsoft/onnxruntime/blob/master/BUILD.md#architectures 131 + platforms = lib.platforms.unix; 132 + license = lib.licenses.mit; 133 + maintainers = with lib.maintainers; [ jonringer puffnfresh ]; 134 + }; 135 + }
-1
pkgs/top-level/aliases.nix
··· 989 odpdown = throw "odpdown has been removed because it lacks python3 support"; # Added 2022-04-25 990 ofp = throw "ofp is not compatible with odp-dpdk"; 991 olifant = throw "olifant has been removed from nixpkgs, as it was unmaintained"; # Added 2021-08-05 992 - onnxruntime = throw "onnxruntime has been removed due to poor maintainability"; # Added 2020-12-04 993 openbazaar = throw "openbazzar has been removed from nixpkgs as upstream has abandoned the project"; # Added 2022-01-06 994 openbazaar-client = throw "openbazzar-client has been removed from nixpkgs as upstream has abandoned the project"; # Added 2022-01-06 995 opencascade_oce = throw "'opencascade_oce' has been renamed to/replaced by 'opencascade'"; # Converted to throw 2022-02-22
··· 989 odpdown = throw "odpdown has been removed because it lacks python3 support"; # Added 2022-04-25 990 ofp = throw "ofp is not compatible with odp-dpdk"; 991 olifant = throw "olifant has been removed from nixpkgs, as it was unmaintained"; # Added 2021-08-05 992 openbazaar = throw "openbazzar has been removed from nixpkgs as upstream has abandoned the project"; # Added 2022-01-06 993 openbazaar-client = throw "openbazzar-client has been removed from nixpkgs as upstream has abandoned the project"; # Added 2022-01-06 994 opencascade_oce = throw "'opencascade_oce' has been renamed to/replaced by 'opencascade'"; # Converted to throw 2022-02-22
+2
pkgs/top-level/all-packages.nix
··· 4382 4383 online-judge-tools = with python3.pkgs; toPythonApplication online-judge-tools; 4384 4385 xkbd = callPackage ../applications/misc/xkbd { }; 4386 4387 libpsm2 = callPackage ../os-specific/linux/libpsm2 { };
··· 4382 4383 online-judge-tools = with python3.pkgs; toPythonApplication online-judge-tools; 4384 4385 + onnxruntime = callPackage ../development/libraries/onnxruntime { }; 4386 + 4387 xkbd = callPackage ../applications/misc/xkbd { }; 4388 4389 libpsm2 = callPackage ../os-specific/linux/libpsm2 { };