New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mkl: init at 2019.0.117 #47182
mkl: init at 2019.0.117 #47182
Conversation
This packags the Intel Math Kernel library on x86-64 platforms, which is a dependency for many data science and machine learning packages. Upstream, Intel provides proprietary binary RPMs with a permissive redistribution license. These have been repackaged in both Debian and Anaconda, so we are not the first distribution to redistribute.
@GrahamcOfBorg build mkl |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: mkl Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: mkl Partial log (click to expand)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: mkl Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: mkl Partial log (click to expand)
|
I think borg doesn't like it because it's an unfree package? The platform matches on NixOS. |
threading models. | ||
''; | ||
homepage = https://software.intel.com/en-us/mkl; | ||
license = licenses.issl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use licenses.unfreeRedistributable
to build this on Hydra, or extend isUnfree to support arbitrary unfree redistributable licenses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with
We should probably use licenses.unfreeRedistributable to build this on Hydra
but not with
or extend isUnfree to support arbitrary unfree redistributable licenses.
because then they would be probably be installed with allowUnfree = false;
, which is not what users expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant adding an attribute redistributable = true
alongside unfree = false
; allowUnfree = false
will not install such packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine, sorry I misunderstood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, are we sure unfreeRedistributable
is working as intended? I've started digging in, and it looks like Hydra doesn't actually build any of these things. I spot-checked 5-10 packages and didn't see any of them on the hydra nixpkgs jobset. For example, consider the package aliza, which is nowhere to be found on Hydra despite having an unfreeRedistributable
license. Looking at the source code on hydra and the meta evaluator, it looks like there's no extra condition for free = false but redistributable.
There's another license, unfreeRedistributableFirmware
, that is being built and distributed -- but the reason for that is that it declares itself as free = true
.
At any rate, I think we can cleanup some of this logic and fix these issues by updating Hydra with an unfreePredicate filter that allows through redistributable packages. There's an initial WIP RFC here
I like the idea of adding a redistribute boolean attribute to licenses for Hydra. Where is that checked? In the meantime I submitted #47230, which I think is a no-op cleanup of the existing logic (at least as far as I'm reading it; please correct if mistaken). EDIT: I found it and will take a look at making the redistribute attribute for distribution: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/release.nix#L18-L19 |
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: mkl Partial log (click to expand)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: mkl Partial log (click to expand)
|
I opened a separate PR to start taking a look at |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: mkl Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: mkl Partial log (click to expand)
|
I suggest to set |
I don't know which is better, but there is a benefit of having it in the binary cache in saving user's disk space: if they build it themselves, they'll store both the source archives and the unpacked content. Cache efficiency can be improved by moving the extracted content into a fixed output derivation (e.g. by replacing |
Good idea! Couldn't we do that locally to avoid duplication in the local store without involving the binary cache? |
My point was that Hydra would cache the fixed-output derivation once per version (rather than once per stdenv/openmp rebuild), but yes, this will also be space-efficient with |
Aside from the benefit @orivej mentioned with the double-space use, there's a second benefit for this particular use case: Intel distributes the src package as a massive tar of all the architecture binaries, and we're filtering it to a subset of what we need -- so the final binary package is actually smaller than the starting "source" package (though still huge):
I'd prefer to omit |
I was able to build this expression on Darwin with the following changes:
Perhaps the package could be modified to support both Linux and Darwin? I'm not familiar enough with |
I tossed in Darwin support as well, using your commands. I can confirm this still works on Linux, but I don't have access to a Darwin machine to test; would you mind giving it a try to make sure I didn't miss something in the conditionals? I also swapped this to use Regarding |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: mkl Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: mkl Partial log (click to expand)
|
Done, it works fine on Darwin. Thanks! |
There is https://nixos.org/nix/manual/#fixed-output-drvs
Derivations that specify |
outputHashAlgo = "sha256"; | ||
outputHashMode = "recursive"; | ||
outputHash = if stdenvNoCC.isDarwin | ||
then "0000000000000000000000000000000000000000000000000000" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@smaret can you try building this again and let me know what the fixed-output hash is for Mac?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it is: "1224dln7n8px1rk8biiggf77wjhxh8mzw0hd8zlyjm8i6j8w7i12"
That was easy! Since the majority of [1] For example, see: https://github.com/oxfordcontrol/osqp/blob/master/docs/get_started/linear_system_solvers.rst#install-with-anaconda |
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: mkl Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: mkl Partial log (click to expand)
|
No attempt on aarch64-linux (full log) The following builds were skipped because they don't evaluate on aarch64-linux: mkl Partial log (click to expand)
|
No attempt on x86_64-linux (full log) The following builds were skipped because they don't evaluate on x86_64-linux: mkl Partial log (click to expand)
|
CC @xeji @orivej @matthewbauer anyone have any further review feedback? I think this is much polished from the initial cut and should be good to go now, but as always am interested if there are ways to improve it. |
Looks alright to me! |
This packags the Intel Math Kernel library on x86-64 platforms, which is a
dependency for many data science and machine learning packages.
Upstream, Intel provides proprietary binary RPMs with a permissive
redistribution license. These have been repackaged in both Debian and Anaconda,
so we are not the first distribution to redistribute.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)