Skip to content
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

distributed server #41

Open
wants to merge 88 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f0ff5ab
add: server, FTRL Handler
xswang Dec 11, 2017
968f426
add: server, adagrad handler
xswang Dec 11, 2017
860bf12
add: slect algo
xswang Dec 11, 2017
263d5e7
update: server, SGDEntry and SGD Handler
xswang Dec 12, 2017
1d0ad1e
update: server.h
xswang Dec 12, 2017
9cb478b
add: R package
xswang Dec 12, 2017
3d87981
update
xswang Dec 12, 2017
28df991
fix: SGD Handler
xswang Dec 12, 2017
6194721
update: AdaGrad Handler
xswang Dec 12, 2017
a1b26dc
update: SGD handler
xswang Dec 13, 2017
8a8d931
update
xswang Dec 13, 2017
389f861
update
xswang Dec 13, 2017
aa40ffc
update: server.h
xswang Dec 13, 2017
dcf570e
update
xswang Dec 13, 2017
055778e
add: dist loss, dist score
xswang Dec 13, 2017
41c036a
add: worker.h
xswang Dec 13, 2017
5f3f0c9
update: cross_entropy_loss
xswang Dec 15, 2017
ccd563a
update: CMakeLists.txt
xswang Dec 15, 2017
cba673f
add: src/distributed/CMakeLists.txt
xswang Dec 15, 2017
a94cbc9
update: CMakeLists.txt
xswang Dec 15, 2017
2048453
rm: dist_score_function.*
xswang Dec 16, 2017
10afe25
update: CMakeLists.txt
xswang Dec 16, 2017
71380f6
add: dist_cross_entropy_loss.cc
xswang Dec 16, 2017
34f15c7
rm: dist_squared_loss.*
xswang Dec 16, 2017
7d06b2b
update: distributed/CMakeLists.txt
xswang Dec 16, 2017
67d6e27
update: score
xswang Dec 16, 2017
2ec801b
update: loss
xswang Dec 16, 2017
7d1ceb0
add: ps-lite
xswang Dec 16, 2017
e849f96
update: CMakeLists.txt
xswang Dec 16, 2017
4638646
update: /src/c_api/CMakeLists.txt
xswang Dec 16, 2017
6acfc49
update: src/distributed/CMakeLists.txt
xswang Dec 16, 2017
b9a3d3e
update: /src/distributed/dist_cross_entropy_loss.h
xswang Dec 16, 2017
ba0934b
update: src/distributed/dist_score_function.h
xswang Dec 16, 2017
abc1acf
update: src/distributed/dist_linear_score.h
xswang Dec 16, 2017
42bfca0
add: DistScore Register
xswang Dec 16, 2017
25ecec2
update: loss.h
xswang Dec 16, 2017
b6d67ce
add: xlearn_shared deps
xswang Dec 16, 2017
0e44248
fix: bug for reference map in multithread
xswang Dec 16, 2017
4162c41
update: src/loss/CMakeLists.txt
xswang Dec 16, 2017
d11c06e
rm: ps-lite
xswang Dec 16, 2017
7703c0f
add: makelist
xswang Dec 16, 2017
f7937bb
add: cmake/ps-lite.cmake
xswang Dec 16, 2017
c8ccc33
add: zmq.cmake
xswang Dec 16, 2017
7edcde1
add: CMakeLists.txt
xswang Dec 17, 2017
44e3bab
update: src/c_api/CMakeLists.txt
xswang Dec 17, 2017
8197863
update: src/loss/CMakeLists.txt
xswang Dec 17, 2017
6704c69
add: summodule
xswang Dec 17, 2017
6480821
rm: include
xswang Dec 18, 2017
f665b22
update: upstream
xswang Dec 18, 2017
4bfbed8
update: CMakeLists.txt
xswang Dec 18, 2017
5ad5644
update: server.h
xswang Dec 18, 2017
a3a94a5
update: worker.h
xswang Dec 18, 2017
7eb5b6e
update: metric
xswang Dec 18, 2017
d4bbe81
add: start worker and server
xswang Dec 18, 2017
42d513a
fix: auc
xswang Dec 19, 2017
c55001a
update
xswang Dec 19, 2017
5d2e4b2
update: to dist score
xswang Dec 20, 2017
e20e4bf
update: loss
xswang Dec 20, 2017
dc208e2
update and fix: distributed
xswang Dec 20, 2017
3c28a91
update: dist
xswang Dec 21, 2017
f581ef4
fix: bug for push and pull
xswang Dec 23, 2017
571cc0d
update: upstream
xswang Dec 23, 2017
322e316
update: loss/metric.h
xswang Dec 23, 2017
7efce6f
update: xlearn/CMakeLists.txt
xswang Dec 23, 2017
0fa057e
update: make local_run clean
xswang Dec 23, 2017
e8f9acc
update: src/distributed/CMakeLists.txt
xswang Dec 23, 2017
5546e9e
add: local run script and dist run script
xswang Dec 23, 2017
ffdb6ae
add: for dist version
xswang Dec 23, 2017
2ae02e4
update: server, init hyparamter
xswang Dec 24, 2017
0227ac2
update: set v_dim by score_function
xswang Dec 24, 2017
24f8631
update: run_xlearn_dist_train.sh
xswang Dec 24, 2017
16dd023
update: server.h
xswang Dec 24, 2017
aab2a88
add: gitignore
xswang Dec 24, 2017
cc6e252
add: python package
xswang Dec 24, 2017
02c3da3
update: gitignore
xswang Dec 24, 2017
7d79cf1
merge: upstream
xswang Dec 25, 2017
626d478
rm: shared lib in distributed
xswang Dec 25, 2017
484c8bf
update: distributed/CMakeLists.txt
xswang Dec 26, 2017
ab8c101
add: dist_ffm header files
xswang Dec 26, 2017
328d220
add: dist_fm_score
xswang Dec 26, 2017
d21ce60
add: dist_ffm
xswang Dec 26, 2017
6f44cc0
update: dist_ffm_score.cc
xswang Dec 27, 2017
f19fdcd
update: dist fm and ffm
xswang Dec 29, 2017
4a232fe
update: upstream/master
xswang Dec 29, 2017
0d6e9eb
update: distributed/CMakeLists.txt
xswang Dec 31, 2017
b271024
update: score
xswang Dec 31, 2017
f33b617
update: dist_ffm_score.h
xswang Dec 31, 2017
e6ea10d
update: dist_cross_entropy_loss.cc
xswang Dec 31, 2017
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ build/*
.Rhistory
*.tar.gz
xlearn/*

# Python-package
*.pyc
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ps-lite"]
path = ps-lite
url = https://github.com/dmlc/ps-lite
13 changes: 9 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ cmake_minimum_required(VERSION 2.8)
# Using c++11;
# Optimization on architecture
#-------------------------------------------------------------------------------
add_definitions("-Wall -Wno-sign-compare -O3 -std=c++11
-march=native -Wno-strict-aliasing -Wno-comment")
#add_definitions("-Wall -Wno-sign-compare -O3 -std=c++11 -march=native
add_definitions("-Wall -Wno-sign-compare -std=c++11 -march=native
-Wno-strict-aliasing -Wno-comment")

#-------------------------------------------------------------------------------
# Declare where our project will be installed.
Expand All @@ -50,6 +51,7 @@ include_directories(
"${PROJECT_SOURCE_DIR}"
"${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/gtest/include"
"${PROJECT_SOURCE_DIR}/ps-lite/include"
)

link_directories(
Expand All @@ -59,21 +61,24 @@ link_directories(
"${PROJECT_BINARY_DIR}/src/score"
"${PROJECT_BINARY_DIR}/src/loss"
"${PROJECT_BINARY_DIR}/src/solver"
"${PROJECT_BINARY_DIR}/src/distributed"
"${PROJECT_BINARY_DIR}/src/c_api"
"${PROJECT_BINARY_DIR}/ps-lite"
)

#-------------------------------------------------------------------------------
# Declare packages in xLearn project.
#-------------------------------------------------------------------------------
add_subdirectory(ps-lite)
add_subdirectory(gtest)
add_subdirectory(demo)
add_subdirectory(scripts)
add_subdirectory(src/base)
add_subdirectory(src/data)
add_subdirectory(src/reader)
add_subdirectory(src/score)
add_subdirectory(src/loss)
add_subdirectory(src/solver)
add_subdirectory(src/distributed)
add_subdirectory(src/c_api)
add_subdirectory(python-package)
#add_subdirectory(R-package)
add_subdirectory(scripts)
17 changes: 17 additions & 0 deletions cmake/FindZMQ.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# - Try to find ZMQ
# Once done this will define
# ZMQ_FOUND - System has ZMQ
# ZMQ_INCLUDE_DIRS - The ZMQ include directories
# ZMQ_LIBRARIES - The libraries needed to use ZMQ
# ZMQ_DEFINITIONS - Compiler switches required for using ZMQ

find_path ( ZMQ_INCLUDE_DIR zmq.h )
find_library ( ZMQ_LIBRARY NAMES zmq )

set ( ZMQ_LIBRARIES ${ZMQ_LIBRARY} )
set ( ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR} )

include ( FindPackageHandleStandardArgs )
# handle the QUIETLY and REQUIRED arguments and set ZMQ_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args ( ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR )
13 changes: 13 additions & 0 deletions cmake/ps-lite.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
include(ExternalProject)

set(pslite_URL https://github.com/dmlc/ps-lite.git)
set(pslite_TAG 2ce8b9a256207947acfa2cb9b09ab74b8de74547)

ExternalProject_Add(ps-lite
PREFIX ps-lite
GIT_REPOSITORY ${pslite_URL}
GIT_TAG ${pslite_TAG}
UPDATE_COMMAND ""
BUILD_COMMAND make
)

63 changes: 63 additions & 0 deletions cmake/zmq.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
if (NOT __ZMQ_INCLUDED) # guard against multiple includes
set(__ZMQ_INCLUDED TRUE)
include(ExternalProject)

# use the system-wide ZMQ if present
find_package(ZMQ)
if (ZMQ_FOUND)
set(ZMQ_EXTERNAL FALSE)
else()
# ZMQ will use pthreads if it's available in the system, so we must link with it
find_package(Threads)

# build directory
set(ZMQ_PREFIX ${CMAKE_BINARY_DIR}/external/ZMQ-prefix)
# install directory
set(ZMQ_INSTALL ${CMAKE_BINARY_DIR}/external/ZMQ-install)

# we build ZMQ statically, but want to link it into the caffe shared library
# this requires position-independent code
if (UNIX)
set(ZMQ_EXTRA_COMPILER_FLAGS "-fPIC")
endif()

set(ZMQ_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${ZMQ_EXTRA_COMPILER_FLAGS})
set(ZMQ_C_FLAGS ${CMAKE_C_FLAGS} ${ZMQ_EXTRA_COMPILER_FLAGS})

ExternalProject_Add(ZMQ
PREFIX ${ZMQ_PREFIX}
GIT_REPOSITORY "https://github.com/zeromq/libZMQ.git"
UPDATE_COMMAND ""
INSTALL_DIR ${ZMQ_INSTALL}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${ZMQ_INSTALL}
-DBUILD_SHARED_LIBS=OFF
-DBUILD_STATIC_LIBS=ON
-DBUILD_PACKAGING=OFF
-DBUILD_TESTING=OFF
-DBUILD_NC_TESTS=OFF
-BUILD_CONFIG_TESTS=OFF
-DINSTALL_HEADERS=ON
-DCMAKE_C_FLAGS=${ZMQ_C_FLAGS}
-DCMAKE_CXX_FLAGS=${ZMQ_CXX_FLAGS}
LOG_DOWNLOAD 1
LOG_INSTALL 1
)

set(ZMQ_FOUND TRUE)
set(ZMQ_INCLUDE_DIRS ${ZMQ_INSTALL}/include)

if(MSVC)
FILE(GLOB_RECURSE ZMQ_LIBRARIES "${ZMQ_INSTALL}/lib/libzmq-${CMAKE_VS_PLATFORM_TOOLSET}*.lib")
#set(ZMQ_LIBRARIES ${ZMQ_INSTALL}/lib/ZMQ.lib ${CMAKE_THREAD_LIBS_INIT})
else()
FILE(GLOB_RECURSE ZMQ_LIBRARIES "${ZMQ_INSTALL}/lib/libzmq-*.a")
#set(ZMQ_LIBRARIES ${ZMQ_INSTALL}/lib/libZMQ.a ${CMAKE_THREAD_LIBS_INIT})
endif()
set(ZMQ_LIBRARY_DIRS ${ZMQ_INSTALL}/lib)
set(ZMQ_EXTERNAL TRUE)

list(APPEND external_project_dependencies ZMQ)
endif()

endif()
1 change: 1 addition & 0 deletions ps-lite
Submodule ps-lite added at 2ce8b9
115 changes: 92 additions & 23 deletions python-package/setup.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,100 @@
# coding: utf-8
"""Setup xlearn package."""
from __future__ import absolute_import
import sys

import os
from setuptools import setup, find_packages
import subprocess
import shutil
import sys

from setuptools import find_packages
from setuptools import setup
from setuptools.command.install import install
from setuptools.command.sdist import sdist

sys.path.insert(0, '.')

CURRENT_DIR = os.path.dirname(__file__)

libpath_py = os.path.join(CURRENT_DIR, 'xlearn/libpath.py')
libpath = {'__file__': libpath_py}
exec(compile(open(libpath_py, "rb").read(), libpath_py, 'exec'), libpath, libpath)

LIB_PATH = [os.path.relpath(libfile, CURRENT_DIR) for libfile in libpath['find_lib_path']()]
print("Install libxlearn_api from: %s" % LIB_PATH)

setup(name='xlearn',
version=open(os.path.join(CURRENT_DIR, 'xlearn/VERSION')).read().strip(),
description="xLearn Python Package",
maintainer='Chao Ma',
maintainer_email='[email protected]',
zip_safe=False,
packages=find_packages(),
# this will use MANIFEST.in during install where we specify additional files,
# this is the golden line
include_package_data=True,
data_files=[('xlearn', LIB_PATH)],
license='Apache-2.0',
classifiers=['License :: OSI Approved :: Apache Software License'],
url='https://github.com/aksnzhy/xlearn')
def silent_call(cmd, raise_error=False, error_msg=''):
try:
with open(os.devnull, 'w') as shut_up:
subprocess.check_output(cmd, stderr=shut_up)
return 0
except Exception:
if raise_error:
raise Exception(error_msg);
return 1

def copy_files():
if os.path.isdir('compile'):
shutil.rmtree('compile')
src_list = ['demo', 'gtest', 'scripts', 'src']
for src in src_list:
dst = 'compile/{}'.format(src)
if os.path.isdir(dst):
shutil.rmtree(dst)
shutil.copytree('../{}'.format(src), dst)
shutil.copy('../CMakeLists.txt', 'compile')
# create empty python-package for cmake
os.makedirs('compile/python-package')
open('compile/python-package/CMakeLists.txt', 'w')

def compile_cpp():
build_path = os.path.join(CURRENT_DIR, 'build_cpp')
if os.path.isdir(build_path):
shutil.rmtree(build_path)
os.makedirs(build_path)
old_working_dir = os.getcwd()
os.chdir(build_path)
src_path = '../compile'
cmake_cmd = ['cmake', src_path]
if not os.path.isdir(src_path):
print('current path: {}'.format(os.getcwd()))
raise Exception('{} not exists'.format(src_path))
if os.name == "nt":
# Windows
print('Windows users please use github installation.')
else:
# Linux, Darwin (OS X), etc.
silent_call(cmake_cmd, raise_error=True, error_msg='Please install CMake first')
silent_call(["make", "-j4"], raise_error=True,
error_msg='An error has occurred while building xlearn library file')
suffix_list = ['dylib', 'so']
for suffix in suffix_list:
if os.path.isfile('lib/libxlearn_api.{}'.format(suffix)):
shutil.copy('lib/libxlearn_api.{}'.format(suffix), '../xlearn/')

os.chdir(old_working_dir)

class CustomInstall(install):

def run(self):
compile_cpp();
install.run(self)

class CustomSdist(sdist):

def run(self):
copy_files()
sdist.run(self)

if __name__ == "__main__":
setup(name='xlearn',
version="0.20.a1",
description="xLearn Python Package",
maintainer='Chao Ma',
maintainer_email='[email protected]',
zip_safe=False,
cmdclass={
'install': CustomInstall,
'sdist': CustomSdist,
},
packages=find_packages(),
# this will use MANIFEST.in during install where we specify additional files,
# this is the golden line
include_package_data=True,
# move data to MANIFEST.in
license='Apache-2.0',
classifiers=['License :: OSI Approved :: Apache Software License'],
url='https://github.com/aksnzhy/xlearn')
37 changes: 37 additions & 0 deletions scripts/local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# set -x
if [ $# -lt 3 ]; then
echo "usage: $0 num_servers num_workers bin [args..]"
exit -1;
fi

export DMLC_NUM_SERVER=$1
shift
export DMLC_NUM_WORKER=$1
shift
bin=$1
shift
arg="$@"

# start the scheduler
export DMLC_PS_ROOT_URI='127.0.0.1'
export DMLC_PS_ROOT_PORT=8000
export DMLC_ROLE='scheduler'
${bin} ${arg} &


# start servers
export DMLC_ROLE='server'
for ((i=0; i<${DMLC_NUM_SERVER}; ++i)); do
export HEAPPROFILE=./S${i}
${bin} ${arg} &
done

# start workers
export DMLC_ROLE='worker'
for ((i=0; i<${DMLC_NUM_WORKER}; ++i)); do
export HEAPPROFILE=./W${i}
${bin} ${arg} &
done

wait
10 changes: 10 additions & 0 deletions scripts/run_xlearn_dist_train.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/sh

echo "=====================================BigDataLR================================="
sh local.sh 1 3 /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/test/distributed/dist_xlearn_train ~/documents/data/libffm_toy/criteo.tr.r100.gbdt0.ffm -v ~/documents/data/libffm_toy/criteo.va.r100.gbdt0.ffm -s 0 -x auc --dis-es -p sgd -alpha 5e-2 -beta 1.0 -lambda_1 5e-5 -lambda_2 15.0 --no-norm
#sh local.sh 1 3 /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/test/distributed/dist_xlearn_train ~/documents/data/libffm_toy/criteo.tr.r100.gbdt0.ffm -v ~/documents/data/libffm_toy/criteo.va.r100.gbdt0.ffm -s 0 -x auc --dis-es -p adagrad -alpha 5e-2 -beta 1.0 -lambda_1 5e-5 -lambda_2 15.0 --no-norm
#sh local.sh 1 3 /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/test/distributed/dist_xlearn_train ~/documents/data/libffm_toy/criteo.tr.r100.gbdt0.ffm -v ~/documents/data/libffm_toy/criteo.va.r100.gbdt0.ffm -s 0 -x auc --dis-es -p ftrl -alpha 5e-2 -beta 1.0 -lambda_1 5e-5 -lambda_2 15.0 --no-norm
#echo "=====================================BigDataFM================================="
#sh local.sh 1 1 /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/xlearn_train ~/documents/data/libffm_toy/criteo.tr.r100.gbdt0.ffm -v ~/documents/data/libffm_toy/criteo.va.r100.gbdt0.ffm -s 1 -x auc --dis-es -p ftrl -alpha 5e-2 -beta 1.0 -lambda_1 5e-5 -lambda_2 15.0 --no-norm
#echo "=====================================BigDataFFM==============================="
#sh local.sh 1 1 /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/xlearn_train ~/documents/data/libffm_toy/criteo.tr.r100.gbdt0.ffm -v ~/documents/data/libffm_toy/criteo.va.r100.gbdt0.ffm -s 2 -x auc --dis-es -p ftrl -alpha 5e-2 -beta 1.0 -lambda_1 5e-5 -lambda_2 15.0 --no-norm
13 changes: 13 additions & 0 deletions scripts/run_xlearn_local_train.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#echo "====================================SmallData LR==================================="
#/Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/xlearn_train /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/demo/classification/criteo_ctr/small_train.txt -v /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/demo/classification/criteo_ctr/small_test.txt -s 0 -x auc --dis-es
#echo "====================================SmallData FM==================================="
#/Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/xlearn_train /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/demo/classification/criteo_ctr/small_train.txt -v /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/demo/classification/criteo_ctr/small_test.txt -s 1 -x auc --dis-es
#echo "====================================SmallData FFM=================================="
#/Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/xlearn_train /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/demo/classification/criteo_ctr/small_train.txt -v /Users/xiaoshuwang/documents/oneflow/opensource/xlearn/demo/classification/criteo_ctr/small_test.txt -s 2 -x auc --dis-es

echo "=====================================BigDataLR================================="
/Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/xlearn_train ~/documents/data/libffm_toy/criteo.tr.r100.gbdt0.ffm -v ~/documents/data/libffm_toy/criteo.va.r100.gbdt0.ffm -s 0 -x auc --dis-es -p ftrl -alpha 5e-2 -beta 1.0 -lambda_1 5e-5 -lambda_2 15.0 --no-norm
#echo "=====================================BigDataFM================================="
/Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/xlearn_train ~/documents/data/libffm_toy/criteo.tr.r100.gbdt0.ffm -v ~/documents/data/libffm_toy/criteo.va.r100.gbdt0.ffm -s 1 -x auc --dis-es -p ftrl -alpha 5e-2 -beta 1.0 -lambda_1 5e-5 -lambda_2 15.0 --no-norm
#echo "=====================================BigDataFFM==============================="
/Users/xiaoshuwang/documents/oneflow/opensource/xlearn/xlearn_build/xlearn_train ~/documents/data/libffm_toy/criteo.tr.r100.gbdt0.ffm -v ~/documents/data/libffm_toy/criteo.va.r100.gbdt0.ffm -s 2 -x auc --dis-es -p ftrl -alpha 5e-2 -beta 1.0 -lambda_1 5e-5 -lambda_2 15.0 --no-norm
10 changes: 10 additions & 0 deletions scripts/stop_xlearn_dist_train.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/sh
#
# stop_xlearn.sh
# Copyright (C) 2017 wangxiaoshu <[email protected]>
#
# Distributed under terms of the MIT license.
#


ps -ef | grep xlearn_dist_train | awk '{ print $2 }' | sudo xargs kill -9
10 changes: 10 additions & 0 deletions scripts/stop_xlearn_local_train.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/sh
#
# stop_xlearn.sh
# Copyright (C) 2017 wangxiaoshu <[email protected]>
#
# Distributed under terms of the MIT license.
#


ps -ef | grep xlearn_train | awk '{ print $2 }' | sudo xargs kill -9
4 changes: 3 additions & 1 deletion src/c_api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ add_library(xlearn_api_shared SHARED c_api.cc c_api_error.cc
../solver/checker.cc ../solver/trainer.cc
../solver/inference.cc ../solver/solver.cc)

target_link_libraries(xlearn_api_shared)

# Set properties
set_target_properties(xlearn_api_shared PROPERTIES OUTPUT_NAME "xlearn_api")
set_target_properties(xlearn_api_shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties(xlearn_api PROPERTIES CLEAN_DIRECT_OUTPUT 1)

# Build unittests.
set(LIBS xlearn_api solver reader loss score data base pthread gtest)
set(LIBS xlearn_api solver reader loss score data base)

add_executable(c_api_test c_api_test.cc)
target_link_libraries(c_api_test gtest_main ${LIBS})
Expand Down
13 changes: 13 additions & 0 deletions src/distributed/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})

set(STA_DEPS data base pslite protobuf zmq)
add_library(distributed STATIC dist_score_function.cc dist_linear_score.cc dist_fm_score.cc dist_ffm_score.cc dist_cross_entropy_loss.cc dist_checker.cc dist_loss.cc)
target_link_libraries(distributed ${STA_DEPS})

add_executable(dist_xlearn_train dist_train_main.cc dist_solver.cc dist_trainer.cc dist_inference.cc)
target_link_libraries(dist_xlearn_train solver distributed)

install(TARGETS distributed DESTINATION lib/distributed)
FILE(GLOB HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
message(${HEADER_FILES})
install(FILES ${HEADER_FILES} DESTINATION include/distributed)
Loading