This repository has been archived by the owner on Aug 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
71 changed files
with
7,945 additions
and
16,295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
CAFFE_ROOTDIR := $(shell pwd) | ||
DLCP_IDEEPDIR := $(CAFFE_ROOTDIR)/external/ideep | ||
DLCP_ROOTDIR := $(DLCP_IDEEPDIR)/ideep/dlcp | ||
DLCP_INCLDIR := $(DLCP_ROOTDIR)/include | ||
DLCP_LIBDIR := $(DLCP_ROOTDIR)/lib | ||
IDEEP_GITHUB := https://github.com/intel/ideep.git | ||
DLCP_CXX := $(CXX) | ||
|
||
ifeq ("$(wildcard $(DLCP_INCLDIR)/dl_compression.h)", "") | ||
dlcp_download: | ||
rm -rf $(DLCP_IDEEPDIR) | ||
git clone $(IDEEP_GITHUB) -b dlcp $(DLCP_IDEEPDIR) | ||
|
||
dlcp_build: dlcp_download | ||
make -C $(DLCP_ROOTDIR) -j$(shell cat /proc/cpuinfo |grep 'processor'|wc -l) | ||
else | ||
dlcp_download: | ||
dlcp_build: | ||
make -C $(DLCP_ROOTDIR) -j$(shell cat /proc/cpuinfo |grep 'processor'|wc -l) | ||
endif | ||
|
||
dlcp_clean: | ||
@rm -rf $(DLCP_IDEEPDIR) | ||
|
||
dlcproot_set: | ||
$(eval COMMON_FLAGS += -DENABLE_WEIGHT_GRAD_COMPRESSION) \ | ||
$(eval INCLUDE_DIRS += $(DLCP_INCLDIR)) \ | ||
$(eval DLCP_LDFLAGS += -ldlcomp -L$(DLCPROOT)/lib) \ | ||
$(eval DLCP_LDFLAGS += -Wl,-rpath,$(DLCPROOT)/lib) | ||
|
||
|
||
dlcproot_notset: dlcp_build | ||
$(eval COMMON_FLAGS += -DENABLE_WEIGHT_GRAD_COMPRESSION) \ | ||
$(eval INCLUDE_DIRS += $(DLCP_INCLDIR)) \ | ||
$(eval DLCP_LDFLAGS += -ldlcomp) \ | ||
$(eval DLCP_LDFLAGS += -L$(DLCP_LIBDIR) -Wl,-rpath,${DLCP_LIBDIR}) | ||
|
||
ifeq (,$(findstring icpc, $(DLCP_CXX))) | ||
ifneq (,$(findstring icpc,$(shell command -v icpc))) | ||
DLCP_CXX := icpc | ||
endif | ||
endif | ||
|
||
ifeq ($(USE_MLSL), 1) | ||
ifeq ($(origin DLCPROOT), environment) | ||
dlcp: dlcproot_set | ||
else | ||
ifneq (,$(findstring icpc,$(DLCP_CXX))) | ||
dlcp: dlcproot_notset | ||
else | ||
dlcp: | ||
@echo "weight grad compression disabled because intel compiler not found" | ||
endif | ||
endif | ||
else | ||
dlcp: | ||
@echo "disabling weight grad compression if USE_MLSL is not 1" | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function(Download_DLCP) | ||
find_program(HAS_ICPC NAMES icpc DOC "Intel Compiler") | ||
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") | ||
set(DLCP_CXX "${CMAKE_CXX_COMPILER}" PARENT_SCOPE) | ||
elseif(HAS_ICPC) | ||
set(DLCP_CXX "icpc" PARENT_SCOPE) | ||
else() | ||
message(WARNING "weight grad compression is disabled because intel compiler is not found") | ||
return() | ||
endif() | ||
|
||
set(EXTERNAL_DIR ${CMAKE_SOURCE_DIR}/external) | ||
set(DLCP_IDEEPDIR ${EXTERNAL_DIR}/ideep) | ||
set(DLCP_ROOTDIR ${DLCP_IDEEPDIR}/ideep/dlcp) | ||
set(DLCP_INCLDIR "${DLCP_ROOTDIR}/include" PARENT_SCOPE) | ||
set(DLCP_LIBDIR ${DLCP_ROOTDIR}/lib PARENT_SCOPE) | ||
|
||
# Download dl compression lib source code if it doesn't exist | ||
if (NOT EXISTS ${DLCP_INCLDIR}/dl_compression.h) | ||
execute_process(COMMAND rm -rf ${DLCP_IDEEPDIR}) | ||
execute_process(COMMAND git clone https://github.com/intel/ideep.git -b dlcp ${DLCP_IDEEPDIR}) | ||
endif() | ||
|
||
add_custom_target(DLCP_Build ALL | ||
COMMAND export DLCP_CXX=${DLCP_CXX} | ||
COMMAND make -j | ||
WORKING_DIRECTORY ${DLCP_ROOTDIR}) | ||
|
||
endfunction(Download_DLCP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.