Browse Source

!19563 Optimize armour directory

Merge pull request !19563 from yyuse/fl_op_armour_dir
tags/v1.4.0
i-robot Gitee 4 years ago
parent
commit
81dbc13611
35 changed files with 56 additions and 62 deletions
  1. +0
    -5
      mindspore/ccsrc/CMakeLists.txt
  2. +0
    -12
      mindspore/ccsrc/armour/CMakeLists.txt
  3. +12
    -0
      mindspore/ccsrc/fl/CMakeLists.txt
  4. +2
    -2
      mindspore/ccsrc/fl/armour/cipher/cipher_init.cc
  5. +2
    -2
      mindspore/ccsrc/fl/armour/cipher/cipher_init.h
  6. +2
    -2
      mindspore/ccsrc/fl/armour/cipher/cipher_keys.cc
  7. +3
    -3
      mindspore/ccsrc/fl/armour/cipher/cipher_keys.h
  8. +1
    -1
      mindspore/ccsrc/fl/armour/cipher/cipher_meta_storage.cc
  9. +1
    -1
      mindspore/ccsrc/fl/armour/cipher/cipher_meta_storage.h
  10. +4
    -4
      mindspore/ccsrc/fl/armour/cipher/cipher_reconstruct.cc
  11. +3
    -3
      mindspore/ccsrc/fl/armour/cipher/cipher_reconstruct.h
  12. +2
    -2
      mindspore/ccsrc/fl/armour/cipher/cipher_shares.cc
  13. +3
    -3
      mindspore/ccsrc/fl/armour/cipher/cipher_shares.h
  14. +2
    -2
      mindspore/ccsrc/fl/armour/cipher/cipher_unmask.cc
  15. +3
    -3
      mindspore/ccsrc/fl/armour/cipher/cipher_unmask.h
  16. +1
    -1
      mindspore/ccsrc/fl/armour/secure_protocol/encrypt.cc
  17. +0
    -0
      mindspore/ccsrc/fl/armour/secure_protocol/encrypt.h
  18. +1
    -1
      mindspore/ccsrc/fl/armour/secure_protocol/key_agreement.cc
  19. +0
    -0
      mindspore/ccsrc/fl/armour/secure_protocol/key_agreement.h
  20. +1
    -1
      mindspore/ccsrc/fl/armour/secure_protocol/random.cc
  21. +1
    -1
      mindspore/ccsrc/fl/armour/secure_protocol/random.h
  22. +1
    -1
      mindspore/ccsrc/fl/armour/secure_protocol/secret_sharing.cc
  23. +0
    -0
      mindspore/ccsrc/fl/armour/secure_protocol/secret_sharing.h
  24. +1
    -1
      mindspore/ccsrc/fl/server/executor.h
  25. +1
    -1
      mindspore/ccsrc/fl/server/kernel/round/client_list_kernel.h
  26. +1
    -1
      mindspore/ccsrc/fl/server/kernel/round/exchange_keys_kernel.h
  27. +1
    -1
      mindspore/ccsrc/fl/server/kernel/round/get_keys_kernel.h
  28. +1
    -1
      mindspore/ccsrc/fl/server/kernel/round/get_secrets_kernel.cc
  29. +1
    -1
      mindspore/ccsrc/fl/server/kernel/round/get_secrets_kernel.h
  30. +1
    -1
      mindspore/ccsrc/fl/server/kernel/round/reconstruct_secrets_kernel.h
  31. +1
    -1
      mindspore/ccsrc/fl/server/kernel/round/share_secrets_kernel.h
  32. +1
    -1
      mindspore/ccsrc/fl/server/kernel/round/start_fl_job_kernel.cc
  33. +1
    -1
      mindspore/ccsrc/fl/server/server.cc
  34. +1
    -1
      mindspore/ccsrc/fl/server/server.h
  35. +0
    -1
      tests/ut/cpp/CMakeLists.txt

+ 0
- 5
mindspore/ccsrc/CMakeLists.txt View File

@@ -227,11 +227,6 @@ set(SUB_COMP
common debug pybind_api utils vm profiler ps fl
)

if(ENABLE_CPU AND NOT WIN32)
add_compile_definitions(ENABLE_ARMOUR)
list(APPEND SUB_COMP "armour")
endif()

foreach(_comp ${SUB_COMP})
add_subdirectory(${_comp})
string(REPLACE "/" "_" sub ${_comp})


+ 0
- 12
mindspore/ccsrc/armour/CMakeLists.txt View File

@@ -1,12 +0,0 @@
file(GLOB_RECURSE ARMOUR_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")

set(SERVER_FLATBUFFER_OUTPUT "${CMAKE_BINARY_DIR}/schema")
set(FBS_FILES
${CMAKE_CURRENT_SOURCE_DIR}/../../schema/cipher.fbs
${CMAKE_CURRENT_SOURCE_DIR}/../../schema/fl_job.fbs
)

set_property(SOURCE ${ARMOUR_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_ARMOUR)
add_library(_mindspore_armour_obj OBJECT ${ARMOUR_FILES})
add_dependencies(_mindspore_armour_obj generated_fbs_files)
target_link_libraries(_mindspore_armour_obj mindspore::flatbuffers)

+ 12
- 0
mindspore/ccsrc/fl/CMakeLists.txt View File

@@ -34,6 +34,18 @@ if(NOT ENABLE_CPU OR WIN32)
list(REMOVE_ITEM _FL_SRC_FILES "server/round.cc")
list(REMOVE_ITEM _FL_SRC_FILES "server/server.cc")
list(REMOVE_ITEM _FL_SRC_FILES "worker/fl_worker.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/secure_protocol/encrypt.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/secure_protocol/key_agreement.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/secure_protocol/random.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/secure_protocol/secret_sharing.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/cipher/cipher_init.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/cipher/cipher_keys.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/cipher/cipher_meta_storage.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/cipher/cipher_reconstruct.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/cipher/cipher_shares.cc")
list(REMOVE_ITEM _FL_SRC_FILES "armour/cipher/cipher_unmask.cc")
else()
add_compile_definitions(ENABLE_ARMOUR)
endif()

list(LENGTH _FL_SRC_FILES fl_file_num)


mindspore/ccsrc/armour/cipher/cipher_init.cc → mindspore/ccsrc/fl/armour/cipher/cipher_init.cc View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/

#include "armour/cipher/cipher_init.h"
#include "fl/armour/cipher/cipher_init.h"
#include "fl/server/common.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_init.h → mindspore/ccsrc/fl/armour/cipher/cipher_init.h View File

@@ -19,12 +19,12 @@

#include <vector>
#include <string>
#include "armour/secure_protocol/secret_sharing.h"
#include "fl/armour/secure_protocol/secret_sharing.h"
#include "proto/ps.pb.h"
#include "utils/log_adapter.h"
#include "schema/fl_job_generated.h"
#include "schema/cipher_generated.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_keys.cc → mindspore/ccsrc/fl/armour/cipher/cipher_keys.cc View File

@@ -14,8 +14,8 @@
* limitations under the License.
*/

#include "armour/cipher/cipher_keys.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_keys.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_keys.h → mindspore/ccsrc/fl/armour/cipher/cipher_keys.h View File

@@ -21,11 +21,11 @@
#include <string>
#include <memory>
#include <map>
#include "armour/secure_protocol/secret_sharing.h"
#include "fl/armour/secure_protocol/secret_sharing.h"
#include "proto/ps.pb.h"
#include "utils/log_adapter.h"
#include "armour/cipher/cipher_init.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_init.h"
#include "fl/armour/cipher/cipher_meta_storage.h"
#include "fl/server/common.h"

namespace mindspore {

mindspore/ccsrc/armour/cipher/cipher_meta_storage.cc → mindspore/ccsrc/fl/armour/cipher/cipher_meta_storage.cc View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_meta_storage.h → mindspore/ccsrc/fl/armour/cipher/cipher_meta_storage.h View File

@@ -28,7 +28,7 @@
#endif
#include "proto/ps.pb.h"
#include "utils/log_adapter.h"
#include "armour/secure_protocol/secret_sharing.h"
#include "fl/armour/secure_protocol/secret_sharing.h"
#include "schema/fl_job_generated.h"
#include "schema/cipher_generated.h"
#include "fl/server/distributed_metadata_store.h"

mindspore/ccsrc/armour/cipher/cipher_reconstruct.cc → mindspore/ccsrc/fl/armour/cipher/cipher_reconstruct.cc View File

@@ -14,11 +14,11 @@
* limitations under the License.
*/

#include "armour/cipher/cipher_reconstruct.h"
#include "fl/armour/cipher/cipher_reconstruct.h"
#include "fl/server/common.h"
#include "armour/secure_protocol/random.h"
#include "armour/secure_protocol/key_agreement.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/secure_protocol/random.h"
#include "fl/armour/secure_protocol/key_agreement.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_reconstruct.h → mindspore/ccsrc/fl/armour/cipher/cipher_reconstruct.h View File

@@ -22,11 +22,11 @@
#include <memory>
#include <map>
#include <utility>
#include "armour/secure_protocol/secret_sharing.h"
#include "fl/armour/secure_protocol/secret_sharing.h"
#include "proto/ps.pb.h"
#include "utils/log_adapter.h"
#include "armour/cipher/cipher_init.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_init.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_shares.cc → mindspore/ccsrc/fl/armour/cipher/cipher_shares.cc View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/

#include "armour/cipher/cipher_shares.h"
#include "fl/armour/cipher/cipher_shares.h"
#include "fl/server/common.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_shares.h → mindspore/ccsrc/fl/armour/cipher/cipher_shares.h View File

@@ -22,11 +22,11 @@
#include <memory>
#include <map>
#include <utility>
#include "armour/secure_protocol/secret_sharing.h"
#include "fl/armour/secure_protocol/secret_sharing.h"
#include "proto/ps.pb.h"
#include "utils/log_adapter.h"
#include "armour/cipher/cipher_init.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_init.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_unmask.cc → mindspore/ccsrc/fl/armour/cipher/cipher_unmask.cc View File

@@ -14,10 +14,10 @@
* limitations under the License.
*/

#include "armour/cipher/cipher_unmask.h"
#include "fl/armour/cipher/cipher_unmask.h"
#include "fl/server/common.h"
#include "fl/server/local_meta_store.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/cipher/cipher_unmask.h → mindspore/ccsrc/fl/armour/cipher/cipher_unmask.h View File

@@ -20,11 +20,11 @@
#include <vector>
#include <string>
#include <map>
#include "armour/secure_protocol/secret_sharing.h"
#include "fl/armour/secure_protocol/secret_sharing.h"
#include "proto/ps.pb.h"
#include "utils/log_adapter.h"
#include "armour/cipher/cipher_init.h"
#include "armour/cipher/cipher_meta_storage.h"
#include "fl/armour/cipher/cipher_init.h"
#include "fl/armour/cipher/cipher_meta_storage.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/secure_protocol/encrypt.cc → mindspore/ccsrc/fl/armour/secure_protocol/encrypt.cc View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "armour/secure_protocol/encrypt.h"
#include "fl/armour/secure_protocol/encrypt.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/secure_protocol/encrypt.h → mindspore/ccsrc/fl/armour/secure_protocol/encrypt.h View File


mindspore/ccsrc/armour/secure_protocol/key_agreement.cc → mindspore/ccsrc/fl/armour/secure_protocol/key_agreement.cc View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "armour/secure_protocol/key_agreement.h"
#include "fl/armour/secure_protocol/key_agreement.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/secure_protocol/key_agreement.h → mindspore/ccsrc/fl/armour/secure_protocol/key_agreement.h View File


mindspore/ccsrc/armour/secure_protocol/random.cc → mindspore/ccsrc/fl/armour/secure_protocol/random.cc View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "armour/secure_protocol/random.h"
#include "fl/armour/secure_protocol/random.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/secure_protocol/random.h → mindspore/ccsrc/fl/armour/secure_protocol/random.h View File

@@ -22,7 +22,7 @@
#ifndef _WIN32
#include <openssl/rand.h>
#endif
#include "armour/secure_protocol/encrypt.h"
#include "fl/armour/secure_protocol/encrypt.h"
namespace mindspore {
namespace armour {


mindspore/ccsrc/armour/secure_protocol/secret_sharing.cc → mindspore/ccsrc/fl/armour/secure_protocol/secret_sharing.cc View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "armour/secure_protocol/secret_sharing.h"
#include "fl/armour/secure_protocol/secret_sharing.h"

namespace mindspore {
namespace armour {

mindspore/ccsrc/armour/secure_protocol/secret_sharing.h → mindspore/ccsrc/fl/armour/secure_protocol/secret_sharing.h View File


+ 1
- 1
mindspore/ccsrc/fl/server/executor.h View File

@@ -27,7 +27,7 @@
#include "fl/server/common.h"
#include "fl/server/parameter_aggregator.h"
#ifdef ENABLE_ARMOUR
#include "armour/cipher/cipher_unmask.h"
#include "fl/armour/cipher/cipher_unmask.h"
#endif

namespace mindspore {


+ 1
- 1
mindspore/ccsrc/fl/server/kernel/round/client_list_kernel.h View File

@@ -22,7 +22,7 @@
#include "fl/server/common.h"
#include "fl/server/kernel/round/round_kernel.h"
#include "fl/server/kernel/round/round_kernel_factory.h"
#include "armour/cipher/cipher_init.h"
#include "fl/armour/cipher/cipher_init.h"
#include "fl/server/executor.h"

namespace mindspore {


+ 1
- 1
mindspore/ccsrc/fl/server/kernel/round/exchange_keys_kernel.h View File

@@ -22,7 +22,7 @@
#include "fl/server/kernel/round/round_kernel.h"
#include "fl/server/kernel/round/round_kernel_factory.h"
#include "fl/server/executor.h"
#include "armour/cipher/cipher_keys.h"
#include "fl/armour/cipher/cipher_keys.h"

namespace mindspore {
namespace ps {


+ 1
- 1
mindspore/ccsrc/fl/server/kernel/round/get_keys_kernel.h View File

@@ -22,7 +22,7 @@
#include "fl/server/kernel/round/round_kernel.h"
#include "fl/server/kernel/round/round_kernel_factory.h"
#include "fl/server/executor.h"
#include "armour/cipher/cipher_keys.h"
#include "fl/armour/cipher/cipher_keys.h"

namespace mindspore {
namespace ps {


+ 1
- 1
mindspore/ccsrc/fl/server/kernel/round/get_secrets_kernel.cc View File

@@ -18,7 +18,7 @@
#include <vector>
#include <memory>
#include <string>
#include "armour/cipher/cipher_shares.h"
#include "fl/armour/cipher/cipher_shares.h"

namespace mindspore {
namespace ps {


+ 1
- 1
mindspore/ccsrc/fl/server/kernel/round/get_secrets_kernel.h View File

@@ -21,7 +21,7 @@
#include "fl/server/common.h"
#include "fl/server/kernel/round/round_kernel.h"
#include "fl/server/kernel/round/round_kernel_factory.h"
#include "armour/cipher/cipher_shares.h"
#include "fl/armour/cipher/cipher_shares.h"
#include "fl/server/executor.h"

namespace mindspore {


+ 1
- 1
mindspore/ccsrc/fl/server/kernel/round/reconstruct_secrets_kernel.h View File

@@ -23,7 +23,7 @@
#include "fl/server/common.h"
#include "fl/server/kernel/round/round_kernel.h"
#include "fl/server/kernel/round/round_kernel_factory.h"
#include "armour/cipher/cipher_reconstruct.h"
#include "fl/armour/cipher/cipher_reconstruct.h"
#include "fl/server/executor.h"

namespace mindspore {


+ 1
- 1
mindspore/ccsrc/fl/server/kernel/round/share_secrets_kernel.h View File

@@ -22,7 +22,7 @@
#include "fl/server/executor.h"
#include "fl/server/kernel/round/round_kernel.h"
#include "fl/server/kernel/round/round_kernel_factory.h"
#include "armour/cipher/cipher_shares.h"
#include "fl/armour/cipher/cipher_shares.h"

namespace mindspore {
namespace ps {


+ 1
- 1
mindspore/ccsrc/fl/server/kernel/round/start_fl_job_kernel.cc View File

@@ -22,7 +22,7 @@
#include "fl/server/model_store.h"
#include "fl/server/iteration.h"
#ifdef ENABLE_ARMOUR
#include "armour/cipher/cipher_init.h"
#include "fl/armour/cipher/cipher_init.h"
#endif

namespace mindspore {


+ 1
- 1
mindspore/ccsrc/fl/server/server.cc View File

@@ -19,7 +19,7 @@
#include <string>
#include <csignal>
#ifdef ENABLE_ARMOUR
#include "armour/secure_protocol/secret_sharing.h"
#include "fl/armour/secure_protocol/secret_sharing.h"
#endif
#include "fl/server/round.h"
#include "fl/server/model_store.h"


+ 1
- 1
mindspore/ccsrc/fl/server/server.h View File

@@ -27,7 +27,7 @@
#include "fl/server/executor.h"
#include "fl/server/iteration.h"
#ifdef ENABLE_ARMOUR
#include "armour/cipher/cipher_init.h"
#include "fl/armour/cipher/cipher_init.h"
#endif

namespace mindspore {


+ 0
- 1
tests/ut/cpp/CMakeLists.txt View File

@@ -162,7 +162,6 @@ file(GLOB_RECURSE MINDSPORE_SRC_LIST RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
"../../../mindspore/ccsrc/fl/*.cc"
"../../../mindspore/ccsrc/profiler/device/common/*.cc"
"../../../mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/fp32/adam_fp32.c"
"../../../mindspore/ccsrc/armour/*.cc"
)

list(REMOVE_ITEM MINDSPORE_SRC_LIST


Loading…
Cancel
Save