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
dnnl: init at 1.1.2 #74893
dnnl: init at 1.1.2 #74893
Conversation
The |
|
||
self: super: { | ||
mklSupport = true; | ||
} |
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 have tested that:
- By default, it builds without MKL, and works even if you have disallowed all unfree packages
- This overlay enables MKL, which fails up-front if unfree packages are disabled (as expected)
- With this overlay and unfree packages enabled, everything works with MKL as expected:
λ brh nixpkgs → nix-build -A dnnl
...
-- Intel(R) MKL: include /nix/store/km760fljn77c4d8wkdxchf3j21zgdlmw-mkl-2019.5.281/include
-- Intel(R) MKL: lib /nix/store/km760fljn77c4d8wkdxchf3j21zgdlmw-mkl-2019.5.281/lib/libmkl_rt.so
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- Configuring done
...
@FRidh what about a different package set where mkl is enabled? kinda like something like:
|
variable in an overlay: | ||
|
||
self: super: { | ||
mklSupport = true; |
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 don't think we should encourage setting non-derivation top-level attributes. It is convenient though because callPackage
picks it up. Not sure what would be better but would achieve the same.
A top-level |
That's fair, it will be awkward if we had something like:
then again, this would be opposed to:
|
If you could give a hint about how this would be implemented, I'd be happy to give it a shot in #74894, then update this PR accordingly. I see that the top of One consideration though is that compute-optimized libraries are wider than just the python package set. This |
the overrides attr is to allow for people to create a new python package set when wrapping an application like with azure-cli If this did happen, then it would probably involve merging #67422 and using the overrideScope to create new package sets were
the overrideScope is also nice, because the overlay construct allows for composition
and, we would get a tensoflow-gpu package from it Edit: cc @infinisil thoughts? |
description = "Deep Neural Network Library (DNNL)"; | ||
homepage = "https://intel.github.io/mkl-dnn/dev_guide_transition_to_dnnl.html"; | ||
license = licenses.asl20; | ||
platforms = platforms.all; |
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.
platforms = platforms.all; | |
platforms = platforms.x86_64; |
adds x86 specific extensions to compiler:
g++: error: unrecognized command line option '-msse4.1'
g++: error: unrecognized command line option '-msse4.1'
g++: error: unrecognized command line option '-msse4.1'
also:
DNNL supports 64 bit platforms only
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.
Updated accordingly
@GrahamcOfBorg build pkgsi686Linux.dnnl |
@GrahamcOfBorg build dnnl |
I've removed the optional dependency on the proprietary I've also bumped it to the latest release and restricted it to 64-bit, per above suggestion. |
@GrahamcOfBorg build dnnl |
@GrahamcOfBorg build dnnl It appears there's a failure in a test suite on Darwin, so I've upgraded to just Linux x86_64-linux for now, as I don't have a Darwin machine to debug. |
@GrahamcOfBorg build dnnl |
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.
otherwise LGTM
addAutoPatchelfSearchPath $PWD/src | ||
autoPatchelf tests examples |
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 think something like:
export LD_LIBRARY_PATH=$PWD/src/build
would be more appropriate and drop the autopatchelf
generally autopatchelf is to help with precompilied binaries, not test binaries
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 started digging into it, but I wasn't able to get this to work with LD_LIBRARY_PATH
. It looks like the test driver re-launches with a subprocess or something that cleans out the var (???) and it doesn't get caught, hence the original comment by @alexarice about the LD_LIBRARY_PATH
env var not working.
I did upstream the patch on the shell to Intel, who says they'll release it in 1.2.0, so at least we can clean that part of the packaging up eventually.
@GrahamcOfBorg build dnnl
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, I'm a liar: the tests do build, run, and pass just fine without the autopatchelf hook and just
preCheck = ''
export LD_LIBRARY_PATH=$PWD/src
'';
but we then later run into issues at installation and dependency resolution time . . .
checking for references to /build/ in /nix/store/3g8jhc6iwipb22a03grlif5y6bddb09j-dnnl-1.1.2-doc...
automatically fixing dependencies for ELF files
searching for dependencies of /nix/store/yixg9d3dfryiypffdn90zl30z6kk0yz7-dnnl-1.1.2/lib/libdnnl.so.1.1
libstdc++.so.6 -> not found!
libgomp.so.1 -> not found!
builder for '/nix/store/11bqvbfw2a3sxjpyfg3fycva2mxm408i-dnnl-1.1.2.drv' failed with exit code 1
error: build of '/nix/store/11bqvbfw2a3sxjpyfg3fycva2mxm408i-dnnl-1.1.2.drv' failed
Since we actually depend on the patchelf hook for mutating the installed binaries themselves, I will update the comment to accurately describe the state of the world!
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.
if that's the cause, then do the autoPatchelfHook, but let it do it's thing during the fixup phase instead of the installCheck
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.
The claim of being a lie was itself a lie, due to an unrelated issue. This takes a while to rebuild and re-run the tests on my laptop, so by the time it finished with a failure I had forgotten what I was attempting :)
The tests actually pass just fine with a simple LD_LIBRARY_PATH
env var set, and the installed artifacts look good, so I think what we've got right now in the PR is the optimal fix in terms of both simplicity for test running, clarity of maintenance, and avoiding pollution of the installed artifacts for fixing test issues.
This commit continues the work proposed in NixOS#68014, and provides an entirely FOSS variant of the `dnnl` package. Updates to add an `mkl` flavor will be added later, pending discussion about the cleanest way to overlay this consistently. Fixes NixOS#67982, closes NixOS#68014 Co-authored-by: Alex Rice <alexrice999@hotmail.co.uk>
A quick scan of the libs reveals no broken RPaths, so we weren't relying on the patchelf helper for anything here:
I believe this should be good to go now . . . LMK @jonringer and thanks for all the help so far! |
@jonringer I'd like to tentatively claim that all code review comments have been addressed. When you get a chance would you mind taking a look? |
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.
diff LGTM
commit LGTM
outputs LGTM
has tests 👍
[4 built, 0.0 MiB DL]
https://github.com/NixOS/nixpkgs/pull/74893
1 package built:
dnnl
This commit continues the work proposed in #68014, and provides an entirely FOSS
variant of the
dnnl
package. Updates to add anmkl
flavor will be addedlater, pending discussion about the cleanest way to overlay this consistently.
Fixes #67982, closes #68014
Co-authored-by: Alex Rice alexrice999@hotmail.co.uk
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @alexarice @jonringer @stites @Ericson2314