File tree Expand file tree Collapse file tree 6 files changed +24
-7
lines changed
paddle/fluid/distributed/table Expand file tree Collapse file tree 6 files changed +24
-7
lines changed Original file line number Diff line number Diff line change @@ -305,8 +305,10 @@ if (WITH_PSCORE)
305305 include (external/libmct) # download, build, install libmct
306306 list (APPEND third_party_deps extern_libmct)
307307
308- include (external/rocksdb) # download, build, install libmct
309- list (APPEND third_party_deps extern_rocksdb)
308+ if (WITH_HETERPS)
309+ include (external/rocksdb) # download, build, install libmct
310+ list (APPEND third_party_deps extern_rocksdb)
311+ endif ()
310312endif ()
311313
312314if (WITH_XBYAK)
Original file line number Diff line number Diff line change @@ -16,10 +16,17 @@ set_source_files_properties(common_graph_table.cc PROPERTIES COMPILE_FLAGS ${DIS
1616
1717get_property (RPC_DEPS GLOBAL PROPERTY RPC_DEPS)
1818
19- cc_library(common_table SRCS common_sparse_table.cc ssd_sparse_table.cc common_dense_table.cc
20- sparse_geo_table.cc barrier_table.cc common_graph_table.cc DEPS ${TABLE_DEPS}
19+ set (EXTERN_DEP "" )
20+ if (WITH_HETERPS)
21+ set (TABLE_SRC common_sparse_table.cc ssd_sparse_table.cc common_dense_table.cc sparse_geo_table.cc barrier_table.cc common_graph_table.cc)
22+ set (EXTERN_DEP rocksdb)
23+ else ()
24+ set (TABLE_SRC common_sparse_table.cc common_dense_table.cc sparse_geo_table.cc barrier_table.cc common_graph_table.cc)
25+ endif ()
26+
27+ cc_library(common_table SRCS ${TABLE_SRC} DEPS ${TABLE_DEPS}
2128${RPC_DEPS} graph_edge graph_node device_context string_helper
22- simple_threadpool xxhash generator rocksdb )
29+ simple_threadpool xxhash generator ${EXTERN_DEP} )
2330
2431set_source_files_properties (tensor_accessor.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS} )
2532set_source_files_properties (tensor_table.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS} )
@@ -29,4 +36,3 @@ cc_library(tensor_table SRCS tensor_table.cc DEPS eigen3 ps_framework_proto exec
2936set_source_files_properties (table.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS} )
3037
3138cc_library(table SRCS table.cc DEPS common_table tensor_accessor tensor_table ps_framework_proto string_helper device_context gflags glog boost)
32- #target_link_libraries(table -lbz2)
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15+ #ifdef PADDLE_WITH_HETERPS
1516#include < glog/logging.h>
1617#include < rocksdb/db.h>
1718#include < rocksdb/filter_policy.h>
@@ -154,3 +155,4 @@ class RocksDBHandler {
154155};
155156}
156157}
158+ #endif
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15+ #ifdef PADDLE_WITH_HETERPS
1516#include " paddle/fluid/distributed/table/ssd_sparse_table.h"
1617
1718DEFINE_string (rocksdb_path, " database" , " path of sparse table rocksdb file" );
@@ -358,3 +359,4 @@ int64_t SSDSparseTable::LoadFromText(
358359
359360} // namespace ps
360361} // namespace paddle
362+ #endif
Original file line number Diff line number Diff line change 1515#pragma once
1616#include " paddle/fluid/distributed/table/common_sparse_table.h"
1717#include " paddle/fluid/distributed/table/depends/rocksdb_warpper.h"
18-
18+ # ifdef PADDLE_WITH_HETERPS
1919namespace paddle {
2020namespace distributed {
2121class SSDSparseTable : public CommonSparseTable {
@@ -58,3 +58,4 @@ class SSDSparseTable : public CommonSparseTable {
5858
5959} // namespace ps
6060} // namespace paddle
61+ #endif
Original file line number Diff line number Diff line change 2121#include " paddle/fluid/distributed/table/common_graph_table.h"
2222#include " paddle/fluid/distributed/table/common_sparse_table.h"
2323#include " paddle/fluid/distributed/table/sparse_geo_table.h"
24+ #ifdef PADDLE_WITH_HETERPS
2425#include " paddle/fluid/distributed/table/ssd_sparse_table.h"
26+ #endif
2527#include " paddle/fluid/distributed/table/tensor_accessor.h"
2628#include " paddle/fluid/distributed/table/tensor_table.h"
2729
@@ -30,7 +32,9 @@ namespace distributed {
3032REGISTER_PSCORE_CLASS (Table, GraphTable);
3133REGISTER_PSCORE_CLASS (Table, CommonDenseTable);
3234REGISTER_PSCORE_CLASS (Table, CommonSparseTable);
35+ #ifdef PADDLE_WITH_HETERPS
3336REGISTER_PSCORE_CLASS (Table, SSDSparseTable);
37+ #endif
3438REGISTER_PSCORE_CLASS (Table, SparseGeoTable);
3539REGISTER_PSCORE_CLASS (Table, BarrierTable);
3640REGISTER_PSCORE_CLASS (Table, TensorTable);
You can’t perform that action at this time.
0 commit comments