Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Improve CCache handling #13456

Merged
merged 16 commits into from
Dec 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ python/.eggs
tests/Makefile
tests/mxnet_unit_tests

# generated wrappers for ccache
cc
cxx

# Code coverage related
.coverage
*.gcov
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ build/src/%.o: src/%.cc | mkldnn

build/src/%_gpu.o: src/%.cu | mkldnn
@mkdir -p $(@D)
$(NVCC) $(NVCCFLAGS) $(CUDA_ARCH) -Xcompiler "$(CFLAGS)" -M -MT build/src/$*_gpu.o $< >build/src/$*_gpu.d
$(NVCC) $(NVCCFLAGS) $(CUDA_ARCH) -Xcompiler "$(CFLAGS)" --generate-dependencies -MT build/src/$*_gpu.o $< >build/src/$*_gpu.d
$(NVCC) -c -o $@ $(NVCCFLAGS) $(CUDA_ARCH) -Xcompiler "$(CFLAGS)" $<

# A nvcc bug cause it to generate "generic/xxx.h" dependencies from torch headers.
Expand All @@ -479,7 +479,7 @@ build/plugin/%.o: plugin/%.cc

%_gpu.o: %.cu
@mkdir -p $(@D)
$(NVCC) $(NVCCFLAGS) $(CUDA_ARCH) -Xcompiler "$(CFLAGS) -Isrc/operator" -M -MT $*_gpu.o $< >$*_gpu.d
$(NVCC) $(NVCCFLAGS) $(CUDA_ARCH) -Xcompiler "$(CFLAGS) -Isrc/operator" --generate-dependencies -MT $*_gpu.o $< >$*_gpu.d
$(NVCC) -c -o $@ $(NVCCFLAGS) $(CUDA_ARCH) -Xcompiler "$(CFLAGS) -Isrc/operator" $<

%.o: %.cc $(CORE_INC)
Expand Down Expand Up @@ -664,7 +664,7 @@ rclean:

ifneq ($(EXTRA_OPERATORS),)
clean: rclean cyclean $(EXTRA_PACKAGES_CLEAN)
$(RM) -r build lib bin *~ */*~ */*/*~ */*/*/*~
$(RM) -r build lib bin deps *~ */*~ */*/*~ */*/*/*~
cd $(DMLC_CORE); $(MAKE) clean; cd -
cd $(PS_PATH); $(MAKE) clean; cd -
cd $(NNVM_PATH); $(MAKE) clean; cd -
Expand Down
5 changes: 5 additions & 0 deletions ci/docker/Dockerfile.build.android_armv7
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ ENV OpenBLAS_DIR=${CROSS_ROOT}

WORKDIR /work

ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
RUN /work/ubuntu_adduser.sh

COPY runtime_functions.sh /work/
WORKDIR /work/mxnet

8 changes: 7 additions & 1 deletion ci/docker/Dockerfile.build.android_armv8
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ ENV CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++
COPY install/android_arm64_openblas.sh /work/
RUN /work/android_arm64_openblas.sh
ENV CPLUS_INCLUDE_PATH /work/deps/OpenBLAS
WORKDIR /work/build

ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
RUN /work/ubuntu_adduser.sh

COPY runtime_functions.sh /work/

WORKDIR /work/build
5 changes: 5 additions & 0 deletions ci/docker/Dockerfile.build.armv6
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@ ENV OpenBLAS_DIR=${CROSS_ROOT}
COPY install/deb_ubuntu_ccache.sh /work/
RUN /work/deb_ubuntu_ccache.sh

ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
RUN /work/ubuntu_adduser.sh

COPY runtime_functions.sh /work/
WORKDIR /work/mxnet
5 changes: 5 additions & 0 deletions ci/docker/Dockerfile.build.armv7
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@ ENV OpenBLAS_DIR=${CROSS_ROOT}
COPY install/deb_ubuntu_ccache.sh /work/
RUN /work/deb_ubuntu_ccache.sh

ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
RUN /work/ubuntu_adduser.sh

COPY runtime_functions.sh /work/
WORKDIR /work/mxnet
5 changes: 5 additions & 0 deletions ci/docker/Dockerfile.build.armv8
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,10 @@ ENV OpenBLAS_DIR=${CROSS_ROOT}
COPY install/deb_ubuntu_ccache.sh /work/
RUN /work/deb_ubuntu_ccache.sh

ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
RUN /work/ubuntu_adduser.sh

COPY runtime_functions.sh /work/
WORKDIR /work/build
5 changes: 5 additions & 0 deletions ci/docker/Dockerfile.build.jetson
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,10 @@ ENV NVCCFLAGS "-m64"
ENV CUDA_ARCH "-gencode arch=compute_53,code=sm_53 -gencode arch=compute_62,code=sm_62"
ENV NVCC /usr/local/cuda/bin/nvcc

ARG USER_ID=0
ARG GROUP_ID=0
COPY install/ubuntu_adduser.sh /work/
RUN /work/ubuntu_adduser.sh

COPY runtime_functions.sh /work/
WORKDIR /work/mxnet
5 changes: 5 additions & 0 deletions ci/docker/install/centos7_adduser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ then
mkdir /work/mxnet
mkdir /work/build
chown -R jenkins_slave /work/

# Later on, we have to override the links because underlying build systems ignore our compiler settings. Thus,
# we have to give the process the proper permission to these files. This is hacky, but unfortunately
# there's no better way to do this without patching all our submodules.
chown -R jenkins_slave /usr/local/bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear, even with comment I don't understand why. Why can't we have some other folder added to the PATH?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do, that's why I created /tmp/ccache-redirects. The problem is that in some places (especially submodules), that paths have been hardcoded. That's why we have to do both :(

fi
5 changes: 5 additions & 0 deletions ci/docker/install/ubuntu_adduser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ then
mkdir /work/mxnet
mkdir /work/build
chown -R jenkins_slave /work/

# Later on, we have to override the links because underlying build systems ignore our compiler settings. Thus,
# we have to give the process the proper permission to these files. This is hacky, but unfortunately
# there's no better way to do this without patching all our submodules.
chown -R jenkins_slave /usr/local/bin
fi
Loading