From d2a63cb22fe89b2684d4a7dc195b6cca500477c9 Mon Sep 17 00:00:00 2001 From: leondavi Date: Fri, 12 Jul 2024 16:38:28 +0300 Subject: [PATCH 1/6] [NERLPLANNER] add distributed type tiles - Fix issue that tokens is not saved as Ori reported --- src_cpp/common/worker_definitions_ag.h | 2 +- .../src/Client/clientWorkersFunctions.erl | 3 +++ .../NerlnetApp/src/worker_definitions_ag.hrl | 27 ++++++++++--------- .../JsonElementWorkerDefinitions.py | 13 ++++----- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src_cpp/common/worker_definitions_ag.h b/src_cpp/common/worker_definitions_ag.h index b9118bfa..3117b7f5 100644 --- a/src_cpp/common/worker_definitions_ag.h +++ b/src_cpp/common/worker_definitions_ag.h @@ -17,6 +17,6 @@ enum ModelTypeEnum{MODEL_TYPE_NN=0,MODEL_TYPE_APPROXIMATION=1,MODEL_TYPE_CLASSIF enum OptimizerEnum{OPTIMIZER_GD=0,OPTIMIZER_CGD=1,OPTIMIZER_SGD=2,OPTIMIZER_QUASINEUTON=3,OPTIMIZER_LVM=4,OPTIMIZER_ADAM=5}; enum LossMethodEnum{LOSS_METHOD_SSE=1,LOSS_METHOD_MSE=2,LOSS_METHOD_NSE=3,LOSS_METHOD_MINKOWSKIE=4,LOSS_METHOD_WSE=5,LOSS_METHOD_CEE=6}; enum InfraTypeEnum{INFRA_TYPE_OPENNN=0,INFRA_TYPE_WOLFENGINE=1}; -enum WorkerDistributedSystemTypeEnum{WORKER_DISTRIBUTED_SYSTEM_TYPE_NONE=0,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG=1,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG=2,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION=3,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION=4,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE=5,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE=6}; +enum WorkerDistributedSystemTypeEnum{WORKER_DISTRIBUTED_SYSTEM_TYPE_NONE=0,WORKER_DISTRIBUTED_SYSTEM_TYPE_TILES=1,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG=2,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG=3,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION=4,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION=5,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE=6,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE=7}; } // namespace nerlnet diff --git a/src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl b/src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl index c654b49e..bb07e595 100644 --- a/src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl +++ b/src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl @@ -10,6 +10,9 @@ get_distributed_worker_behavior(ClientEtsRef, DistributedSystemType , WorkerName , DistributedSystemArgs , DistributedSystemToken) -> case DistributedSystemType of + ?DC_DISTRIBUTED_SYSTEM_TYPE_TILES_KEY_ATOM -> + DistributedBehaviorFunc = fun workerNN:controller/2, + DistributedWorkerData = {tiles, DistributedSystemArgs, DistributedSystemToken}; ?DC_DISTRIBUTED_SYSTEM_TYPE_NONE_IDX_STR -> DistributedBehaviorFunc = fun workerNN:controller/2, DistributedWorkerData = none; diff --git a/src_erl/NerlnetApp/src/worker_definitions_ag.hrl b/src_erl/NerlnetApp/src/worker_definitions_ag.hrl index 1088f10e..839aff77 100644 --- a/src_erl/NerlnetApp/src/worker_definitions_ag.hrl +++ b/src_erl/NerlnetApp/src/worker_definitions_ag.hrl @@ -32,6 +32,7 @@ -define(WORKER_FIELD_KEY_DISTRIBUTED_SYSTEM_ARGS_BIN,<<"distributedSystemArgs">>). -define(DC_DISTRIBUTED_SYSTEM_TYPE_NONE_KEY_ATOM,none). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_KEY_ATOM,tiles). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_KEY_ATOM,fedClientAvg). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_KEY_ATOM,fedServerAvg). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_KEY_ATOM,fedClientWeightedAvgClassification). @@ -40,20 +41,22 @@ -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_KEY_ATOM,fedServerAE). -define(DC_DISTRIBUTED_SYSTEM_TYPE_NONE_IDX_STR,"0"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_IDX_STR,"1"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_IDX_STR,"2"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_IDX_STR,"3"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_IDX_STR,"4"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_IDX_STR,"5"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_IDX_STR,"6"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_IDX_STR,"1"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_IDX_STR,"2"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_IDX_STR,"3"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_IDX_STR,"4"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_IDX_STR,"5"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_IDX_STR,"6"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_IDX_STR,"7"). -define(DC_DISTRIBUTED_SYSTEM_TYPE_NONE_IDX,0). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_IDX,1). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_IDX,2). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_IDX,3). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_IDX,4). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_IDX,5). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_IDX,6). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_IDX,1). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_IDX,2). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_IDX,3). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_IDX,4). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_IDX,5). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_IDX,6). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_IDX,7). -define(DC_INFRA_TYPE_OPENNN_KEY_ATOM,opennn). -define(DC_INFRA_TYPE_WOLFENGINE_KEY_ATOM,wolfengine). diff --git a/src_py/nerlPlanner/JsonElementWorkerDefinitions.py b/src_py/nerlPlanner/JsonElementWorkerDefinitions.py index 13b8c2b3..3e7bc405 100644 --- a/src_py/nerlPlanner/JsonElementWorkerDefinitions.py +++ b/src_py/nerlPlanner/JsonElementWorkerDefinitions.py @@ -118,12 +118,13 @@ DistributedSystemTypeMapping = OrderedDict([ ("none" , "0"), - ("FedClientAvg" , "1"), - ("FedServerAvg" , "2"), - ("FedClientWeightedAvgClassification" , "3"), - ("FedServerWeightedAvgClassification" , "4"), - ("FedClientAE" , "5"), - ("FedServerAE" , "6") + ("tiles", "1"), + ("FedClientAvg" , "2"), + ("FedServerAvg" , "3"), + ("FedClientWeightedAvgClassification" , "4"), + ("FedServerWeightedAvgClassification" , "5"), + ("FedClientAE" , "6"), + ("FedServerAE" , "7") ]) InfraTypeMapping = OrderedDict([ From 92598759e30ddced2dc43de8d9119cac2a4de952 Mon Sep 17 00:00:00 2001 From: leondavi Date: Fri, 12 Jul 2024 17:10:15 +0300 Subject: [PATCH 2/6] [NIFTEST] Issues were found --- src_erl/NerlnetApp/src/Bridge/nerlTests.erl | 19 +++++++++++-------- tests/NerlnetNifTest.sh | 3 ++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src_erl/NerlnetApp/src/Bridge/nerlTests.erl b/src_erl/NerlnetApp/src/Bridge/nerlTests.erl index d76cde0d..16a67fd9 100644 --- a/src_erl/NerlnetApp/src/Bridge/nerlTests.erl +++ b/src_erl/NerlnetApp/src/Bridge/nerlTests.erl @@ -90,9 +90,9 @@ run_tests()-> NerlworkerTestFunc = fun(_Rounds) -> Performance = 0, nerlworker_test(NeuralNetworkTestingModelList, Performance) end, NerlworkerTestName = "nerlworker_test", test_envelope_nif_performance(NerlworkerTestFunc, NerlworkerTestName, length(NeuralNetworkTestingModelList) ), - nerltest_print("count label test"), + CountLabelTestName = "test_count_label", - CountLabelTestFunc = fun(_Rounds) -> test_count_label_nif() end, + CountLabelTestFunc = fun(_Rounds) -> count_label_nif_test() end, test_envelope(CountLabelTestFunc, CountLabelTestName, 1 ), nerltest_print("Tests Completed"), ok. @@ -305,7 +305,10 @@ nerlworker_test_generate_data(LayersSizes, LayerTypes, NumOfSamples) -> %% Ask D {NerlTensor , Type} = nerlNIF:nerltensor_conversion({ErlDataTensor,erl_float} , float), {NerlTensor , Type , ErlDataTensor , erl_float , NumOfFeatures , NumOfLabels}. -test_count_label_nif() -> +count_label_nif_test() -> + % TODO - Ori please move the network configuration to neural_networks_testing_models.hrl + % Please add performance evaluation - Run this test 10-20 rounds and accumulate performance of nif + % By adding tic toc before and after the NIF ModelId = erlang:unique_integer([positive]), ModelType = "0", ModelArgs = "", @@ -315,7 +318,7 @@ test_count_label_nif() -> OptimizerType = "2", OptimizerArgs = "", LossMethod = "2", - DistributedSystemType = "3", + DistributedSystemType = "4", % TODO this should be derived from AG macro DistributedSystemArg = "", DimMaxDimX = ?NERLWORKER_DISTRIBUTED_FED_WEIGHTED_AVG_CLASSIFIER_DATA_DIM_X, DimMinDimX = ?NERLWORKER_DISTRIBUTED_FED_WEIGHTED_AVG_CLASSIFIER_DATA_MIN_DIM_X, @@ -333,8 +336,8 @@ test_count_label_nif() -> LenActualDataIf = LenActualData end, DataRand = generate_nerltensor(float,?TEST_LABEL_COUNT_NUMOF_SAMPLES,LenActualDataIf,1), - LayersSizes = nerl:string_format("~p,~p",[LenActualDataIf-LenActualLabels,LenActualLabels]), - LayersTypes = "1,3", + LayersSizes = nerl:string_format("~p,~p",[LenActualDataIf-LenActualLabels,LenActualLabels]), + LayersTypes = "1,3",% Please move it to neural_networks_testing_models.hrl as part of NN configuration nerlNIF:test_nerlworker_nif(ModelId,ModelType,ModelArgs,LayersSizes, LayersTypes, LayersFunctionalityCodes, LearningRate, Epochs, OptimizerType, OptimizerArgs, LossMethod, DistributedSystemType, DistributedSystemArg), @@ -346,11 +349,11 @@ test_count_label_nif() -> {_,DataRandRes} = lists:split(3, DataRand), Sum = get_label_count(LenActualLabels,LenActualDataIf,SumInit,DataRandRes,0) , {_,LabelCountRes} = lists:split(3, LabelCountFloat), + nerlNIF:remove_nerlworker_nif(ModelId), if (Sum == LabelCountRes) -> nerltest_print("Label count test passed"); true -> throw(nerl:string_format("Label count test failed ~n Sum: ~p ~n LabelCount: ~p",[Sum,LabelCountRes])) - end, - nerlNIF:remove_nerlworker_nif(ModelId). + end. get_label_count(LenLabel,LenData,Sum,Data,N) -> diff --git a/tests/NerlnetNifTest.sh b/tests/NerlnetNifTest.sh index e23a1cce..cca2690f 100755 --- a/tests/NerlnetNifTest.sh +++ b/tests/NerlnetNifTest.sh @@ -56,9 +56,10 @@ COMPILE_NERLTENSOR="compile:file(\"nerlTensor.erl\")" COMPILE_FILES="$COMPILE_NERL,$COMPILE_NERLNIF,$COMPILE_NERLTEST,$COMPILE_NERLTENSOR" -erl -noshell -eval "$COMPILE_FILES, nerlTests:run_tests()." -s init stop > "$NERLNET_TEST_DIR/$LOG_FILE" #TODO fix +erl -noshell -eval "$COMPILE_FILES, nerlTests:run_tests()." -s init stop > "$NERLNET_TEST_DIR/$LOG_FILE" rc=$(echo $?) cat "$NERLNET_TEST_DIR/$LOG_FILE" cd - +echo "Test returned: $rc" exit $rc From 5c49a93738625284379af939a2c3498df35759aa Mon Sep 17 00:00:00 2001 From: GuyPerets106 Date: Fri, 12 Jul 2024 14:35:22 +0000 Subject: [PATCH 3/6] [TILES_KEY] Changed to IDX instead of KEY_ATOM --- src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl b/src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl index bb07e595..2d1a2119 100644 --- a/src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl +++ b/src_erl/NerlnetApp/src/Client/clientWorkersFunctions.erl @@ -10,7 +10,7 @@ get_distributed_worker_behavior(ClientEtsRef, DistributedSystemType , WorkerName , DistributedSystemArgs , DistributedSystemToken) -> case DistributedSystemType of - ?DC_DISTRIBUTED_SYSTEM_TYPE_TILES_KEY_ATOM -> + ?DC_DISTRIBUTED_SYSTEM_TYPE_TILES_IDX_STR -> DistributedBehaviorFunc = fun workerNN:controller/2, DistributedWorkerData = {tiles, DistributedSystemArgs, DistributedSystemToken}; ?DC_DISTRIBUTED_SYSTEM_TYPE_NONE_IDX_STR -> From 8ff4f338cfb9c4a49f9511da2ddcc1f86c4c86b9 Mon Sep 17 00:00:00 2001 From: GuyPerets106 Date: Fri, 12 Jul 2024 19:54:25 +0000 Subject: [PATCH 4/6] tiles move the last index --- src_py/nerlPlanner/JsonElementWorkerDefinitions.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src_py/nerlPlanner/JsonElementWorkerDefinitions.py b/src_py/nerlPlanner/JsonElementWorkerDefinitions.py index 3e7bc405..b427057d 100644 --- a/src_py/nerlPlanner/JsonElementWorkerDefinitions.py +++ b/src_py/nerlPlanner/JsonElementWorkerDefinitions.py @@ -118,13 +118,13 @@ DistributedSystemTypeMapping = OrderedDict([ ("none" , "0"), - ("tiles", "1"), - ("FedClientAvg" , "2"), - ("FedServerAvg" , "3"), - ("FedClientWeightedAvgClassification" , "4"), - ("FedServerWeightedAvgClassification" , "5"), - ("FedClientAE" , "6"), - ("FedServerAE" , "7") + ("FedClientAvg" , "1"), + ("FedServerAvg" , "2"), + ("FedClientWeightedAvgClassification" , "3"), + ("FedServerWeightedAvgClassification" , "4"), + ("FedClientAE" , "5"), + ("FedServerAE" , "6"), + ("tiles", "7") ]) InfraTypeMapping = OrderedDict([ From 2a889a0cf7f3ec8524403a9f1a349dc50792196b Mon Sep 17 00:00:00 2001 From: GuyPerets106 Date: Fri, 12 Jul 2024 19:56:17 +0000 Subject: [PATCH 5/6] After build updated files --- src_cpp/common/worker_definitions_ag.h | 2 +- .../NerlnetApp/src/worker_definitions_ag.hrl | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src_cpp/common/worker_definitions_ag.h b/src_cpp/common/worker_definitions_ag.h index 3117b7f5..a690953a 100644 --- a/src_cpp/common/worker_definitions_ag.h +++ b/src_cpp/common/worker_definitions_ag.h @@ -17,6 +17,6 @@ enum ModelTypeEnum{MODEL_TYPE_NN=0,MODEL_TYPE_APPROXIMATION=1,MODEL_TYPE_CLASSIF enum OptimizerEnum{OPTIMIZER_GD=0,OPTIMIZER_CGD=1,OPTIMIZER_SGD=2,OPTIMIZER_QUASINEUTON=3,OPTIMIZER_LVM=4,OPTIMIZER_ADAM=5}; enum LossMethodEnum{LOSS_METHOD_SSE=1,LOSS_METHOD_MSE=2,LOSS_METHOD_NSE=3,LOSS_METHOD_MINKOWSKIE=4,LOSS_METHOD_WSE=5,LOSS_METHOD_CEE=6}; enum InfraTypeEnum{INFRA_TYPE_OPENNN=0,INFRA_TYPE_WOLFENGINE=1}; -enum WorkerDistributedSystemTypeEnum{WORKER_DISTRIBUTED_SYSTEM_TYPE_NONE=0,WORKER_DISTRIBUTED_SYSTEM_TYPE_TILES=1,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG=2,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG=3,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION=4,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION=5,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE=6,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE=7}; +enum WorkerDistributedSystemTypeEnum{WORKER_DISTRIBUTED_SYSTEM_TYPE_NONE=0,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG=1,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG=2,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION=3,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION=4,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE=5,WORKER_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE=6,WORKER_DISTRIBUTED_SYSTEM_TYPE_TILES=7}; } // namespace nerlnet diff --git a/src_erl/NerlnetApp/src/worker_definitions_ag.hrl b/src_erl/NerlnetApp/src/worker_definitions_ag.hrl index 839aff77..755cd20d 100644 --- a/src_erl/NerlnetApp/src/worker_definitions_ag.hrl +++ b/src_erl/NerlnetApp/src/worker_definitions_ag.hrl @@ -32,31 +32,31 @@ -define(WORKER_FIELD_KEY_DISTRIBUTED_SYSTEM_ARGS_BIN,<<"distributedSystemArgs">>). -define(DC_DISTRIBUTED_SYSTEM_TYPE_NONE_KEY_ATOM,none). --define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_KEY_ATOM,tiles). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_KEY_ATOM,fedClientAvg). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_KEY_ATOM,fedServerAvg). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_KEY_ATOM,fedClientWeightedAvgClassification). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_KEY_ATOM,fedServerWeightedAvgClassification). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_KEY_ATOM,fedClientAE). -define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_KEY_ATOM,fedServerAE). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_KEY_ATOM,tiles). -define(DC_DISTRIBUTED_SYSTEM_TYPE_NONE_IDX_STR,"0"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_IDX_STR,"1"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_IDX_STR,"2"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_IDX_STR,"3"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_IDX_STR,"4"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_IDX_STR,"5"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_IDX_STR,"6"). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_IDX_STR,"7"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_IDX_STR,"1"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_IDX_STR,"2"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_IDX_STR,"3"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_IDX_STR,"4"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_IDX_STR,"5"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_IDX_STR,"6"). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_IDX_STR,"7"). -define(DC_DISTRIBUTED_SYSTEM_TYPE_NONE_IDX,0). --define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_IDX,1). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_IDX,2). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_IDX,3). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_IDX,4). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_IDX,5). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_IDX,6). --define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_IDX,7). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAVG_IDX,1). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAVG_IDX,2). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTWEIGHTEDAVGCLASSIFICATION_IDX,3). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERWEIGHTEDAVGCLASSIFICATION_IDX,4). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDCLIENTAE_IDX,5). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_FEDSERVERAE_IDX,6). +-define(DC_DISTRIBUTED_SYSTEM_TYPE_TILES_IDX,7). -define(DC_INFRA_TYPE_OPENNN_KEY_ATOM,opennn). -define(DC_INFRA_TYPE_WOLFENGINE_KEY_ATOM,wolfengine). From 9dbc55b615bed5a8571574882438bb6db135867e Mon Sep 17 00:00:00 2001 From: GuyPerets106 Date: Fri, 12 Jul 2024 20:05:16 +0000 Subject: [PATCH 6/6] Fixed distributed type back to 3 --- src_erl/NerlnetApp/src/Bridge/nerlTests.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src_erl/NerlnetApp/src/Bridge/nerlTests.erl b/src_erl/NerlnetApp/src/Bridge/nerlTests.erl index 16a67fd9..3e17c5cb 100644 --- a/src_erl/NerlnetApp/src/Bridge/nerlTests.erl +++ b/src_erl/NerlnetApp/src/Bridge/nerlTests.erl @@ -318,7 +318,7 @@ count_label_nif_test() -> OptimizerType = "2", OptimizerArgs = "", LossMethod = "2", - DistributedSystemType = "4", % TODO this should be derived from AG macro + DistributedSystemType = "3", % TODO this should be derived from AG macro DistributedSystemArg = "", DimMaxDimX = ?NERLWORKER_DISTRIBUTED_FED_WEIGHTED_AVG_CLASSIFIER_DATA_DIM_X, DimMinDimX = ?NERLWORKER_DISTRIBUTED_FED_WEIGHTED_AVG_CLASSIFIER_DATA_MIN_DIM_X,