-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Conversation
LGTM |
ci/docker/runtime_functions.sh
Outdated
@@ -31,31 +31,50 @@ clean_repo() { | |||
git submodule update --init --recursive | |||
} | |||
|
|||
build_wheel() { |
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.
Great idea to have it centralized!
ci/docker/runtime_functions.sh
Outdated
-DCMAKE_BUILD_TYPE=RelWithDebInfo\ | ||
-DUSE_MKL_IF_AVAILABLE=OFF\ | ||
|
||
# Lapack functionality will be included and statically linked to openblas. |
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.
This sounds a bit like a hack to me. Could we have proper handling for that? Otherwise, there might be other things that depend on the USE_LAPACK flag that are not getting triggered because it's expected to be absent while it's actually there.
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.
Sure, I already tried that and this will not be easy. I suggest this will be part of a separate PR.
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'd prefer to have this within this PR as otherwise would leave the two branches in a semi-consistent state in terms of the USE_LAPACK flag until you follow up with the second PR.
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.
As I've said already, it is not a trivial task and can take up significant time and effort with functionality change impacting multiple builds. This PR is about fixing the ARMv7 build, for now without improvements. It is a big comment and only a few lines to keep in sync, so that it can be considered as tolerated evil. There is already a ticket to track the work on the problem: MXNET-115
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.
Alright. Since I'm not very familiar with the impact of the LAPACK-Flag (or it being absent), maybe @szha @eric-haibin-lin @piiswrong could help out here?
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.
Static linking goes with openblas, but fortran needs to be linked dynamically. Comment about -static-libgfortran
not working properly
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.
Anyway we will look into the mentioned issue above, no doubt. Do you guys see it as possible to introduce the improvement in a follow up PR?
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.
@larroy I was talking about this code: https://github.com/apache/incubator-mxnet/blob/c4a76da62fbc5e3e7272fd89294fba6b22868bba/src/operator/c_lapack_api.h#L218
It seems like @lebeg and @larroy are both working on the USE_LAPACK flag. While this PR assumes the "wrong" behaviour of our build system to basically ignore the flag and set it to true(as described in the ticket), #11094 attempts to correct this. I think we should first get #11094 merged properly. After that, we actually have a USE_LAPACK behaviour that behaves like expected. This would allows us to remove the hacks we have in this PR (USE_LAPACK=0) and thus reach a clean state.
If we merge this PR first and #11094 gets merged afterwards, the LAPACK build is broken again. I'd prefer a clean solution over multiple PRs about the same issue.
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.
As discussed, I'm working on a fix that will be introduced as a separate PR
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.
Ok
ci/docker/Dockerfile.build.arm64
Outdated
@@ -27,6 +27,10 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran | |||
ENV HOSTCC gcc | |||
ENV TARGET ARMV8 | |||
|
|||
RUN apt-get update && \ | |||
apt-get install -y unzip && \ | |||
rm -rf /var/lib/apt/lists/* |
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.
rm -rf for apt lists is deprecated
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.
Thanks, fixed
ci/docker/Dockerfile.build.armv6
Outdated
@@ -25,6 +25,10 @@ ENV FC=/usr/bin/${CROSS_TRIPLE}-gfortran | |||
ENV HOSTCC gcc | |||
ENV TARGET ARMV6 | |||
|
|||
RUN apt-get update && \ | |||
apt-get install -y unzip && \ | |||
rm -rf /var/lib/apt/lists/* |
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.
rm -rf for apt lists is deprecated
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.
Fixed
ci/docker/Dockerfile.build.jetson
Outdated
@@ -31,6 +31,10 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran | |||
ENV HOSTCC gcc | |||
ENV TARGET ARMV8 | |||
|
|||
RUN apt-get update && \ | |||
apt-get install -y unzip && \ | |||
rm -rf /var/lib/apt/lists/* |
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.
rm -rf for apt lists is deprecated
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.
Fixed
@szha @marcoabreu can you have another look? |
ci/docker/Dockerfile.build.arm64
Outdated
@@ -27,6 +27,8 @@ ENV FC /usr/bin/${CROSS_TRIPLE}-gfortran | |||
ENV HOSTCC gcc | |||
ENV TARGET ARMV8 | |||
|
|||
RUN apt update && apt install -y unzip |
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.
Could we move this part (as well as the OpenBLAS compilation) for all ARM related Dockerfiles into separate scripts so that they are centralized in the install folder? As far as I can tell, they are all the same for the dependency installation (only unzip in this case) as well as for the OpenBLAS compilation.
@@ -0,0 +1,30 @@ | |||
#!/usr/bin/env bash |
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.
Please rename file to match the style of our filenames. "install_platform_action"
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.
Platform is universal, and none of the file names have a install prefix. That gives "action" as the only needed suffix. What exactly the name you are suggesting in this case?
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.
Sorry, it was supposed to be "install/platform_action".
I'd propose arm_openblas.sh
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.
It does not contain anything related to arm, even if we use it only for such cases.
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.
Well I would have proposed something related to cross-compilation, but that might be confusing. You're right that it's not arm specific, but neither is it general :/
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 would prefer to keep it that way, would that be alright?
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 would prefer a rename since this script is not general purpose. It's only applicable for crosscompilation. Your proposed naming would indicate that it's usable for everything.
Additionally, we only use it for crosscompilation on ARM as of now, so we should mark it accordingly. If we expand the scope later on, we're free to rename it again. For now, it's limited to the crosscompilation scope of ARM and should thus be properly named.
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.
What do you see in this script as not general purpose?
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.
PREFIX=${CROSS_ROOT} make install
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.
Ok, I see thanks
@@ -0,0 +1,24 @@ | |||
#!/usr/bin/env bash |
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.
Please rename file to match our filenaming style.
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.
What exactly the name you are suggesting in this case?
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.
Nevermind, this is fine :)
ci/docker/runtime_functions.sh
Outdated
-DCMAKE_BUILD_TYPE=RelWithDebInfo\ | ||
-DUSE_MKL_IF_AVAILABLE=OFF\ | ||
|
||
# Lapack functionality will be included and statically linked to openblas. |
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.
Ok
LGTM. CI is failing though. I retriggered it. |
Please rename the install-openblas-file, then we're good to go |
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/openmp/CMakeLists.txt | ||
AND SYSTEM_ARCHITECTURE STREQUAL "x86_64" | ||
AND NOT MSVC | ||
AND NOT CMAKE_CROSSCOMPILING) |
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.
How is CMAKE_CROSSCOMPILING enabled/governed? For android I noticed we are not in "cross compiling" mode or whatever that is supposed to be in cmake.
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.
Ah, saw it below.
cd OpenBLAS && \ | ||
make -j$(nproc) && \ | ||
PREFIX=${CROSS_ROOT} make install | ||
COPY install/ubuntu_arm.sh /work/ |
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.
do we need to copy the scripts vs running them directly from the mount volume?
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.
Yes we have to copy them because the volumes are not mounted during build time of the container
ci/docker/runtime_functions.sh
Outdated
|
||
cmake \ | ||
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} \ | ||
-DCMAKE_CROSSCOMPILING=ON \ |
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 see :-)
I would like to see this merged. What else is missing? |
"Please rename the install-openblas-file, then we're good to go" |
I'd prefer to keep it that way, would that be alright? |
Huh, how come we're adding Makefile configuration as well now? I think one buildsystem is enough, right? Also, it's not tested so I'd prefer if you remove it again |
I have tested it to try the failure on the device. I confirm that the build works with make and cmake. |
I think we should stick to one. So either remove cmake or make. The other one will be untested otherwise |
It is there because we needed to build with make instead of cmake to be sure that the problems we have are not related to the build system. I suggest to remove the added file along with the others when the build will be ported to cmake completely. At the moment we have 2 working solutions for 2 of our working build systems. |
Sorry I might be missing something, but where exactly are we using that new make-config? For ARMv7, I can only see cmake being used. |
See here |
Yeah, but it's commented. Thus, it's not tested and it should be removed. Please elaborate in which case we need two different ways to achieve the same thing. |
I have removed the file |
Let's merge later from dev-arm. It includes your changes. Shall we close this PR? |
Description
Fixes a path issue in the created by cross compilation python wheel for armv7 (RPi).
Checklist
Essentials
Changes