Remove multiverso header file dependence in SGD.h

This commit is contained in:
feiga 2016-09-27 18:00:02 +09:00
Родитель 516682b936
Коммит 50827a564d
6 изменённых файлов: 30 добавлений и 25 удалений

Просмотреть файл

@ -426,11 +426,11 @@ CNTKLIBRARY_TESTS_OBJ := $(patsubst %.cu, $(OBJDIR)/%.o, $(patsubst %.cpp, $(OBJ
ALL+=$(CNTKLIBRARY_TESTS)
SRC+=$(CNTKLIBRARY_TESTS_SRC)
$(CNTKLIBRARY_TESTS): $(CNTKLIBRARY_TESTS_OBJ) | $(CNTKLIBRARY_LIB) $(MULTIVERSO_LIB)
$(CNTKLIBRARY_TESTS): $(CNTKLIBRARY_TESTS_OBJ) | $(CNTKLIBRARY_LIB)
@echo $(SEPARATOR)
@mkdir -p $(dir $@)
@echo building output for $(ARCH) with build type $(BUILDTYPE)
$(CXX) $(LDFLAGS) $(patsubst %,-L%, $(LIBDIR) $(LIBPATH) $(GDK_NVML_LIB_PATH)) $(patsubst %,$(RPATH)%, $(ORIGINLIBDIR) $(LIBPATH)) -o $@ $^ $(LIBS) -l$(CNTKLIBRARY) -l$(CNTKMATH) -l$(MULTIVERSO)
$(CXX) $(LDFLAGS) $(patsubst %,-L%, $(LIBDIR) $(LIBPATH) $(GDK_NVML_LIB_PATH)) $(patsubst %,$(RPATH)%, $(ORIGINLIBDIR) $(LIBPATH)) -o $@ $^ $(LIBS) -l$(CNTKLIBRARY) -l$(CNTKMATH)
@ -489,7 +489,7 @@ $(EVAL_SAMPLE_CLIENT): $(EVAL_SAMPLE_CLIENT_OBJ) | $(EVAL_LIB)
@echo $(SEPARATOR)
@mkdir -p $(dir $@)
@echo building $(EVAL_SAMPLE_CLIENT) for $(ARCH) with build type $(BUILDTYPE)
$(CXX) $(LDFLAGS) $(patsubst %,-L%, $(LIBDIR) $(LIBPATH) $(GDK_NVML_LIB_PATH)) $(patsubst %,$(RPATH)%, $(ORIGINLIBDIR) $(LIBPATH)) -o $@ $^ $(LIBS) -l$(EVAL) -l$(CNTKMATH) -l$(MULTIVERSO)
$(CXX) $(LDFLAGS) $(patsubst %,-L%, $(LIBDIR) $(LIBPATH) $(GDK_NVML_LIB_PATH)) $(patsubst %,$(RPATH)%, $(ORIGINLIBDIR) $(LIBPATH)) -o $@ $^ $(LIBS) -l$(EVAL) -l$(CNTKMATH)
########################################
# BinaryReader plugin
@ -787,7 +787,6 @@ endif
MULTIVERSO:=multiverso
INCLUDEPATH += $(SOURCEDIR)/Multiverso/include
LIBS += -lmultiverso
COMMON_FLAGS += -DMULTIVERSO_SUPPORT
MULTIVERSO_LIB:=$(LIBDIR)/libmultiverso.so
@ -838,7 +837,7 @@ CNTK:=$(BINDIR)/cntk
ALL+=$(CNTK)
SRC+=$(CNTK_SRC)
$(CNTK): $(CNTK_OBJ) | $(CNTKMATH_LIB)
$(CNTK): $(CNTK_OBJ) | $(CNTKMATH_LIB) $(MULTIVERSO_LIB)
@echo $(SEPARATOR)
@mkdir -p $(dir $@)
@echo building output for $(ARCH) with build type $(BUILDTYPE)
@ -933,7 +932,7 @@ UNITTEST_NETWORK := $(BINDIR)/networktests
ALL += $(UNITTEST_NETWORK)
SRC += $(UNITTEST_NETWORK_SRC)
$(UNITTEST_NETWORK): $(UNITTEST_NETWORK_OBJ) | $(CNTKMATH_LIB) $(CNTKTEXTFORMATREADER)
$(UNITTEST_NETWORK): $(UNITTEST_NETWORK_OBJ) | $(CNTKMATH_LIB) $(CNTKTEXTFORMATREADER) $(MULTIVERSO_LIB)
@echo $(SEPARATOR)
@mkdir -p $(dir $@)
@echo building $@ for $(ARCH) with build type $(BUILDTYPE)

Просмотреть файл

@ -0,0 +1,12 @@
#pragma once
namespace Microsoft { namespace MSR { namespace CNTK {
enum class AdjustLearningRateatBeginning : int
{
None = 0,
Linearly = 1,
Staircase = (1 << 1),
};
}}}

Просмотреть файл

@ -19,6 +19,7 @@
#include "MPIWrapper.h"
#include "ComputationNetwork.h"
#include "TimerUtility.h"
#include "ASGDCommon.h"
#include <functional>
#include <thread>
@ -41,13 +42,6 @@ inline void gpuAssert(cudaError_t code, const char *file, int line, bool abort =
}
#endif
enum class AdjustLearningRateatBeginning : int
{
None = 0,
Linearly = 1,
Staircase = (1 << 1),
};
template<class ElemType = float>
class MultiversoHelper
{

Просмотреть файл

@ -1,16 +1,11 @@
#pragma once
#include "ASGDCommon.h"
namespace Microsoft {
namespace MSR {
namespace CNTK {
enum class AdjustLearningRateatBeginning : int
{
None = 0,
Linearly = 1,
Staircase = (1 << 1),
};
template<class ElemType = float>
class MultiversoHelper
{

Просмотреть файл

@ -16,6 +16,12 @@
#include "BlockMomentumSGD.h"
#endif
#ifdef MULTIVERSO_SUPPORT
#include "MultiversoWrapper.h"
#else
#include "NoMultiversoWrapper.h"
#endif
#include "SimpleDistGradAggregator.h"
#include "ProgressTracing.h"

Просмотреть файл

@ -5,6 +5,7 @@
#pragma once
#include "Basics.h"
#include "ASGDCommon.h"
#include "ComputationNetwork.h"
#include "SimpleEvaluator.h"
#include "DataReader.h"
@ -18,11 +19,6 @@
#include <chrono>
#include <random>
#include "Profiler.h"
#ifdef MULTIVERSO_SUPPORT
#include "MultiversoWrapper.h"
#else
#include "NoMultiversoWrapper.h"
#endif
#include "MASGD.h"
using namespace std; // ugh! TODO: get rid of this from .h files!!!
@ -310,6 +306,9 @@ protected:
template <class ElemType>
class IDistGradAggregator;
template <class ElemType>
class MultiversoHelper;
// -----------------------------------------------------------------------
// class SGD
// -----------------------------------------------------------------------