diff --git a/.ci/accuracy_test.py b/.ci/accuracy_test.py index 8466548..19fa987 100644 --- a/.ci/accuracy_test.py +++ b/.ci/accuracy_test.py @@ -372,32 +372,20 @@ def exec(self, epsilon=0.0001): if __name__ == "__main__": AccuracyTestCase( - service_id="bin_onehot_glm", + service_id="glm", parties=['alice', 'bob'], - case_dir='.ci/test_data/bin_onehot_glm', + case_dir='.ci/test_data/glm', package_name='s_model.tar.gz', input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, expect_csv_name='predict.csv', query_ids=['1', '2', '3', '4', '5', '6', '7', '8', '9', '15'], - score_col_name='pred', - ).exec() - - AccuracyTestCase( - service_id="bin_onehot_glm_alice_no_feature", - parties=['alice', 'bob'], - case_dir='.ci/test_data/bin_onehot_glm_alice_no_feature', - package_name='s_model.tar.gz', - input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, - expect_csv_name='predict.csv', - query_ids=['1', '2', '3', '4', '5', '6', '7', '8', '9', '15'], - score_col_name='pred', - use_oss=True, - ).exec() + score_col_name='pred_y', + ).exec(0.1) AccuracyTestCase( - service_id="bin_sgb", + service_id="sgb", parties=['alice', 'bob'], - case_dir='.ci/test_data/bin_sgb', + case_dir='.ci/test_data/sgb', package_name='s_model.tar.gz', input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, expect_csv_name='predict.csv', @@ -406,9 +394,9 @@ def exec(self, epsilon=0.0001): ).exec() AccuracyTestCase( - service_id="bin_sgb_alice_no_feature", + service_id="sgb_fetures_in_one_party", parties=['alice', 'bob'], - case_dir='.ci/test_data/bin_sgb_alice_no_feature', + case_dir='.ci/test_data/fetures_in_one_party/sgb', package_name='s_model.tar.gz', input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, expect_csv_name='predict.csv', @@ -428,9 +416,9 @@ def exec(self, epsilon=0.0001): ).exec() AccuracyTestCase( - service_id="xgb_alice_no_feature", + service_id="xgb_fetures_in_one_party", parties=['alice', 'bob'], - case_dir='.ci/test_data/xgb_alice_no_feature', + case_dir='.ci/test_data/fetures_in_one_party/xgb', package_name='s_model.tar.gz', input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, expect_csv_name='predict.csv', @@ -450,9 +438,9 @@ def exec(self, epsilon=0.0001): ).exec() AccuracyTestCase( - service_id="sgd_alice_no_feature", + service_id="sgd_fetures_in_one_party", parties=['alice', 'bob'], - case_dir='.ci/test_data/sgd_alice_no_feature', + case_dir='.ci/test_data/fetures_in_one_party/sgd', package_name='s_model.tar.gz', input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, expect_csv_name='predict.csv', @@ -461,9 +449,9 @@ def exec(self, epsilon=0.0001): ).exec() AccuracyTestCase( - service_id="phe_sgd", + service_id="ou_sgd", parties=['alice', 'bob'], - case_dir='.ci/test_data/phe_sgd', + case_dir='.ci/test_data/ou_sgd', package_name='s_model.tar.gz', input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, expect_csv_name='predict.csv', @@ -472,9 +460,9 @@ def exec(self, epsilon=0.0001): ).exec() AccuracyTestCase( - service_id="phe_sgd_no_feature", + service_id="ou_sgd_fetures_in_one_party", parties=['alice', 'bob'], - case_dir='.ci/test_data/phe_sgd_no_feature', + case_dir='.ci/test_data/fetures_in_one_party/ou_sgd', package_name='s_model.tar.gz', input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, expect_csv_name='predict.csv', @@ -483,12 +471,12 @@ def exec(self, epsilon=0.0001): ).exec() AccuracyTestCase( - service_id="phe_glm", + service_id="ou_glm", parties=['alice', 'bob'], - case_dir='.ci/test_data/phe_glm', + case_dir='.ci/test_data/ou_glm', package_name='s_model.tar.gz', input_csv_names={'alice': 'alice.csv', 'bob': 'bob.csv'}, expect_csv_name='predict.csv', query_ids=['1', '2', '3', '4', '5', '6', '7', '8', '9', '15'], - score_col_name='predict_score', + score_col_name='pred_y', ).exec(0.1) diff --git a/.ci/inferencer_test.py b/.ci/inferencer_test.py index ec71d4d..53e74da 100644 --- a/.ci/inferencer_test.py +++ b/.ci/inferencer_test.py @@ -38,7 +38,13 @@ async def run_process(command): ) -async def run_inferencer_example(exmaple_dir: str, result_path: str, target_path: str): +async def run_inferencer_example( + exmaple_dir: str, + result_path: str, + target_path: str, + target_col_name: str, + epsilon=0.0001, +): print(f"====begin example: {exmaple_dir}=====") with resources.path( @@ -64,11 +70,11 @@ async def run_inferencer_example(exmaple_dir: str, result_path: str, target_path target_df = pd.read_csv(target_path) score_col = result_df['score'] - pred_col = target_df['pred'] + pred_col = target_df[target_col_name] assert len(score_col) == len(pred_col) - are_close = np.isclose(score_col, pred_col, atol=0.0001) + are_close = np.isclose(score_col, pred_col, atol=epsilon) for i, match in enumerate(are_close): assert match, f"row {i} mismatch: {score_col[i]} != {pred_col[i]}" @@ -79,7 +85,9 @@ async def run_inferencer_example(exmaple_dir: str, result_path: str, target_path run_inferencer_example( "secretflow_serving/tools/inferencer/example/normal", "tmp/alice/score.csv", - ".ci/test_data/bin_onehot_glm/predict.csv", + ".ci/test_data/glm/predict.csv", + "pred_y", + 0.01, ) ) @@ -87,6 +95,7 @@ async def run_inferencer_example(exmaple_dir: str, result_path: str, target_path run_inferencer_example( "secretflow_serving/tools/inferencer/example/one_party_no_feature", "tmp/bob/score.csv", - ".ci/test_data/bin_onehot_glm_alice_no_feature/predict.csv", + ".ci/test_data/fetures_in_one_party/sgd/predict.csv", + "pred", ) ) diff --git a/.ci/test_data/bin_onehot_glm/alice/alice.csv b/.ci/test_data/bin_onehot_glm/alice/alice.csv deleted file mode 100644 index e839d87..0000000 --- a/.ci/test_data/bin_onehot_glm/alice/alice.csv +++ /dev/null @@ -1,20 +0,0 @@ -id,f1,f2,f3,f4,f5,f6,f7,f8,b1,o1,y -1,-0.5591187559186066,-0.2814808888968485,-0.4310124259272412,0.42698761472064484,0.6996194412496004,-0.8971369921102821,-0.1297223511775294,-0.6458798434413631,0.1396383060036957,D,0.0 -2,0.17853136775181744,-0.4768767452292948,0.6595296048985997,0.16383724799230648,0.4191750631343425,-0.0553416809559204,-0.835222222053031,0.5381071271563711,0.08999384285997897,C,1.0 -3,0.6188609133556533,0.025633080047547052,0.8300179478963079,-0.45405441885735187,-0.08493499972471619,0.04889614165329914,-0.9523316995614857,-0.05353206715441927,0.2981044873444963,B,1.0 -4,-0.987002480643878,-0.005445413798033316,-0.3038095035035151,0.5789854645875725,-0.6726110640591769,-0.11796517197878131,-0.7913629960788118,0.5252666701315694,0.32159023992596675,B,1.0 -5,0.6116385036656158,-0.8027835368690399,0.9265753301309776,0.2876623562458911,-0.724878081055228,-0.4616345585134092,0.12250598496354348,-0.8694099398481183,0.16167450163600877,C,0.0 -6,0.3962787899764537,0.9626369136931534,-0.4469843026057556,-0.19952894216630912,0.3919110519057767,0.6720178809053261,0.2193264721156456,-0.09114188927646016,0.20676337842801856,B,1.0 -7,-0.31949896696401625,-0.061019155954883164,0.21272681598450438,-0.04834743340794745,-0.41783686135384324,-0.41386938227609527,-0.3882048353908272,-0.39360862010344855,0.018901318801212597,C,1.0 -8,-0.6890410003764369,0.6794623631273697,-0.6109496138280779,0.2063308648785771,-0.7103542356227883,-0.5119420092003868,0.9845747170799963,-0.5513685278692384,0.1172886051599123,D,0.0 -9,0.9144261444135624,0.8286609977949781,0.8594276816242405,-0.1911128016185284,-0.563727053934955,-0.5138533145337412,0.541481543886571,-0.5981519864733384,0.0376931235673269,C,0.0 -10,-0.32681090977474647,-0.2585901571374831,0.1498134434916294,-0.030934281477115855,0.49676503532610927,0.5352868285398893,0.5416854721911608,0.7276956182064944,0.16392625797797383,A,1.0 -11,-0.8145083132397042,-0.17213965884275084,-0.47778498865612185,-0.4422187336180494,0.4706377931123673,-0.27607008470757766,0.39780330740087533,0.6789359372382642,0.31034068728585906,D,0.0 -12,-0.806567246333072,0.12504945492870867,-0.18573074778559673,0.5359991111551932,-0.9817349707748626,-0.08835765250300809,0.05510025965060583,0.9270163534670308,0.3898825715991485,B,1.0 -13,0.6949887326949196,-0.5574518033675495,-0.7870700872148468,-0.7839266639621547,0.45191502356739766,0.49637655872697906,-0.9167349161493943,-0.46072101353916106,0.3119186144921719,B,0.0 -14,0.20745206273378214,-0.7081545737949029,-0.8552280589465922,-0.4986202792921457,0.15136419388574107,-0.7691661612231564,0.8935597105203195,-0.03929942517629792,0.36079060086816067,A,0.0 -15,0.6142565465487604,-0.47845178018046086,-0.4114963510637599,-0.00545243574944454,0.3566356120332963,-0.5179070466010649,-0.38576033872228077,-0.12374141954173834,0.4730381159140901,D,1.0 -16,0.45946357338763577,0.869516500592707,0.8940309303553251,0.25674205932621663,0.9769683757190519,0.4655966603399595,0.1749397180654313,-0.7330265340634321,0.057493900732114966,A,1.0 -17,0.07245618290940148,0.15828585207480095,0.6058844851447147,-0.7307832385640813,-0.7047890815652045,0.7604535581160456,0.800552689601107,0.5620156263473772,0.18038921596661117,D,1.0 -18,0.9462315279587412,-0.16484385288965275,0.9134186991705504,-0.8007932195395477,0.9007963088557205,-0.2762376803205897,0.08557406326172878,0.2904407156393314,0.39477993406748413,D,0.0 -19,-0.24293124558329304,-0.6951771796317134,0.7522260924861339,-0.894295158530586,-0.14577787102095408,-0.2960307812622618,0.28186485638698366,-0.2308367011118997,0.014778052261847086,C,0.0 diff --git a/.ci/test_data/bin_onehot_glm/alice/s_model.tar.gz b/.ci/test_data/bin_onehot_glm/alice/s_model.tar.gz deleted file mode 100644 index 6330550..0000000 Binary files a/.ci/test_data/bin_onehot_glm/alice/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/bin_onehot_glm/bob/bob.csv b/.ci/test_data/bin_onehot_glm/bob/bob.csv deleted file mode 100644 index e70da7c..0000000 --- a/.ci/test_data/bin_onehot_glm/bob/bob.csv +++ /dev/null @@ -1,20 +0,0 @@ -id,f9,f10,f11,f12,f13,f14,f15,f16,b2,o2 -1,0.5209858850305862,0.9053351714559352,-0.48894315289504453,0.9829900835655276,0.15858969894616792,-0.6509650422128417,-0.1925996324660748,0.7337426610542273,0.2069654682246781,C -2,0.958857708228386,-0.03544303040194019,0.1405452156194371,0.26566930360269203,-0.07037219203097589,-0.06238026085591453,-0.9576483200594723,0.10816205842994098,0.1731894617440778,A -3,-0.9699719830103539,-0.22871450938326254,0.9948664607223907,-0.22279916938471844,0.25927550014205414,0.3878264311318409,0.27177589619065845,0.6383352653093646,0.25407196544940047,D -4,-0.050829342174382175,0.3012852377213351,-0.6689844077984184,0.40506254578438017,0.8293328989949791,-0.33125222538898,-0.10029643042382363,-0.5102837414762278,0.4975597939138244,A -5,0.03254075321523131,-0.1550161278915756,0.748292942247121,-0.3110546506844072,-0.9357791012167433,-0.6037439666968589,-0.6685984505490399,0.3264405397456147,0.47940341433092076,C -6,-0.20783808110355806,0.25829933171498265,0.5454217424402565,-0.18908102504737956,0.9705429784843074,0.6544709622583322,0.5338931897402897,-0.22007933551686087,0.35156914944455486,B -7,0.42193410537442877,-0.2595318581831192,-0.2605537512100149,0.8343221815816269,0.22255791135656344,0.6519908236107419,-0.8582444787325789,0.9720562883664492,0.402478217150546,A -8,0.9832739317242707,0.16400234650147172,-0.5492110046967817,-0.6174901634775414,0.732487308619052,-0.802784012378206,-0.36245973518487573,-0.508591015050454,0.19336452375546404,D -9,-0.7442956984656484,-0.9874521101295344,0.6841333919922283,-0.7822304746507185,0.40523640971796415,-0.5573698692579074,-0.23805678835787902,0.8964462739632588,0.4198405689280362,D -10,0.7492376130689999,0.7977079143275674,-0.7263690468963742,-0.7226107456080437,-0.07819549018956495,-0.9606123576424457,0.21630587326725403,-0.14395471673536475,0.32775602239291934,A -11,-0.6542216900312965,0.07645253125796714,0.11882381987303448,0.8614954588574071,0.27210232282280633,-0.0371962155037604,0.3201004955320794,0.48841165779914575,0.3282744447473197,D -12,0.1910487842929145,-0.7990976891472847,-0.9170751231778567,0.7211491585750245,0.7840706287053596,-0.4455316016020341,-0.26381822731077764,-0.3487559445781614,0.35421728688837884,A -13,0.8835371488089101,0.30837838073400636,0.3764288197101724,0.17726234541250996,-0.3427559189371696,-0.5028957779843914,0.3936751770454463,0.24834986779951707,0.281776736179031,A -14,-0.11182332142106888,-0.46719792116638614,-0.6540867954811456,0.7985565707173228,0.8914160990779798,0.7962924217918101,0.16273208957591456,0.657259185120165,0.4073024579275322,D -15,0.5711869582126345,0.5406490575531178,0.031435391811630575,-0.9773036805505819,0.8514585657857008,0.3584283025293262,0.7959478839608298,0.8963306585117048,0.44468516803316027,A -16,-0.9727600525172746,0.24233982156866274,0.4678844169690879,-0.20917678146571816,-0.16292590796261908,-0.8990527513505742,-0.2930935478104002,0.9876944462530497,0.47849543068945494,C -17,0.6038280170142221,-0.06582223464997417,-0.4675591727611532,0.14531487617290728,0.01644454992371669,0.9715205465257579,-0.010725165298184791,0.7775149649626913,0.28136158103093967,B -18,-0.10776926376059648,-0.1108106381219256,0.30567391234767327,0.011254218913324898,-0.8669148850836634,-0.15379881396552686,0.13669193302481908,0.10165178123069141,0.2809494691187582,D -19,0.9884320455533016,-0.1804968846324253,0.9585057043623681,0.3298875552404499,-0.5876084980995562,-0.7970582716892087,0.22321082010928328,0.3179780628164999,0.1317701920136854,C diff --git a/.ci/test_data/bin_onehot_glm/bob/s_model.tar.gz b/.ci/test_data/bin_onehot_glm/bob/s_model.tar.gz deleted file mode 100644 index aaf545a..0000000 Binary files a/.ci/test_data/bin_onehot_glm/bob/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/bin_onehot_glm/predict.csv b/.ci/test_data/bin_onehot_glm/predict.csv deleted file mode 100644 index b6d9de0..0000000 --- a/.ci/test_data/bin_onehot_glm/predict.csv +++ /dev/null @@ -1,20 +0,0 @@ -id,pred,y -1, 0.39350164,0.0 -2, 0.8956253,1.0 -3, 0.8731979,1.0 -4, 0.96265507,1.0 -5, 0.16241527,0.0 -6, 0.9365009,1.0 -7, 0.8754473,1.0 -8, 0.48002118,0.0 -9, 0.42156637,0.0 -10, 0.714669,1.0 -11, 0.35087457,0.0 -12, 0.92386246,1.0 -13, 0.38156974,0.0 -14, 0.22711706,0.0 -15, 0.8340757,1.0 -16, 0.6390995,1.0 -17, 0.64777297,1.0 -18, 0.10322996,0.0 -19, 0.14100587,0.0 diff --git a/.ci/test_data/bin_onehot_glm_alice_no_feature/alice/alice.csv b/.ci/test_data/bin_onehot_glm_alice_no_feature/alice/alice.csv deleted file mode 100644 index 172cb0b..0000000 --- a/.ci/test_data/bin_onehot_glm_alice_no_feature/alice/alice.csv +++ /dev/null @@ -1,33 +0,0 @@ -id,y -1,1.0 -2,0.0 -3,0.0 -4,1.0 -5,1.0 -6,1.0 -7,0.0 -8,1.0 -9,1.0 -10,0.0 -11,1.0 -12,1.0 -13,0.0 -14,1.0 -15,1.0 -16,0.0 -17,0.0 -18,1.0 -19,1.0 -20,1.0 -21,1.0 -22,0.0 -23,1.0 -24,1.0 -25,1.0 -26,1.0 -27,0.0 -28,0.0 -29,0.0 -30,1.0 -31,1.0 -32,1.0 diff --git a/.ci/test_data/bin_onehot_glm_alice_no_feature/alice/s_model.tar.gz b/.ci/test_data/bin_onehot_glm_alice_no_feature/alice/s_model.tar.gz deleted file mode 100644 index 992cdef..0000000 Binary files a/.ci/test_data/bin_onehot_glm_alice_no_feature/alice/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/bin_onehot_glm_alice_no_feature/bob/bob.csv b/.ci/test_data/bin_onehot_glm_alice_no_feature/bob/bob.csv deleted file mode 100644 index 9dc190f..0000000 --- a/.ci/test_data/bin_onehot_glm_alice_no_feature/bob/bob.csv +++ /dev/null @@ -1,33 +0,0 @@ -id,f1,f2,f3,f4,f5,f6,f7,f8,b1,b2,o1,o2,unused1,unused2 -1,-0.15615636062945915,0.40914367242984695,0.7527352529453377,-0.46634962009491443,-0.8615749630632328,-0.5715263852591228,0.9379925145695025,0.19007021290005532,0.4168724773199035,0.21384345949033967,C,D,0.6044702778742779,0.4570901213054086 -2,-0.9404055611238593,-0.9083512326886756,-0.37064423840304417,0.2819235971596161,0.5212043305144631,-0.73537630254995,0.8527339660162552,0.3504251072081803,0.3517699625436855,0.004834849804169983,D,D,0.7281280567505588,-0.37264537161001754 -3,-0.5627240503927933,-0.5442034486969063,0.3108773305897601,-0.7768956528082471,0.5316688586139755,0.871028481161342,0.6973914688286109,-0.5295922099981376,0.30583888286297506,0.03762193003688352,A,B,0.621498633148778,0.21241770661228654 -4,0.010710576206724776,-0.42122407279578566,-0.20873619787867148,-0.13046949866179003,-0.7432170710004744,0.14208618665056894,-0.667377778792172,-0.7602267721057516,0.49361653181575216,0.4415531966500715,C,B,-0.46638858081105594,0.022846119338956195 -5,-0.9469280606322728,-0.840416046152745,0.829095179481087,-0.09255258734158711,-0.04943524380253739,-0.05465794737641172,-0.02871774909856306,0.780574628258875,0.3269881588553663,0.4519642857799466,C,A,0.5747490182709423,-0.22960913331054567 -6,-0.602324698626703,-0.5344182272779396,-0.0822962948252024,0.9076318550421603,0.0996071869898878,0.5692388485815068,-0.5725054016016367,-0.5075693044227503,0.003911553576078974,0.27279514460276116,B,A,-0.7838087471940858,0.15317608699319907 -7,0.2997688755590464,-0.7979971411805418,-0.4702396670038951,0.7517058807563881,-0.4698867421198818,0.6149939955332868,-0.19791941490109477,0.1890383070668824,0.4085520675577308,0.41729750994300835,D,D,0.7443335658121795,-0.4905549877228361 -8,0.08988296120643335,-0.44405279377981577,-0.5067449846120331,-0.4732218984978185,0.7448660821705149,-0.6191801712762446,-0.8827292000556421,0.23876302066420618,0.14968937609998895,0.291254783244897,C,B,0.7171865026755633,0.4175705676683412 -9,-0.5591187559186066,0.27136888852880037,0.12273626832630158,0.0011722261005966406,-0.15372411959822618,-0.8061383715423533,-0.2420537620461678,-0.16155016932825506,0.33169435748303866,0.07404689278374132,D,B,-0.5551325649086711,-0.9966174435627411 -10,0.17853136775181744,-0.2703356420598315,-0.47451678295412947,-0.6426962389397373,-0.5764035891158359,-0.13789763518724496,0.9706176875594519,0.16734457858244944,0.46946500196355195,0.06372275964106938,D,D,0.6331732111938579,0.8511503309981654 -11,0.6188609133556533,-0.2596380657662347,0.16917198044708104,0.825255678689641,0.07859217755891668,-0.15284275396015845,-0.4695938836556961,0.04556543106391775,0.06714555719668386,0.15412917496506684,D,A,-0.07939353064211585,0.0769039941855838 -12,-0.987002480643878,-0.5809859384570246,0.795645767204954,0.7410371396735338,0.45986213817995236,-0.06595066392665005,0.5681412038971387,0.8694125154728545,0.057714335209551104,0.449490744371295,B,B,-0.38961826532279886,0.438859998289691 -13,0.6116385036656158,-0.4660443559017733,-0.20119898971920547,-0.4031104171027342,-0.5976978732206082,0.4581516989197012,-0.08998326532171341,-0.5914816011529271,0.05351798885470882,0.39806115244402085,D,A,0.5906909983057236,0.48390015567895306 -14,0.3962787899764537,0.873309175424988,-0.5613584816854333,0.2778989897320103,-0.3765674173982101,0.34672909458660306,-0.15398502801967417,0.4323836015788296,0.27661182044240795,0.4303512910004514,B,D,-0.5448090251844593,0.34125700886599897 -15,-0.31949896696401625,0.2960707704931871,0.9950752129902205,0.21794042287634463,0.9902987133217893,0.9683304227319323,0.9146352817193464,-0.522628094768308,0.13617410615740816,0.4494623182632373,A,B,-0.952671130597097,-0.27155705643747163 -16,-0.6890410003764369,0.21826201133397638,0.01905258735292903,-0.6943214629007304,0.299756115278907,-0.8031642576960822,0.9908453789854277,-0.208428306417491,0.30241491351511196,0.10503826916987702,C,D,-0.6137404233445827,-0.8600523777473796 -17,0.9144261444135624,-0.657722703603806,-0.8181811756524122,0.5250216001503025,-0.12379983217099189,-0.19475743579546245,0.11153664681123643,0.34338044591994255,0.35880609356939897,0.12476486961146221,C,C,-0.34347609760458697,0.32847536982254466 -18,-0.32681090977474647,0.45825359590069836,-0.9057672491505309,0.07875806023925147,0.035151682071181245,-0.3213947892100737,0.436816550592652,-0.40000584040247555,0.10179865616372646,0.051396810835892814,A,D,0.7287058840605727,-0.3395999279148072 -19,-0.8145083132397042,-0.6731950124761432,-0.7807017392986817,0.5572529572611165,-0.7579916082634686,0.7233450727055821,-0.6904063494518717,-0.36764560745629193,0.31711897944253986,0.39005812093572134,B,D,0.9337782080967223,-0.37216870988328066 -20,-0.806567246333072,-0.24108911648470444,0.2548920834061801,0.06070734439035497,-0.5506053259368853,-0.5026873321594287,-0.4065843490108716,0.5037289848288042,0.1319919508152047,0.44206735072550446,C,D,-0.4417500145562572,0.696030559012671 -21,0.6949887326949196,0.9790467012731905,0.5841587287259282,-0.998856207744113,-0.32382887570508934,-0.619582183118377,0.9374187299383177,-0.8549137710136854,0.24426592607468828,0.2031886949160584,B,B,0.2829634772152554,0.43950852602790036 -22,0.20745206273378214,0.2799995197081857,-0.15568006640063192,-0.3516878859906538,0.17661743691446663,-0.1027729043337362,0.15836058163251243,-0.08342895476282775,0.4526682455396616,0.3103307550753564,B,D,-0.20064323127987826,-0.39935546357747165 -23,0.6142565465487604,0.11389948754929247,-0.8729445876960857,-0.9610465152283354,-0.539770534806846,-0.15623672033119163,0.08439040274854848,0.9969088817088847,0.4230518566474277,0.07727666916610232,B,D,0.9622993743965202,-0.3814306755826935 -24,0.45946357338763577,0.3692285019797492,-0.23676142698692648,0.8581972325292342,-0.559565231096881,-0.44290971066611906,0.4959511207581282,0.9921928957101889,0.04614923385636671,0.4649405078468372,A,C,0.07243146495744379,-0.1832141827615663 -25,0.07245618290940148,0.6857038403796192,0.9922427604801936,0.7574437556463685,-0.8580138279819349,-0.500387104235799,-0.8856694541850338,-0.853478557800734,0.21178788628186318,0.432302848109982,A,B,0.8784742806494314,-0.19519922588455074 -26,0.9462315279587412,0.5519998230924896,0.058228690198274036,0.6633310587223589,0.2622059145401978,0.8465311985520256,0.16835518891794243,-0.5736913754659192,0.13834011198612584,0.48810301646548143,B,C,-0.7693164962971448,-0.40868959494810597 -27,-0.24293124558329304,-0.5419038560717913,0.9421567552272363,-0.38497174919467714,-0.5421164323776912,-0.11373850989308609,0.005700765839027122,-0.4695991704991973,0.00177284454389115,0.40538585997019844,D,D,0.9408012220444559,-0.7454244018816936 -28,0.104081262546454,-0.9357995121919245,0.7215594044689961,-0.8841496670116249,0.8108400260122559,0.7226982095236612,0.7054397840965707,0.8665187559874181,0.38555961150981355,0.4407081023316622,A,B,-0.6428643676550727,-0.1591073324541834 -29,0.6588093285059897,-0.36909390388183616,-0.9770379561143607,0.7560191984080811,0.719270800507493,0.10065062489969612,-0.6851345441210335,0.7617283473728791,0.3185566886506898,0.012393180949094362,D,C,0.9250686315231109,0.880727341460366 -30,0.2370395047284921,-0.46451824804859454,0.4414436387203893,0.8938988905959881,-0.8582853002226931,-0.8988233409502375,0.9215578065489007,0.7585404849690855,0.1309776312171741,0.36828223587754105,D,D,-0.46906727495406275,0.35463589054546585 -31,0.7234138006215545,-0.5780343128273471,0.36342073805314956,-0.8286930958642424,-0.5239907312620096,0.9985649368254532,-0.8397770695188262,-0.2609458225222321,0.3706154541739654,0.16609273397321433,B,A,-0.7831949055705778,0.8056110914651653 -32,0.15470429051352408,0.8858194286701089,0.07394066081759032,-0.02801907336677245,0.33795555659256116,0.6720551701599038,-0.6283500780385536,-0.6845063352855361,0.27584021056319563,0.4654079430241628,D,C,-0.1308724828707113,0.23102983190276105 diff --git a/.ci/test_data/bin_onehot_glm_alice_no_feature/bob/s_model.tar.gz b/.ci/test_data/bin_onehot_glm_alice_no_feature/bob/s_model.tar.gz deleted file mode 100644 index 29a4de1..0000000 Binary files a/.ci/test_data/bin_onehot_glm_alice_no_feature/bob/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/bin_onehot_glm_alice_no_feature/predict.csv b/.ci/test_data/bin_onehot_glm_alice_no_feature/predict.csv deleted file mode 100644 index 8a813fe..0000000 --- a/.ci/test_data/bin_onehot_glm_alice_no_feature/predict.csv +++ /dev/null @@ -1,33 +0,0 @@ -id,pred,y -1,0.47686505,1.0 -2,0.15938853,0.0 -3,0.26960367,0.0 -4,0.5657716,1.0 -5,0.17707317,1.0 -6,0.2684675,1.0 -7,0.66678095,0.0 -8,0.58304656,1.0 -9,0.28620848,1.0 -10,0.5914989,0.0 -11,0.78440547,1.0 -12,0.16850314,1.0 -13,0.77381754,0.0 -14,0.71611476,1.0 -15,0.39520478,1.0 -16,0.23407295,0.0 -17,0.8454458,0.0 -18,0.36718696,1.0 -19,0.20055518,1.0 -20,0.21610352,1.0 -21,0.81026506,1.0 -22,0.6285284,0.0 -23,0.7671895,1.0 -24,0.7400456,1.0 -25,0.63102967,1.0 -26,0.85630053,1.0 -27,0.41850498,0.0 -28,0.57785815,0.0 -29,0.7754912,0.0 -30,0.6545472,1.0 -31,0.8081137,1.0 -32,0.6049668,1.0 diff --git a/.ci/test_data/phe_sgd_no_feature/alice/alice.csv b/.ci/test_data/fetures_in_one_party/ou_sgd/alice/alice.csv similarity index 100% rename from .ci/test_data/phe_sgd_no_feature/alice/alice.csv rename to .ci/test_data/fetures_in_one_party/ou_sgd/alice/alice.csv diff --git a/.ci/test_data/fetures_in_one_party/ou_sgd/alice/s_model.tar.gz b/.ci/test_data/fetures_in_one_party/ou_sgd/alice/s_model.tar.gz new file mode 100644 index 0000000..4622f5f Binary files /dev/null and b/.ci/test_data/fetures_in_one_party/ou_sgd/alice/s_model.tar.gz differ diff --git a/.ci/test_data/phe_sgd_no_feature/bob/bob.csv b/.ci/test_data/fetures_in_one_party/ou_sgd/bob/bob.csv similarity index 100% rename from .ci/test_data/phe_sgd_no_feature/bob/bob.csv rename to .ci/test_data/fetures_in_one_party/ou_sgd/bob/bob.csv diff --git a/.ci/test_data/fetures_in_one_party/ou_sgd/bob/s_model.tar.gz b/.ci/test_data/fetures_in_one_party/ou_sgd/bob/s_model.tar.gz new file mode 100644 index 0000000..7e988b5 Binary files /dev/null and b/.ci/test_data/fetures_in_one_party/ou_sgd/bob/s_model.tar.gz differ diff --git a/.ci/test_data/fetures_in_one_party/ou_sgd/predict.csv b/.ci/test_data/fetures_in_one_party/ou_sgd/predict.csv new file mode 100644 index 0000000..c5cf4aa --- /dev/null +++ b/.ci/test_data/fetures_in_one_party/ou_sgd/predict.csv @@ -0,0 +1,570 @@ +id,pred,y +0,0.21660909,0.0 +1,0.0,0.0 +2,0.0,0.0 +3,0.6323996,0.0 +4,0.0,0.0 +5,0.8389943,0.0 +6,0.16822252,0.0 +7,0.5839658,0.0 +8,0.62720245,0.0 +9,0.5026109,0.0 +10,0.41644326,0.0 +11,0.40347004,0.0 +12,0.0,0.0 +13,0.19525386,0.0 +14,0.4152152,0.0 +15,0.32760563,0.0 +16,0.57782274,0.0 +17,0.3301423,0.0 +18,0.0,0.0 +19,0.8006081,1.0 +20,0.8802515,1.0 +21,1.0,1.0 +22,0.3725199,0.0 +23,0.0,0.0 +24,0.2801966,0.0 +25,0.14793898,0.0 +26,0.47652704,0.0 +27,0.0,0.0 +28,0.32464293,0.0 +29,0.27933323,0.0 +30,0.0,0.0 +31,0.8406477,0.0 +32,0.14925613,0.0 +33,0.0,0.0 +34,0.42938483,0.0 +35,0.24926268,0.0 +36,0.5144531,0.0 +37,0.81570506,1.0 +38,0.3690849,0.0 +39,0.6446283,0.0 +40,0.7367624,0.0 +41,0.9328729,0.0 +42,0.0,0.0 +43,0.7125588,0.0 +44,0.75309175,0.0 +45,0.012090921,0.0 +46,1.0,1.0 +47,0.72843087,0.0 +48,1.0,1.0 +49,0.6523871,1.0 +50,0.9100728,1.0 +51,0.82466984,1.0 +52,0.9667007,1.0 +53,0.15946265,0.0 +54,0.5216049,0.0 +55,0.98081255,1.0 +56,0.006776437,0.0 +57,0.48783445,0.0 +58,0.872765,1.0 +59,1.0,1.0 +60,1.0,1.0 +61,1.0,1.0 +62,0.3077491,0.0 +63,1.0,1.0 +64,0.65109813,0.0 +65,0.44142276,0.0 +66,1.0,1.0 +67,0.9942961,1.0 +68,0.62191725,1.0 +69,0.91227275,1.0 +70,0.015777767,0.0 +71,1.0,1.0 +72,0.059301153,0.0 +73,0.770056,0.0 +74,0.93542206,1.0 +75,0.32499087,0.0 +76,0.89844817,1.0 +77,0.037195757,0.0 +78,0.0,0.0 +79,0.84312034,1.0 +80,0.927352,1.0 +81,0.7303784,1.0 +82,0.0,0.0 +83,0.0,0.0 +84,0.99464315,1.0 +85,0.11592458,0.0 +86,0.4353947,0.0 +87,0.0,0.0 +88,0.7404691,1.0 +89,0.5425441,1.0 +90,0.5154684,1.0 +91,0.3260623,0.0 +92,0.86923903,1.0 +93,0.76837355,1.0 +94,0.3751915,0.0 +95,0.0,0.0 +96,0.8680921,1.0 +97,1.0,1.0 +98,1.0,1.0 +99,0.5312932,0.0 +100,0.5886281,0.0 +101,1.0,1.0 +102,0.91325045,1.0 +103,1.0,1.0 +104,1.0,1.0 +105,0.74638474,0.0 +106,0.8853694,1.0 +107,0.9393744,1.0 +108,0.0,0.0 +109,0.95157534,1.0 +110,1.0,1.0 +111,0.57891774,1.0 +112,0.25087875,1.0 +113,0.89125955,1.0 +114,1.0,1.0 +115,0.8545306,1.0 +116,0.9594574,1.0 +117,0.567607,0.0 +118,0.25346178,0.0 +119,0.2277064,0.0 +120,1.0,1.0 +121,0.10596123,0.0 +122,0.0,0.0 +123,0.7858208,1.0 +124,0.7486069,1.0 +125,0.8236173,1.0 +126,0.64514977,0.0 +127,0.024444059,0.0 +128,0.41859683,1.0 +129,0.0,0.0 +130,0.99877954,1.0 +131,0.48659068,0.0 +132,0.37518626,0.0 +133,0.5798372,1.0 +134,0.1085992,0.0 +135,0.75897133,0.0 +136,0.95168203,1.0 +137,1.0,1.0 +138,0.33483422,0.0 +139,0.95029455,1.0 +140,1.0,1.0 +141,0.42682695,0.0 +142,0.99628484,1.0 +143,0.89181805,1.0 +144,1.0,1.0 +145,0.89581335,1.0 +146,0.7764392,0.0 +147,0.41465878,1.0 +148,0.6435609,1.0 +149,0.783388,1.0 +150,0.74161804,1.0 +151,1.0,1.0 +152,0.31212747,1.0 +153,1.0,1.0 +154,0.8312742,1.0 +155,0.91861176,1.0 +156,0.027658284,0.0 +157,0.3148362,1.0 +158,1.0,1.0 +159,1.0,1.0 +160,0.8359883,1.0 +161,0.0,0.0 +162,0.0,0.0 +163,0.72999716,1.0 +164,0.0,0.0 +165,0.6287568,1.0 +166,1.0,1.0 +167,0.27790022,0.0 +168,0.01493451,0.0 +169,0.65187025,1.0 +170,0.99774253,1.0 +171,0.75004363,0.0 +172,0.59824103,0.0 +173,1.0,1.0 +174,1.0,1.0 +175,1.0,1.0 +176,0.72678137,1.0 +177,0.20630638,0.0 +178,0.8553167,1.0 +179,1.0,1.0 +180,0.0,0.0 +181,0.0,0.0 +182,0.45392758,0.0 +183,0.894165,1.0 +184,0.5198019,0.0 +185,1.0,1.0 +186,0.25759864,0.0 +187,0.96731174,1.0 +188,1.0,1.0 +189,0.95478755,1.0 +190,0.12775536,0.0 +191,0.66924447,1.0 +192,1.0,1.0 +193,0.5769992,0.0 +194,0.27383235,0.0 +195,0.8749398,1.0 +196,0.4516899,0.0 +197,0.0,0.0 +198,0.0,0.0 +199,0.62926346,0.0 +200,0.8473608,1.0 +201,0.20576769,0.0 +202,0.0,0.0 +203,0.50756556,0.0 +204,0.83369946,1.0 +205,0.61145896,0.0 +206,1.0,1.0 +207,0.3026779,0.0 +208,0.6619073,1.0 +209,0.71840656,1.0 +210,0.0,0.0 +211,0.9492722,1.0 +212,0.0,0.0 +213,0.0,0.0 +214,0.41221112,0.0 +215,0.6386578,0.0 +216,0.74495673,1.0 +217,1.0,1.0 +218,0.0,0.0 +219,0.0,0.0 +220,0.8883132,1.0 +221,0.83373845,1.0 +222,1.0,1.0 +223,0.45182902,0.0 +224,0.830529,1.0 +225,0.73445415,1.0 +226,1.0,1.0 +227,0.58804774,1.0 +228,0.71160734,1.0 +229,0.6009202,0.0 +230,0.27009618,0.0 +231,0.8660725,1.0 +232,0.7570193,1.0 +233,0.0,0.0 +234,1.0,1.0 +235,0.6518687,1.0 +236,0.0,0.0 +237,0.0,0.0 +238,0.42083073,1.0 +239,0.0,0.0 +240,0.797456,1.0 +241,1.0,1.0 +242,0.799597,1.0 +243,0.56362045,1.0 +244,0.0,0.0 +245,1.0,1.0 +246,0.8465305,1.0 +247,0.7295952,1.0 +248,0.95506823,1.0 +249,1.0,1.0 +250,0.0,0.0 +251,0.98575324,1.0 +252,0.0,0.0 +253,0.32209152,0.0 +254,0.012288466,0.0 +255,0.6524028,0.0 +256,0.0,0.0 +257,0.35027143,0.0 +258,0.0,0.0 +259,0.14863202,0.0 +260,0.0,0.0 +261,0.26523668,0.0 +262,0.0,0.0 +263,0.5734111,0.0 +264,0.26299015,0.0 +265,0.0,0.0 +266,0.9297725,1.0 +267,0.6437787,1.0 +268,0.88274044,1.0 +269,0.80461985,1.0 +270,0.8142859,1.0 +271,1.0,1.0 +272,0.0,0.0 +273,1.0,1.0 +274,0.15029931,0.0 +275,0.8541826,1.0 +276,1.0,1.0 +277,0.0735085,0.0 +278,0.8437748,1.0 +279,0.78861344,1.0 +280,0.0,0.0 +281,0.95224863,1.0 +282,0.007838309,0.0 +283,0.34479493,0.0 +284,0.69296443,1.0 +285,0.95204365,1.0 +286,0.6925329,1.0 +287,0.98715997,1.0 +288,0.48303694,1.0 +289,0.96882486,1.0 +290,0.14305492,1.0 +291,0.54761916,1.0 +292,0.83379686,1.0 +293,0.96934897,1.0 +294,0.97958803,1.0 +295,0.8973664,1.0 +296,1.0,1.0 +297,0.917092,0.0 +298,0.7388353,1.0 +299,0.93264675,1.0 +300,0.0,0.0 +301,0.72317743,1.0 +302,0.0,0.0 +303,1.0,1.0 +304,0.96622294,1.0 +305,0.8247633,1.0 +306,0.956022,1.0 +307,1.0,1.0 +308,0.9921616,1.0 +309,0.9966792,1.0 +310,0.97348434,1.0 +311,0.76796854,1.0 +312,0.8963901,1.0 +313,1.0,1.0 +314,1.0,1.0 +315,1.0,1.0 +316,1.0,1.0 +317,0.18632008,0.0 +318,0.84784913,1.0 +319,0.89895105,1.0 +320,0.9945892,1.0 +321,0.0,0.0 +322,0.9251499,1.0 +323,0.0,0.0 +324,1.0,1.0 +325,0.9200885,1.0 +326,0.86702734,1.0 +327,1.0,1.0 +328,0.3261515,0.0 +329,0.24216506,0.0 +330,0.4269916,0.0 +331,0.7230208,1.0 +332,1.0,1.0 +333,1.0,1.0 +334,0.93248785,1.0 +335,0.18286496,0.0 +336,0.90025616,1.0 +337,0.0,0.0 +338,1.0,1.0 +339,0.0,0.0 +340,0.6133934,1.0 +341,1.0,1.0 +342,1.0,1.0 +343,0.0,0.0 +344,1.0,1.0 +345,1.0,1.0 +346,0.9635733,1.0 +347,0.69091016,1.0 +348,1.0,1.0 +349,0.9702805,1.0 +350,1.0,1.0 +351,0.13451588,0.0 +352,0.0,0.0 +353,0.2904255,0.0 +354,0.9791489,1.0 +355,0.63618124,1.0 +356,0.62237024,1.0 +357,0.83369416,1.0 +358,1.0,1.0 +359,1.0,1.0 +360,0.966716,1.0 +361,0.7315908,1.0 +362,0.8243121,1.0 +363,0.41456956,1.0 +364,0.85885096,1.0 +365,0.0,0.0 +366,0.0,0.0 +367,0.93054515,1.0 +368,0.0,0.0 +369,0.0,0.0 +370,0.14592716,0.0 +371,0.6968621,1.0 +372,0.0,0.0 +373,0.0,0.0 +374,0.8248937,1.0 +375,0.47721994,1.0 +376,0.5798346,1.0 +377,0.61119235,1.0 +378,0.7823666,1.0 +379,0.86743915,0.0 +380,1.0,1.0 +381,1.0,1.0 +382,0.6450192,1.0 +383,0.81372833,1.0 +384,0.8768585,1.0 +385,0.4511026,0.0 +386,0.9206737,1.0 +387,0.7994546,1.0 +388,0.7707637,1.0 +389,0.0,0.0 +390,1.0,1.0 +391,1.0,1.0 +392,0.36593187,0.0 +393,0.0,0.0 +394,0.9378779,1.0 +395,0.7443577,1.0 +396,0.68260276,1.0 +397,0.740314,1.0 +398,1.0,1.0 +399,0.9964942,1.0 +400,0.06457093,0.0 +401,1.0,1.0 +402,0.7326878,1.0 +403,0.89974535,1.0 +404,0.9674891,1.0 +405,0.9821342,1.0 +406,0.56151265,1.0 +407,0.62460464,1.0 +408,0.11249027,0.0 +409,0.86406916,1.0 +410,1.0,1.0 +411,1.0,1.0 +412,1.0,1.0 +413,0.44384542,1.0 +414,0.3238837,0.0 +415,0.8334244,1.0 +416,1.0,1.0 +417,0.24563746,0.0 +418,1.0,1.0 +419,0.9920555,1.0 +420,0.92601866,1.0 +421,0.5305182,1.0 +422,0.9542244,1.0 +423,0.64283127,1.0 +424,1.0,1.0 +425,1.0,1.0 +426,1.0,1.0 +427,0.9316605,1.0 +428,1.0,1.0 +429,0.9168018,1.0 +430,0.2017004,0.0 +431,0.7973119,1.0 +432,0.0,0.0 +433,0.0,0.0 +434,0.66362095,1.0 +435,0.6691531,0.0 +436,0.8410911,1.0 +437,0.76623124,1.0 +438,0.7391404,1.0 +439,0.777727,1.0 +440,0.85633075,1.0 +441,0.010561526,0.0 +442,0.845858,1.0 +443,1.0,1.0 +444,0.2741136,0.0 +445,0.68341094,1.0 +446,0.014840856,0.0 +447,0.6633263,1.0 +448,0.6059706,1.0 +449,0.0,0.0 +450,0.65635264,1.0 +451,0.0,0.0 +452,0.6749613,1.0 +453,0.7316772,1.0 +454,0.9291066,1.0 +455,0.516235,1.0 +456,0.6772995,1.0 +457,0.696987,1.0 +458,0.7290749,1.0 +459,0.9785744,1.0 +460,0.075702086,0.0 +461,0.0,0.0 +462,0.5026145,1.0 +463,0.9760802,1.0 +464,0.8168947,1.0 +465,0.53834724,1.0 +466,0.64911497,1.0 +467,1.0,1.0 +468,0.0,0.0 +469,0.8030194,1.0 +470,1.0,1.0 +471,0.67728806,1.0 +472,0.68463326,1.0 +473,0.7595131,1.0 +474,1.0,1.0 +475,0.8832333,1.0 +476,0.5448025,1.0 +477,0.8172115,1.0 +478,1.0,1.0 +479,0.13348766,0.0 +480,0.9535183,1.0 +481,0.74846834,1.0 +482,0.87127894,1.0 +483,0.7823805,1.0 +484,0.6432164,1.0 +485,0.5086724,1.0 +486,0.7084256,1.0 +487,0.0,0.0 +488,0.97740924,1.0 +489,0.41575953,0.0 +490,0.86873,1.0 +491,0.4293021,1.0 +492,0.07227726,0.0 +493,1.0,1.0 +494,0.7789874,1.0 +495,0.54536355,1.0 +496,0.8128639,1.0 +497,0.9227611,1.0 +498,0.07980688,0.0 +499,0.0,0.0 +500,0.6109603,1.0 +501,0.43167993,0.0 +502,0.87238127,1.0 +503,0.0,0.0 +504,1.0,1.0 +505,1.0,1.0 +506,0.824246,1.0 +507,0.9883475,1.0 +508,0.46844536,1.0 +509,0.18028201,0.0 +510,0.887879,1.0 +511,0.7009484,1.0 +512,0.64125574,0.0 +513,0.7378675,1.0 +514,0.56689554,0.0 +515,0.95820034,1.0 +516,0.12353253,0.0 +517,0.0,0.0 +518,0.78030705,1.0 +519,0.8767495,1.0 +520,1.0,1.0 +521,0.0,0.0 +522,1.0,1.0 +523,0.6705352,1.0 +524,1.0,1.0 +525,1.0,1.0 +526,0.7817173,1.0 +527,1.0,1.0 +528,0.57241684,1.0 +529,1.0,1.0 +530,0.9163187,1.0 +531,0.9552901,1.0 +532,0.8627122,1.0 +533,0.0,0.0 +534,0.9420533,1.0 +535,0.0,0.0 +536,0.49836373,0.0 +537,0.6867839,1.0 +538,1.0,1.0 +539,0.9879904,1.0 +540,0.9104216,1.0 +541,0.38041198,1.0 +542,0.4465435,1.0 +543,0.58815694,1.0 +544,0.6547229,1.0 +545,0.63008094,1.0 +546,1.0,1.0 +547,1.0,1.0 +548,1.0,1.0 +549,0.9408915,1.0 +550,1.0,1.0 +551,0.8579605,1.0 +552,0.60820806,1.0 +553,1.0,1.0 +554,0.5858568,1.0 +555,0.76557076,1.0 +556,1.0,1.0 +557,1.0,1.0 +558,0.36241046,1.0 +559,0.7539338,1.0 +560,0.40619636,1.0 +561,0.88791203,1.0 +562,0.08773415,0.0 +563,0.0,0.0 +564,0.0,0.0 +565,0.0,0.0 +566,0.06322645,0.0 +567,0.0,0.0 +568,1.0,1.0 diff --git a/.ci/test_data/bin_sgb_alice_no_feature/alice/alice.csv b/.ci/test_data/fetures_in_one_party/sgb/alice/alice.csv similarity index 100% rename from .ci/test_data/bin_sgb_alice_no_feature/alice/alice.csv rename to .ci/test_data/fetures_in_one_party/sgb/alice/alice.csv diff --git a/.ci/test_data/bin_sgb_alice_no_feature/alice/s_model.tar.gz b/.ci/test_data/fetures_in_one_party/sgb/alice/s_model.tar.gz similarity index 100% rename from .ci/test_data/bin_sgb_alice_no_feature/alice/s_model.tar.gz rename to .ci/test_data/fetures_in_one_party/sgb/alice/s_model.tar.gz diff --git a/.ci/test_data/bin_sgb_alice_no_feature/bob/bob.csv b/.ci/test_data/fetures_in_one_party/sgb/bob/bob.csv similarity index 100% rename from .ci/test_data/bin_sgb_alice_no_feature/bob/bob.csv rename to .ci/test_data/fetures_in_one_party/sgb/bob/bob.csv diff --git a/.ci/test_data/bin_sgb_alice_no_feature/bob/s_model.tar.gz b/.ci/test_data/fetures_in_one_party/sgb/bob/s_model.tar.gz similarity index 100% rename from .ci/test_data/bin_sgb_alice_no_feature/bob/s_model.tar.gz rename to .ci/test_data/fetures_in_one_party/sgb/bob/s_model.tar.gz diff --git a/.ci/test_data/bin_sgb_alice_no_feature/predict.csv b/.ci/test_data/fetures_in_one_party/sgb/predict.csv similarity index 100% rename from .ci/test_data/bin_sgb_alice_no_feature/predict.csv rename to .ci/test_data/fetures_in_one_party/sgb/predict.csv diff --git a/.ci/test_data/sgd_alice_no_feature/alice/alice.csv b/.ci/test_data/fetures_in_one_party/sgd/alice/alice.csv similarity index 100% rename from .ci/test_data/sgd_alice_no_feature/alice/alice.csv rename to .ci/test_data/fetures_in_one_party/sgd/alice/alice.csv diff --git a/.ci/test_data/sgd_alice_no_feature/alice/s_model.tar.gz b/.ci/test_data/fetures_in_one_party/sgd/alice/s_model.tar.gz similarity index 100% rename from .ci/test_data/sgd_alice_no_feature/alice/s_model.tar.gz rename to .ci/test_data/fetures_in_one_party/sgd/alice/s_model.tar.gz diff --git a/.ci/test_data/sgd_alice_no_feature/bob/bob.csv b/.ci/test_data/fetures_in_one_party/sgd/bob/bob.csv similarity index 100% rename from .ci/test_data/sgd_alice_no_feature/bob/bob.csv rename to .ci/test_data/fetures_in_one_party/sgd/bob/bob.csv diff --git a/.ci/test_data/sgd_alice_no_feature/bob/s_model.tar.gz b/.ci/test_data/fetures_in_one_party/sgd/bob/s_model.tar.gz similarity index 100% rename from .ci/test_data/sgd_alice_no_feature/bob/s_model.tar.gz rename to .ci/test_data/fetures_in_one_party/sgd/bob/s_model.tar.gz diff --git a/.ci/test_data/sgd_alice_no_feature/predict.csv b/.ci/test_data/fetures_in_one_party/sgd/predict.csv similarity index 100% rename from .ci/test_data/sgd_alice_no_feature/predict.csv rename to .ci/test_data/fetures_in_one_party/sgd/predict.csv diff --git a/.ci/test_data/xgb_alice_no_feature/alice/alice.csv b/.ci/test_data/fetures_in_one_party/xgb/alice/alice.csv similarity index 100% rename from .ci/test_data/xgb_alice_no_feature/alice/alice.csv rename to .ci/test_data/fetures_in_one_party/xgb/alice/alice.csv diff --git a/.ci/test_data/xgb_alice_no_feature/alice/s_model.tar.gz b/.ci/test_data/fetures_in_one_party/xgb/alice/s_model.tar.gz similarity index 100% rename from .ci/test_data/xgb_alice_no_feature/alice/s_model.tar.gz rename to .ci/test_data/fetures_in_one_party/xgb/alice/s_model.tar.gz diff --git a/.ci/test_data/xgb_alice_no_feature/bob/bob.csv b/.ci/test_data/fetures_in_one_party/xgb/bob/bob.csv similarity index 100% rename from .ci/test_data/xgb_alice_no_feature/bob/bob.csv rename to .ci/test_data/fetures_in_one_party/xgb/bob/bob.csv diff --git a/.ci/test_data/xgb_alice_no_feature/bob/s_model.tar.gz b/.ci/test_data/fetures_in_one_party/xgb/bob/s_model.tar.gz similarity index 100% rename from .ci/test_data/xgb_alice_no_feature/bob/s_model.tar.gz rename to .ci/test_data/fetures_in_one_party/xgb/bob/s_model.tar.gz diff --git a/.ci/test_data/xgb_alice_no_feature/predict.csv b/.ci/test_data/fetures_in_one_party/xgb/predict.csv similarity index 100% rename from .ci/test_data/xgb_alice_no_feature/predict.csv rename to .ci/test_data/fetures_in_one_party/xgb/predict.csv diff --git a/.ci/test_data/phe_glm/alice/alice.csv b/.ci/test_data/glm/alice/alice.csv similarity index 100% rename from .ci/test_data/phe_glm/alice/alice.csv rename to .ci/test_data/glm/alice/alice.csv diff --git a/.ci/test_data/glm/alice/s_model.tar.gz b/.ci/test_data/glm/alice/s_model.tar.gz new file mode 100644 index 0000000..bb29531 Binary files /dev/null and b/.ci/test_data/glm/alice/s_model.tar.gz differ diff --git a/.ci/test_data/phe_glm/bob/bob.csv b/.ci/test_data/glm/bob/bob.csv similarity index 100% rename from .ci/test_data/phe_glm/bob/bob.csv rename to .ci/test_data/glm/bob/bob.csv diff --git a/.ci/test_data/glm/bob/s_model.tar.gz b/.ci/test_data/glm/bob/s_model.tar.gz new file mode 100644 index 0000000..a445664 Binary files /dev/null and b/.ci/test_data/glm/bob/s_model.tar.gz differ diff --git a/.ci/test_data/phe_glm/predict.csv b/.ci/test_data/glm/predict.csv similarity index 85% rename from .ci/test_data/phe_glm/predict.csv rename to .ci/test_data/glm/predict.csv index 7881fea..b6b2206 100644 --- a/.ci/test_data/phe_glm/predict.csv +++ b/.ci/test_data/glm/predict.csv @@ -1,4 +1,4 @@ -id,pred,y,predict_score +id,pred,y,pred_y 0,0.47686505,1.0,516.2334798971686 1,0.16220368,0.0,560.9372970797582 2,0.26960367,0.0,542.3182257710636 @@ -8,7 +8,7 @@ id,pred,y,predict_score 6,0.6727009,0.0,492.7743294058237 7,0.58304656,1.0,503.8869425254623 8,0.29150468,1.0,539.1862235038279 -9,0.5982337,0.0,502.07438558814715 +9,0.5982337,0.0,502.0743855881472 10,0.7883281,1.0,475.62210737259727 11,0.17442402,1.0,558.4174829840767 12,0.7779472,0.0,477.38605063822337 @@ -22,9 +22,9 @@ id,pred,y,predict_score 20,0.8168119,1.0,470.4278724665369 21,0.6409019,0.0,496.84692465294745 22,0.7754037,1.0,477.8091725130769 -23,0.7400456,1.0,483.37432514560277 -24,0.63102967,1.0,498.07737805471197 -25,0.8610095,1.0,460.94058571637396 +23,0.7400456,1.0,483.3743251456028 +24,0.63102967,1.0,498.077378054712 +25,0.8610095,1.0,460.940585716374 26,0.42536157,0.0,522.2407333155013 27,0.57785815,0.0,504.5016875280319 28,0.77958846,0.0,477.111178457454 diff --git a/.ci/test_data/ou_glm/alice/alice.csv b/.ci/test_data/ou_glm/alice/alice.csv new file mode 100644 index 0000000..0dfa098 --- /dev/null +++ b/.ci/test_data/ou_glm/alice/alice.csv @@ -0,0 +1,33 @@ +id,f1,f2,f3,f4,b1,o1,y,unused1 +0,-0.1561563606294591,0.4091436724298469,0.7527352529453377,-0.4663496200949144,0.4168724773199035,C,1.0,0.6044702778742779 +1,-0.9404055611238592,-0.9083512326886756,-0.3706442384030441,0.2819235971596161,0.3517699625436855,D,0.0,0.7281280567505588 +2,-0.5627240503927933,-0.5442034486969063,0.3108773305897601,-0.7768956528082471,0.305838882862975,A,0.0,0.621498633148778 +3,0.0107105762067247,-0.4212240727957856,-0.2087361978786714,-0.13046949866179,0.4936165318157521,C,1.0,-0.4663885808110559 +4,-0.9469280606322728,-0.840416046152745,0.829095179481087,-0.0925525873415871,0.3269881588553663,C,1.0,0.5747490182709423 +5,-0.602324698626703,-0.5344182272779396,-0.0822962948252024,0.9076318550421604,0.0039115535760789,B,1.0,-0.7838087471940858 +6,0.2997688755590464,-0.7979971411805418,-0.4702396670038951,0.7517058807563881,0.4085520675577308,D,0.0,0.7443335658121795 +7,0.0898829612064333,-0.4440527937798157,-0.5067449846120331,-0.4732218984978185,0.1496893760999889,C,1.0,0.7171865026755633 +8,-0.5591187559186066,0.2713688885288003,0.1227362683263015,0.0011722261005966,0.3316943574830386,D,1.0,-0.5551325649086711 +9,0.1785313677518174,-0.2703356420598315,-0.4745167829541294,-0.6426962389397373,0.4694650019635519,D,0.0,0.6331732111938579 +10,0.6188609133556533,-0.2596380657662347,0.169171980447081,0.825255678689641,0.0671455571966838,D,1.0,-0.0793935306421158 +11,-0.987002480643878,-0.5809859384570246,0.795645767204954,0.7410371396735338,0.0577143352095511,B,1.0,-0.3896182653227988 +12,0.6116385036656158,-0.4660443559017733,-0.2011989897192054,-0.4031104171027342,0.0535179888547088,D,0.0,0.5906909983057236 +13,0.3962787899764537,0.873309175424988,-0.5613584816854333,0.2778989897320103,0.2766118204424079,B,1.0,-0.5448090251844593 +14,-0.3194989669640162,0.2960707704931871,0.9950752129902204,0.2179404228763446,0.1361741061574081,A,1.0,-0.952671130597097 +15,-0.6890410003764369,0.2182620113339763,0.019052587352929,-0.6943214629007304,0.3024149135151119,C,0.0,-0.6137404233445827 +16,0.9144261444135624,-0.657722703603806,-0.8181811756524122,0.5250216001503025,0.3588060935693989,C,0.0,-0.3434760976045869 +17,-0.3268109097747464,0.4582535959006983,-0.9057672491505308,0.0787580602392514,0.1017986561637264,A,1.0,0.7287058840605727 +18,-0.8145083132397042,-0.6731950124761432,-0.7807017392986817,0.5572529572611165,0.3171189794425398,B,1.0,0.9337782080967224 +19,-0.806567246333072,-0.2410891164847044,0.2548920834061801,0.0607073443903549,0.1319919508152047,C,1.0,-0.4417500145562572 +20,0.6949887326949196,0.9790467012731904,0.5841587287259282,-0.998856207744113,0.2442659260746882,B,1.0,0.2829634772152554 +21,0.2074520627337821,0.2799995197081857,-0.1556800664006319,-0.3516878859906538,0.4526682455396616,B,0.0,-0.2006432312798782 +22,0.6142565465487604,0.1138994875492924,-0.8729445876960857,-0.9610465152283354,0.4230518566474277,B,1.0,0.9622993743965202 +23,0.4594635733876357,0.3692285019797492,-0.2367614269869264,0.8581972325292342,0.0461492338563667,A,1.0,0.0724314649574437 +24,0.0724561829094014,0.6857038403796192,0.9922427604801936,0.7574437556463685,0.2117878862818631,A,1.0,0.8784742806494314 +25,0.9462315279587412,0.5519998230924896,0.058228690198274,0.6633310587223589,0.1383401119861258,B,1.0,-0.7693164962971448 +26,-0.242931245583293,-0.5419038560717913,0.9421567552272364,-0.3849717491946771,0.0017728445438911,D,0.0,0.940801222044456 +27,0.104081262546454,-0.9357995121919244,0.7215594044689961,-0.8841496670116249,0.3855596115098135,A,0.0,-0.6428643676550727 +28,0.6588093285059897,-0.3690939038818361,-0.9770379561143608,0.7560191984080811,0.3185566886506898,D,0.0,0.9250686315231108 +29,0.2370395047284921,-0.4645182480485945,0.4414436387203893,0.8938988905959881,0.1309776312171741,D,1.0,-0.4690672749540627 +30,0.7234138006215545,-0.5780343128273471,0.3634207380531495,-0.8286930958642424,0.3706154541739654,B,1.0,-0.7831949055705778 +31,0.154704290513524,0.8858194286701089,0.0739406608175903,-0.0280190733667724,0.2758402105631956,D,1.0,-0.1308724828707113 diff --git a/.ci/test_data/ou_glm/alice/s_model.tar.gz b/.ci/test_data/ou_glm/alice/s_model.tar.gz new file mode 100644 index 0000000..d9893dd Binary files /dev/null and b/.ci/test_data/ou_glm/alice/s_model.tar.gz differ diff --git a/.ci/test_data/ou_glm/bob/bob.csv b/.ci/test_data/ou_glm/bob/bob.csv new file mode 100644 index 0000000..9ba5fa4 --- /dev/null +++ b/.ci/test_data/ou_glm/bob/bob.csv @@ -0,0 +1,33 @@ +id,f5,f6,f7,f8,b2,o2,unused2 +0,-0.8615749630632328,-0.5715263852591228,0.9379925145695024,0.1900702129000553,0.2138434594903396,D,0.4570901213054086 +1,0.5212043305144631,-0.73537630254995,0.8527339660162552,0.3504251072081803,0.0048348498041699,D,-0.3726453716100175 +2,0.5316688586139755,0.871028481161342,0.6973914688286109,-0.5295922099981376,0.0376219300368835,B,0.2124177066122865 +3,-0.7432170710004744,0.1420861866505689,-0.667377778792172,-0.7602267721057516,0.4415531966500715,B,0.0228461193389561 +4,-0.0494352438025373,-0.0546579473764117,-0.028717749098563,0.780574628258875,0.4519642857799466,A,-0.2296091333105456 +5,0.0996071869898878,0.5692388485815068,-0.5725054016016367,-0.5075693044227503,0.2727951446027611,A,0.153176086993199 +6,-0.4698867421198818,0.6149939955332868,-0.1979194149010947,0.1890383070668824,0.4172975099430083,D,-0.4905549877228361 +7,0.7448660821705149,-0.6191801712762446,-0.8827292000556421,0.2387630206642061,0.291254783244897,B,0.4175705676683412 +8,-0.1537241195982261,-0.8061383715423533,-0.2420537620461678,-0.161550169328255,0.0740468927837413,B,-0.9966174435627412 +9,-0.5764035891158359,-0.1378976351872449,0.970617687559452,0.1673445785824494,0.0637227596410693,D,0.8511503309981654 +10,0.0785921775589166,-0.1528427539601584,-0.4695938836556961,0.0455654310639177,0.1541291749650668,A,0.0769039941855838 +11,0.4598621381799523,-0.06595066392665,0.5681412038971387,0.8694125154728545,0.449490744371295,B,0.438859998289691 +12,-0.5976978732206082,0.4581516989197012,-0.0899832653217134,-0.5914816011529271,0.3980611524440208,A,0.483900155678953 +13,-0.3765674173982101,0.346729094586603,-0.1539850280196741,0.4323836015788296,0.4303512910004514,D,0.3412570088659989 +14,0.9902987133217892,0.9683304227319324,0.9146352817193464,-0.522628094768308,0.4494623182632373,B,-0.2715570564374716 +15,0.299756115278907,-0.8031642576960822,0.9908453789854276,-0.208428306417491,0.105038269169877,D,-0.8600523777473796 +16,-0.1237998321709918,-0.1947574357954624,0.1115366468112364,0.3433804459199425,0.1247648696114622,C,0.3284753698225446 +17,0.0351516820711812,-0.3213947892100737,0.436816550592652,-0.4000058404024755,0.0513968108358928,D,-0.3395999279148072 +18,-0.7579916082634686,0.7233450727055821,-0.6904063494518717,-0.3676456074562919,0.3900581209357213,D,-0.3721687098832806 +19,-0.5506053259368853,-0.5026873321594287,-0.4065843490108716,0.5037289848288042,0.4420673507255044,D,0.696030559012671 +20,-0.3238288757050893,-0.619582183118377,0.9374187299383177,-0.8549137710136854,0.2031886949160584,B,0.4395085260279003 +21,0.1766174369144666,-0.1027729043337362,0.1583605816325124,-0.0834289547628277,0.3103307550753564,D,-0.3993554635774716 +22,-0.539770534806846,-0.1562367203311916,0.0843904027485484,0.9969088817088848,0.0772766691661023,D,-0.3814306755826935 +23,-0.559565231096881,-0.442909710666119,0.4959511207581282,0.9921928957101888,0.4649405078468372,C,-0.1832141827615663 +24,-0.8580138279819349,-0.500387104235799,-0.8856694541850338,-0.853478557800734,0.432302848109982,B,-0.1951992258845507 +25,0.2622059145401978,0.8465311985520256,0.1683551889179424,-0.5736913754659192,0.4881030164654814,C,-0.4086895949481059 +26,-0.5421164323776912,-0.113738509893086,0.0057007658390271,-0.4695991704991973,0.4053858599701984,D,-0.7454244018816936 +27,0.8108400260122559,0.7226982095236612,0.7054397840965707,0.8665187559874181,0.4407081023316622,B,-0.1591073324541834 +28,0.719270800507493,0.1006506248996961,-0.6851345441210335,0.7617283473728791,0.0123931809490943,C,0.880727341460366 +29,-0.8582853002226931,-0.8988233409502375,0.9215578065489008,0.7585404849690855,0.368282235877541,D,0.3546358905454658 +30,-0.5239907312620096,0.9985649368254532,-0.8397770695188262,-0.2609458225222321,0.1660927339732143,A,0.8056110914651653 +31,0.3379555565925611,0.6720551701599038,-0.6283500780385536,-0.6845063352855361,0.4654079430241628,C,0.231029831902761 diff --git a/.ci/test_data/ou_glm/bob/s_model.tar.gz b/.ci/test_data/ou_glm/bob/s_model.tar.gz new file mode 100644 index 0000000..d9e7b5e Binary files /dev/null and b/.ci/test_data/ou_glm/bob/s_model.tar.gz differ diff --git a/.ci/test_data/ou_glm/predict.csv b/.ci/test_data/ou_glm/predict.csv new file mode 100644 index 0000000..b6b2206 --- /dev/null +++ b/.ci/test_data/ou_glm/predict.csv @@ -0,0 +1,33 @@ +id,pred,y,pred_y +0,0.47686505,1.0,516.2334798971686 +1,0.16220368,0.0,560.9372970797582 +2,0.26960367,0.0,542.3182257710636 +3,0.5657716,1.0,505.9261270108796 +4,0.17707317,1.0,557.889809489704 +5,0.27827334,1.0,541.0604345211162 +6,0.6727009,0.0,492.7743294058237 +7,0.58304656,1.0,503.8869425254623 +8,0.29150468,1.0,539.1862235038279 +9,0.5982337,0.0,502.0743855881472 +10,0.7883281,1.0,475.62210737259727 +11,0.17442402,1.0,558.4174829840767 +12,0.7779472,0.0,477.38605063822337 +13,0.7261041,1.0,485.4304663269026 +14,0.39520478,1.0,525.8383646190198 +15,0.23407295,0.0,547.7664128967078 +16,0.8454458,0.0,464.5294473247045 +17,0.36718696,1.0,529.2667277402132 +18,0.20782131,1.0,552.171084113332 +19,0.21610352,1.0,550.7402489345043 +20,0.8168119,1.0,470.4278724665369 +21,0.6409019,0.0,496.84692465294745 +22,0.7754037,1.0,477.8091725130769 +23,0.7400456,1.0,483.3743251456028 +24,0.63102967,1.0,498.077378054712 +25,0.8610095,1.0,460.940585716374 +26,0.42536157,0.0,522.2407333155013 +27,0.57785815,0.0,504.5016875280319 +28,0.77958846,0.0,477.111178457454 +29,0.66062826,1.0,494.3419931815475 +30,0.8147475,1.0,470.8242355794075 +31,0.6115879,1.0,500.4620059054651 diff --git a/.ci/test_data/phe_sgd/alice/alice.csv b/.ci/test_data/ou_sgd/alice/alice.csv similarity index 100% rename from .ci/test_data/phe_sgd/alice/alice.csv rename to .ci/test_data/ou_sgd/alice/alice.csv diff --git a/.ci/test_data/ou_sgd/alice/s_model.tar.gz b/.ci/test_data/ou_sgd/alice/s_model.tar.gz new file mode 100644 index 0000000..e03403e Binary files /dev/null and b/.ci/test_data/ou_sgd/alice/s_model.tar.gz differ diff --git a/.ci/test_data/phe_sgd/bob/bob.csv b/.ci/test_data/ou_sgd/bob/bob.csv similarity index 100% rename from .ci/test_data/phe_sgd/bob/bob.csv rename to .ci/test_data/ou_sgd/bob/bob.csv diff --git a/.ci/test_data/ou_sgd/bob/s_model.tar.gz b/.ci/test_data/ou_sgd/bob/s_model.tar.gz new file mode 100644 index 0000000..49e0cf5 Binary files /dev/null and b/.ci/test_data/ou_sgd/bob/s_model.tar.gz differ diff --git a/.ci/test_data/ou_sgd/predict.csv b/.ci/test_data/ou_sgd/predict.csv new file mode 100644 index 0000000..086d0d6 --- /dev/null +++ b/.ci/test_data/ou_sgd/predict.csv @@ -0,0 +1,570 @@ +id,pred,y +0,0.21660912,0.0 +1,0.0,0.0 +2,0.0,0.0 +3,0.6323997,0.0 +4,0.0,0.0 +5,0.8389943,0.0 +6,0.16822255,0.0 +7,0.5839658,0.0 +8,0.62720245,0.0 +9,0.5026108,0.0 +10,0.41644326,0.0 +11,0.40347004,0.0 +12,0.0,0.0 +13,0.1952539,0.0 +14,0.4152152,0.0 +15,0.3276056,0.0 +16,0.57782274,0.0 +17,0.33014232,0.0 +18,0.0,0.0 +19,0.8006081,1.0 +20,0.8802515,1.0 +21,1.0,1.0 +22,0.37251997,0.0 +23,0.0,0.0 +24,0.2801966,0.0 +25,0.14793901,0.0 +26,0.476527,0.0 +27,0.0,0.0 +28,0.3246429,0.0 +29,0.27933326,0.0 +30,0.0,0.0 +31,0.8406477,0.0 +32,0.14925613,0.0 +33,0.0,0.0 +34,0.42938483,0.0 +35,0.24926269,0.0 +36,0.5144531,0.0 +37,0.81570506,1.0 +38,0.3690849,0.0 +39,0.6446282,0.0 +40,0.7367624,0.0 +41,0.9328729,0.0 +42,0.0,0.0 +43,0.7125588,0.0 +44,0.75309175,0.0 +45,0.012090951,0.0 +46,1.0,1.0 +47,0.72843087,0.0 +48,1.0,1.0 +49,0.6523871,1.0 +50,0.9100728,1.0 +51,0.82466984,1.0 +52,0.9667007,1.0 +53,0.15946268,0.0 +54,0.5216049,0.0 +55,0.9808126,1.0 +56,0.006776482,0.0 +57,0.48783442,0.0 +58,0.872765,1.0 +59,1.0,1.0 +60,1.0,1.0 +61,1.0,1.0 +62,0.30774903,0.0 +63,1.0,1.0 +64,0.65109813,0.0 +65,0.44142276,0.0 +66,1.0,1.0 +67,0.9942961,1.0 +68,0.62191725,1.0 +69,0.91227275,1.0 +70,0.015777797,0.0 +71,1.0,1.0 +72,0.059301123,0.0 +73,0.770056,0.0 +74,0.93542206,1.0 +75,0.3249909,0.0 +76,0.89844817,1.0 +77,0.037195772,0.0 +78,0.0,0.0 +79,0.84312034,1.0 +80,0.927352,1.0 +81,0.7303784,1.0 +82,0.0,0.0 +83,0.0,0.0 +84,0.9946431,1.0 +85,0.11592461,0.0 +86,0.4353947,0.0 +87,0.0,0.0 +88,0.7404691,1.0 +89,0.5425441,1.0 +90,0.5154684,1.0 +91,0.32606232,0.0 +92,0.86923903,1.0 +93,0.76837355,1.0 +94,0.3751915,0.0 +95,0.0,0.0 +96,0.8680921,1.0 +97,1.0,1.0 +98,1.0,1.0 +99,0.5312932,0.0 +100,0.5886281,0.0 +101,1.0,1.0 +102,0.91325045,1.0 +103,1.0,1.0 +104,1.0,1.0 +105,0.74638474,0.0 +106,0.8853694,1.0 +107,0.9393743,1.0 +108,0.0,0.0 +109,0.95157534,1.0 +110,1.0,1.0 +111,0.57891774,1.0 +112,0.2508787,1.0 +113,0.8912595,1.0 +114,1.0,1.0 +115,0.8545306,1.0 +116,0.9594574,1.0 +117,0.567607,0.0 +118,0.25346172,0.0 +119,0.22770648,0.0 +120,1.0,1.0 +121,0.10596128,0.0 +122,0.0,0.0 +123,0.7858208,1.0 +124,0.74860686,1.0 +125,0.8236173,1.0 +126,0.64514977,0.0 +127,0.024444073,0.0 +128,0.41859686,1.0 +129,0.0,0.0 +130,0.9987796,1.0 +131,0.48659068,0.0 +132,0.37518626,0.0 +133,0.5798372,1.0 +134,0.108599216,0.0 +135,0.75897133,0.0 +136,0.95168203,1.0 +137,1.0,1.0 +138,0.33483428,0.0 +139,0.95029455,1.0 +140,1.0,1.0 +141,0.42682698,0.0 +142,0.99628484,1.0 +143,0.8918181,1.0 +144,1.0,1.0 +145,0.89581335,1.0 +146,0.77643925,0.0 +147,0.41465878,1.0 +148,0.6435609,1.0 +149,0.783388,1.0 +150,0.74161804,1.0 +151,1.0,1.0 +152,0.31212744,1.0 +153,1.0,1.0 +154,0.8312742,1.0 +155,0.91861176,1.0 +156,0.027658284,0.0 +157,0.3148362,1.0 +158,1.0,1.0 +159,1.0,1.0 +160,0.8359883,1.0 +161,0.0,0.0 +162,0.0,0.0 +163,0.7299971,1.0 +164,0.0,0.0 +165,0.6287568,1.0 +166,1.0,1.0 +167,0.27790022,0.0 +168,0.014934495,0.0 +169,0.65187025,1.0 +170,0.99774253,1.0 +171,0.75004363,0.0 +172,0.5982411,0.0 +173,1.0,1.0 +174,1.0,1.0 +175,1.0,1.0 +176,0.7267813,1.0 +177,0.20630638,0.0 +178,0.8553167,1.0 +179,1.0,1.0 +180,0.0,0.0 +181,0.0,0.0 +182,0.45392758,0.0 +183,0.8941649,1.0 +184,0.5198019,0.0 +185,1.0,1.0 +186,0.25759867,0.0 +187,0.96731174,1.0 +188,1.0,1.0 +189,0.95478755,1.0 +190,0.1277553,0.0 +191,0.66924447,1.0 +192,1.0,1.0 +193,0.5769992,0.0 +194,0.27383232,0.0 +195,0.8749398,1.0 +196,0.45168993,0.0 +197,0.0,0.0 +198,0.0,0.0 +199,0.62926346,0.0 +200,0.8473608,1.0 +201,0.2057677,0.0 +202,0.0,0.0 +203,0.5075655,0.0 +204,0.83369946,1.0 +205,0.61145896,0.0 +206,1.0,1.0 +207,0.30267793,0.0 +208,0.6619073,1.0 +209,0.71840656,1.0 +210,0.0,0.0 +211,0.9492722,1.0 +212,0.0,0.0 +213,0.0,0.0 +214,0.41221115,0.0 +215,0.6386578,0.0 +216,0.74495673,1.0 +217,1.0,1.0 +218,0.0,0.0 +219,0.0,0.0 +220,0.8883132,1.0 +221,0.83373845,1.0 +222,1.0,1.0 +223,0.45182902,0.0 +224,0.830529,1.0 +225,0.73445415,1.0 +226,1.0,1.0 +227,0.58804774,1.0 +228,0.71160734,1.0 +229,0.6009202,0.0 +230,0.27009618,0.0 +231,0.8660725,1.0 +232,0.7570193,1.0 +233,0.0,0.0 +234,1.0,1.0 +235,0.6518687,1.0 +236,0.0,0.0 +237,0.0,0.0 +238,0.4208307,1.0 +239,0.0,0.0 +240,0.797456,1.0 +241,1.0,1.0 +242,0.79959697,1.0 +243,0.56362045,1.0 +244,0.0,0.0 +245,1.0,1.0 +246,0.8465305,1.0 +247,0.72959507,1.0 +248,0.95506823,1.0 +249,1.0,1.0 +250,0.0,0.0 +251,0.98575324,1.0 +252,0.0,0.0 +253,0.32209152,0.0 +254,0.012288481,0.0 +255,0.6524028,0.0 +256,0.0,0.0 +257,0.35027143,0.0 +258,0.0,0.0 +259,0.14863199,0.0 +260,0.0,0.0 +261,0.26523668,0.0 +262,0.0,0.0 +263,0.5734111,0.0 +264,0.26299018,0.0 +265,0.0,0.0 +266,0.9297725,1.0 +267,0.6437787,1.0 +268,0.88274044,1.0 +269,0.8046198,1.0 +270,0.8142859,1.0 +271,1.0,1.0 +272,0.0,0.0 +273,1.0,1.0 +274,0.15029933,0.0 +275,0.8541826,1.0 +276,1.0,1.0 +277,0.073508546,0.0 +278,0.8437748,1.0 +279,0.78861344,1.0 +280,0.0,0.0 +281,0.9522487,1.0 +282,0.007838339,0.0 +283,0.34479493,0.0 +284,0.69296443,1.0 +285,0.95204365,1.0 +286,0.69253284,1.0 +287,0.98715997,1.0 +288,0.48303697,1.0 +289,0.96882486,1.0 +290,0.14305492,1.0 +291,0.5476192,1.0 +292,0.8337969,1.0 +293,0.96934897,1.0 +294,0.97958803,1.0 +295,0.8973664,1.0 +296,1.0,1.0 +297,0.917092,0.0 +298,0.7388353,1.0 +299,0.93264675,1.0 +300,0.0,0.0 +301,0.72317743,1.0 +302,0.0,0.0 +303,1.0,1.0 +304,0.96622294,1.0 +305,0.8247633,1.0 +306,0.956022,1.0 +307,1.0,1.0 +308,0.9921616,1.0 +309,0.9966792,1.0 +310,0.9734844,1.0 +311,0.76796854,1.0 +312,0.8963901,1.0 +313,1.0,1.0 +314,1.0,1.0 +315,1.0,1.0 +316,1.0,1.0 +317,0.1863201,0.0 +318,0.84784913,1.0 +319,0.8989512,1.0 +320,0.9945892,1.0 +321,0.0,0.0 +322,0.9251499,1.0 +323,0.0,0.0 +324,1.0,1.0 +325,0.9200885,1.0 +326,0.8670274,1.0 +327,1.0,1.0 +328,0.3261515,0.0 +329,0.24216509,0.0 +330,0.4269916,0.0 +331,0.72302073,1.0 +332,1.0,1.0 +333,1.0,1.0 +334,0.93248785,1.0 +335,0.18286501,0.0 +336,0.90025616,1.0 +337,0.0,0.0 +338,1.0,1.0 +339,0.0,0.0 +340,0.6133934,1.0 +341,1.0,1.0 +342,1.0,1.0 +343,0.0,0.0 +344,1.0,1.0 +345,1.0,1.0 +346,0.9635733,1.0 +347,0.6909102,1.0 +348,1.0,1.0 +349,0.9702805,1.0 +350,1.0,1.0 +351,0.13451594,0.0 +352,0.0,0.0 +353,0.2904255,0.0 +354,0.979149,1.0 +355,0.63618124,1.0 +356,0.62237024,1.0 +357,0.83369416,1.0 +358,1.0,1.0 +359,1.0,1.0 +360,0.966716,1.0 +361,0.7315908,1.0 +362,0.8243121,1.0 +363,0.4145696,1.0 +364,0.8588509,1.0 +365,0.0,0.0 +366,0.0,0.0 +367,0.93054515,1.0 +368,0.0,0.0 +369,0.0,0.0 +370,0.14592718,0.0 +371,0.69686216,1.0 +372,0.0,0.0 +373,0.0,0.0 +374,0.8248937,1.0 +375,0.47721997,1.0 +376,0.5798345,1.0 +377,0.61119235,1.0 +378,0.7823666,1.0 +379,0.86743915,0.0 +380,1.0,1.0 +381,1.0,1.0 +382,0.6450192,1.0 +383,0.8137283,1.0 +384,0.8768585,1.0 +385,0.45110267,0.0 +386,0.9206737,1.0 +387,0.7994546,1.0 +388,0.77076364,1.0 +389,0.0,0.0 +390,1.0,1.0 +391,1.0,1.0 +392,0.36593187,0.0 +393,0.0,0.0 +394,0.9378779,1.0 +395,0.7443577,1.0 +396,0.68260276,1.0 +397,0.740314,1.0 +398,1.0,1.0 +399,0.9964942,1.0 +400,0.06457092,0.0 +401,1.0,1.0 +402,0.7326878,1.0 +403,0.89974535,1.0 +404,0.9674891,1.0 +405,0.9821342,1.0 +406,0.56151265,1.0 +407,0.6246046,1.0 +408,0.11249028,0.0 +409,0.86406916,1.0 +410,1.0,1.0 +411,1.0,1.0 +412,1.0,1.0 +413,0.4438454,1.0 +414,0.3238837,0.0 +415,0.8334244,1.0 +416,1.0,1.0 +417,0.24563746,0.0 +418,1.0,1.0 +419,0.9920555,1.0 +420,0.9260186,1.0 +421,0.5305182,1.0 +422,0.9542244,1.0 +423,0.6428312,1.0 +424,1.0,1.0 +425,1.0,1.0 +426,1.0,1.0 +427,0.9316605,1.0 +428,1.0,1.0 +429,0.9168018,1.0 +430,0.20170037,0.0 +431,0.79731184,1.0 +432,0.0,0.0 +433,0.0,0.0 +434,0.66362095,1.0 +435,0.6691531,0.0 +436,0.84109116,1.0 +437,0.7662313,1.0 +438,0.7391404,1.0 +439,0.77772707,1.0 +440,0.8563307,1.0 +441,0.010561511,0.0 +442,0.845858,1.0 +443,1.0,1.0 +444,0.27411363,0.0 +445,0.68341094,1.0 +446,0.014840856,0.0 +447,0.6633263,1.0 +448,0.6059706,1.0 +449,0.0,0.0 +450,0.6563526,1.0 +451,0.0,0.0 +452,0.67496127,1.0 +453,0.7316772,1.0 +454,0.92910665,1.0 +455,0.51623493,1.0 +456,0.6772995,1.0 +457,0.6969869,1.0 +458,0.7290749,1.0 +459,0.9785744,1.0 +460,0.0757021,0.0 +461,0.0,0.0 +462,0.5026145,1.0 +463,0.9760802,1.0 +464,0.8168947,1.0 +465,0.5383472,1.0 +466,0.6491149,1.0 +467,1.0,1.0 +468,0.0,0.0 +469,0.8030194,1.0 +470,1.0,1.0 +471,0.67728806,1.0 +472,0.68463326,1.0 +473,0.759513,1.0 +474,1.0,1.0 +475,0.8832333,1.0 +476,0.5448025,1.0 +477,0.8172115,1.0 +478,1.0,1.0 +479,0.13348767,0.0 +480,0.9535183,1.0 +481,0.74846834,1.0 +482,0.87127894,1.0 +483,0.7823805,1.0 +484,0.6432164,1.0 +485,0.5086724,1.0 +486,0.7084256,1.0 +487,0.0,0.0 +488,0.97740924,1.0 +489,0.41575953,0.0 +490,0.86873,1.0 +491,0.42930213,1.0 +492,0.07227731,0.0 +493,1.0,1.0 +494,0.7789874,1.0 +495,0.54536355,1.0 +496,0.8128639,1.0 +497,0.9227611,1.0 +498,0.079806894,0.0 +499,0.0,0.0 +500,0.6109603,1.0 +501,0.43167993,0.0 +502,0.8723813,1.0 +503,0.0,0.0 +504,1.0,1.0 +505,1.0,1.0 +506,0.8242459,1.0 +507,0.9883475,1.0 +508,0.4684454,1.0 +509,0.180282,0.0 +510,0.887879,1.0 +511,0.7009485,1.0 +512,0.64125574,0.0 +513,0.7378675,1.0 +514,0.56689554,0.0 +515,0.95820034,1.0 +516,0.12353255,0.0 +517,0.0,0.0 +518,0.78030705,1.0 +519,0.8767495,1.0 +520,1.0,1.0 +521,0.0,0.0 +522,1.0,1.0 +523,0.6705352,1.0 +524,1.0,1.0 +525,1.0,1.0 +526,0.7817173,1.0 +527,1.0,1.0 +528,0.5724169,1.0 +529,1.0,1.0 +530,0.9163187,1.0 +531,0.95529,1.0 +532,0.8627122,1.0 +533,0.0,0.0 +534,0.94205326,1.0 +535,0.0,0.0 +536,0.49836373,0.0 +537,0.68678385,1.0 +538,1.0,1.0 +539,0.9879903,1.0 +540,0.91042155,1.0 +541,0.38041198,1.0 +542,0.44654354,1.0 +543,0.58815694,1.0 +544,0.6547229,1.0 +545,0.63008094,1.0 +546,1.0,1.0 +547,1.0,1.0 +548,1.0,1.0 +549,0.94089144,1.0 +550,1.0,1.0 +551,0.85796046,1.0 +552,0.60820806,1.0 +553,1.0,1.0 +554,0.5858568,1.0 +555,0.76557076,1.0 +556,1.0,1.0 +557,1.0,1.0 +558,0.36241043,1.0 +559,0.7539338,1.0 +560,0.4061964,1.0 +561,0.88791203,1.0 +562,0.08773412,0.0 +563,0.0,0.0 +564,0.0,0.0 +565,0.0,0.0 +566,0.06322643,0.0 +567,0.0,0.0 +568,1.0,1.0 diff --git a/.ci/test_data/phe_glm/alice/s_model.tar.gz b/.ci/test_data/phe_glm/alice/s_model.tar.gz deleted file mode 100644 index 6103d4d..0000000 Binary files a/.ci/test_data/phe_glm/alice/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/phe_glm/bob/s_model.tar.gz b/.ci/test_data/phe_glm/bob/s_model.tar.gz deleted file mode 100644 index 783dd86..0000000 Binary files a/.ci/test_data/phe_glm/bob/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/phe_sgd/alice/s_model.tar.gz b/.ci/test_data/phe_sgd/alice/s_model.tar.gz deleted file mode 100644 index 1949ed8..0000000 Binary files a/.ci/test_data/phe_sgd/alice/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/phe_sgd/bob/s_model.tar.gz b/.ci/test_data/phe_sgd/bob/s_model.tar.gz deleted file mode 100644 index d2340a9..0000000 Binary files a/.ci/test_data/phe_sgd/bob/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/phe_sgd/predict.csv b/.ci/test_data/phe_sgd/predict.csv deleted file mode 100644 index a6b94c4..0000000 --- a/.ci/test_data/phe_sgd/predict.csv +++ /dev/null @@ -1,33 +0,0 @@ -id,pred,y -0,0.36531496,0.0 -1,0.36864355,0.0 -2,0.3082614,0.0 -3,0.40345556,0.0 -4,0.333171,0.0 -5,0.5010476,0.0 -6,0.41521746,0.0 -7,0.466192,0.0 -8,0.46786073,0.0 -9,0.40951777,0.0 -10,0.46939817,0.0 -11,0.425126,0.0 -12,0.15717828,0.0 -13,0.37976164,0.0 -14,0.4048596,0.0 -15,0.416929,0.0 -16,0.48516732,0.0 -17,0.42658806,0.0 -18,0.3497193,0.0 -19,0.50896066,1.0 -20,0.5335696,1.0 -21,0.58377063,1.0 -22,0.37492034,0.0 -23,0.3530418,0.0 -24,0.42830193,0.0 -25,0.3619516,0.0 -26,0.44949424,0.0 -27,0.34697467,0.0 -28,0.42690903,0.0 -29,0.4074396,0.0 -30,0.3484857,0.0 -31,0.50262034,0.0 diff --git a/.ci/test_data/phe_sgd_no_feature/alice/s_model.tar.gz b/.ci/test_data/phe_sgd_no_feature/alice/s_model.tar.gz deleted file mode 100644 index cade321..0000000 Binary files a/.ci/test_data/phe_sgd_no_feature/alice/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/phe_sgd_no_feature/bob/s_model.tar.gz b/.ci/test_data/phe_sgd_no_feature/bob/s_model.tar.gz deleted file mode 100644 index a82a514..0000000 Binary files a/.ci/test_data/phe_sgd_no_feature/bob/s_model.tar.gz and /dev/null differ diff --git a/.ci/test_data/phe_sgd_no_feature/predict.csv b/.ci/test_data/phe_sgd_no_feature/predict.csv deleted file mode 100644 index 52617ed..0000000 --- a/.ci/test_data/phe_sgd_no_feature/predict.csv +++ /dev/null @@ -1,33 +0,0 @@ -id,pred,y -0,0.36531496,0.0 -1,0.36864352,0.0 -2,0.3082614,0.0 -3,0.4034556,0.0 -4,0.33317098,0.0 -5,0.50104755,0.0 -6,0.41521746,0.0 -7,0.466192,0.0 -8,0.46786073,0.0 -9,0.40951777,0.0 -10,0.46939817,0.0 -11,0.425126,0.0 -12,0.1571783,0.0 -13,0.37976164,0.0 -14,0.4048596,0.0 -15,0.416929,0.0 -16,0.4851673,0.0 -17,0.42658806,0.0 -18,0.34971926,0.0 -19,0.50896066,1.0 -20,0.5335696,1.0 -21,0.58377063,1.0 -22,0.37492037,0.0 -23,0.3530418,0.0 -24,0.42830193,0.0 -25,0.36195156,0.0 -26,0.44949424,0.0 -27,0.34697467,0.0 -28,0.42690903,0.0 -29,0.4074396,0.0 -30,0.3484857,0.0 -31,0.5026204,0.0 diff --git a/.ci/test_data/bin_sgb/alice/alice.csv b/.ci/test_data/sgb/alice/alice.csv similarity index 100% rename from .ci/test_data/bin_sgb/alice/alice.csv rename to .ci/test_data/sgb/alice/alice.csv diff --git a/.ci/test_data/bin_sgb/alice/s_model.tar.gz b/.ci/test_data/sgb/alice/s_model.tar.gz similarity index 100% rename from .ci/test_data/bin_sgb/alice/s_model.tar.gz rename to .ci/test_data/sgb/alice/s_model.tar.gz diff --git a/.ci/test_data/bin_sgb/bob/bob.csv b/.ci/test_data/sgb/bob/bob.csv similarity index 100% rename from .ci/test_data/bin_sgb/bob/bob.csv rename to .ci/test_data/sgb/bob/bob.csv diff --git a/.ci/test_data/bin_sgb/bob/s_model.tar.gz b/.ci/test_data/sgb/bob/s_model.tar.gz similarity index 100% rename from .ci/test_data/bin_sgb/bob/s_model.tar.gz rename to .ci/test_data/sgb/bob/s_model.tar.gz diff --git a/.ci/test_data/bin_sgb/predict.csv b/.ci/test_data/sgb/predict.csv similarity index 100% rename from .ci/test_data/bin_sgb/predict.csv rename to .ci/test_data/sgb/predict.csv diff --git a/CHANGELOG.md b/CHANGELOG.md index c164211..59a9126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ > please add your unreleased change here. +- [Infra] Bump heu version to 0.6.0. Note that he model packages generated by secretflow < 1.11 (heu <= 5.1.0b0) are no longer supported. + ## 20241023 - 0.7.0b0 - [Feature] support phe linear model predict diff --git a/WORKSPACE b/WORKSPACE index 4efd167..5aeabba 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -47,6 +47,10 @@ rules_foreign_cc_dependencies( register_preinstalled_tools = True, ) +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + # # boost # diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index b8b5424..71d68ab 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -53,10 +53,10 @@ def _heu(): http_archive, name = "com_alipay_sf_heu", urls = [ - "https://github.com/secretflow/heu/archive/refs/tags/v0.5.1b0.tar.gz", + "https://github.com/secretflow/heu/archive/refs/tags/0.6.0.dev20241106.tar.gz", ], - strip_prefix = "heu-0.5.1b0", - sha256 = "26e81b55b2d4f734977f8d5e1ba672c20287f2971dcb5d7f3fa46295e2882012", + strip_prefix = "heu-0.6.0.dev20241106", + sha256 = "498a73bace6c85bf8c2f2663101d71584bec62eb213acdebc04dbbe11a4460cc", ) def _bazel_rules_pkg(): diff --git a/docs/locales/zh_CN/LC_MESSAGES/topics/deployment/deployment.po b/docs/locales/zh_CN/LC_MESSAGES/topics/deployment/deployment.po index 682c06e..0dc9c9f 100644 --- a/docs/locales/zh_CN/LC_MESSAGES/topics/deployment/deployment.po +++ b/docs/locales/zh_CN/LC_MESSAGES/topics/deployment/deployment.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: SecretFlow-Serving \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-14 11:33+0800\n" +"POT-Creation-Date: 2024-11-15 19:42+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -128,11 +128,11 @@ msgid "" "following code in:" msgstr "在您的工作空间目录下创建一个名为 ``serving.config`` 的文件,并将下面的内容添加到其的内容中:" -#: ../../source/topics/deployment/deployment.rst:95 +#: ../../source/topics/deployment/deployment.rst:98 msgid "See :ref:`Serving Config ` for more config information" msgstr "请参考 :ref:`Serving Config ` 来获取更多信息。" -#: ../../source/topics/deployment/deployment.rst:99 +#: ../../source/topics/deployment/deployment.rst:102 msgid "" "The above configuration is referenced from `alice-serving-config " "`_." @@ -140,7 +140,7 @@ msgstr "" "以上配置内容参考自 `alice-serving-config " "`_。" -#: ../../source/topics/deployment/deployment.rst:100 +#: ../../source/topics/deployment/deployment.rst:103 msgid "" "For ``Bob``, you should refer to `bob-serving-config " "`_" @@ -149,7 +149,7 @@ msgstr "" "对于 ``Bob`` ,可以参考 `bob-serving-config " "`_。" -#: ../../source/topics/deployment/deployment.rst:101 +#: ../../source/topics/deployment/deployment.rst:104 msgid "" "**Note** `mockOpts` is configured here for a mock feature data source, " "which will provide simulated feature data to support the model prediction" @@ -160,16 +160,16 @@ msgstr "" "**注意** `mockOpts` 在这里是表示配置了仿真特征数据源来支持模型预测。在实际使用中,推荐通过实现 :ref:`SecretFlow-" "Serving Feature Service SPI ` 来提供特征数据。" -#: ../../source/topics/deployment/deployment.rst:102 +#: ../../source/topics/deployment/deployment.rst:105 msgid "" "**Note** You can modify the retry strategy for communication between " -"parties by modifying `retry_policy_config` field of :ref:`channel_desc " +"parties by modifying `retry_policy_config` field of :ref:`channelDesc " "`, you can refer to :ref:`here `." msgstr "" -"**注意** 你可以通过修改 :ref:`channel_desc ` 的 `retry_policy_config` " +"**注意** 你可以通过修改 :ref:`channelDesc ` 的 `retry_policy_config` " "字段来修改 `party` 间通信的重试策略,可以参考 :ref:`这里 ` 。 " -#: ../../source/topics/deployment/deployment.rst:103 +#: ../../source/topics/deployment/deployment.rst:106 msgid "" "**Note** If your :ref:`feature source ` is from " ":ref:`http `, you can modify the retry strategy of feature " @@ -180,23 +180,23 @@ msgstr "" "` 获取的, 你可以修改 :ref:`http_opts ` 的 " "`retry_policy_config` 字段来修改特征获取的重试策略,参考 :ref:`这里 ` 。" -#: ../../source/topics/deployment/deployment.rst:108 +#: ../../source/topics/deployment/deployment.rst:111 msgid "1.3 Create logging config file" msgstr "1.3 创建 logging 配置文件" -#: ../../source/topics/deployment/deployment.rst:110 +#: ../../source/topics/deployment/deployment.rst:113 msgid "" "Create a file called ``logging.config`` in your workspace and paste the " "following code in:" msgstr "在您的工作空间目录下创建一个名为 ``logging.config`` 的文件,并将下面的内容添加到其的内容中:" -#: ../../source/topics/deployment/deployment.rst:121 +#: ../../source/topics/deployment/deployment.rst:124 msgid "" "See :ref:`Logging Config ` for more logging config " "information." msgstr "请参考 :ref:`Logging Config ` 获得更多关于 logging 配置的信息。" -#: ../../source/topics/deployment/deployment.rst:125 +#: ../../source/topics/deployment/deployment.rst:128 msgid "" "The above configuration is referenced from `alice-logging-config " "`_." @@ -204,7 +204,7 @@ msgstr "" "以上配置内容参考自 `alice-logging-config " "`_。" -#: ../../source/topics/deployment/deployment.rst:127 +#: ../../source/topics/deployment/deployment.rst:130 msgid "" "For ``Bob``, you should refer to `bob-logging-config " "`_" @@ -213,11 +213,11 @@ msgstr "" "对于 ``Bob`` ,可以参考 `bob-logging-config " "`_。" -#: ../../source/topics/deployment/deployment.rst:132 +#: ../../source/topics/deployment/deployment.rst:135 msgid "1.4 Create trace config file" msgstr "1.4 创建 trace 配置文件" -#: ../../source/topics/deployment/deployment.rst:134 +#: ../../source/topics/deployment/deployment.rst:137 msgid "" "This configuration is optional, and **may cause some performance " "degradation**, please use it with caution. To record trace info, you can " @@ -227,7 +227,7 @@ msgstr "" "该配置是可选的,如果打开该配置,可能会 **造成一些性能下降** ,请谨慎使用。要记录trace信息,你可以创建 ``trace.config``" " 文件,将如下代码粘贴到新创建的文件里:" -#: ../../source/topics/deployment/deployment.rst:146 +#: ../../source/topics/deployment/deployment.rst:149 msgid "" "See :ref:`Trace Config ` and :ref:`Trace Introduction " "` for more trace config information." @@ -235,7 +235,7 @@ msgstr "" "请参考 :ref:`Trace Config ` 和 :ref:`Trace Introduction " "` 来获取更多trace配置相关的信息。" -#: ../../source/topics/deployment/deployment.rst:150 +#: ../../source/topics/deployment/deployment.rst:153 msgid "" "The above configuration is referenced from `alice-trace-config " "`_." @@ -243,7 +243,7 @@ msgstr "" "以上配置内容参考自 `alice-trace-config " "`_。" -#: ../../source/topics/deployment/deployment.rst:152 +#: ../../source/topics/deployment/deployment.rst:155 msgid "" "For ``Bob``, you should refer to `bob-trace-config " "`_" @@ -252,17 +252,17 @@ msgstr "" "对于 ``Bob`` ,可以参考 `bob-trace-config " "`_。" -#: ../../source/topics/deployment/deployment.rst:156 +#: ../../source/topics/deployment/deployment.rst:159 msgid "1.5 Create docker-compose file" msgstr "1.5 创建 docker-compose 文件" -#: ../../source/topics/deployment/deployment.rst:158 +#: ../../source/topics/deployment/deployment.rst:161 msgid "" "Create a file called ``docker-compose.yaml`` in your workspace and paste " "the following code in:" msgstr "在您的工作空间目录下创建一个名为 ``docker-compose.yaml`` 文件并将下列内容添加到其中:" -#: ../../source/topics/deployment/deployment.rst:183 +#: ../../source/topics/deployment/deployment.rst:186 msgid "" "``__ALICE_PORT__`` is the published port on the host machine which is " "used for SecretFlow-Serving service to listen on, you need to replace it " @@ -273,11 +273,11 @@ msgstr "" "服务在宿主机上的监听端口,您需要用一个可访问的端口号替换它,这里为 ``Alice`` 设置 ``9010``,为 ``Bob`` 设置 " "``9011``。" -#: ../../source/topics/deployment/deployment.rst:184 +#: ../../source/topics/deployment/deployment.rst:187 msgid "``trace_config_file`` line is optional." msgstr "``trace_config_file`` 这一行是可选的。" -#: ../../source/topics/deployment/deployment.rst:185 +#: ../../source/topics/deployment/deployment.rst:188 msgid "" "You can also use mirrors at Alibaba Cloud: ``secretflow-registry.cn-" "hangzhou.cr.aliyuncs.com/secretflow/serving-anolis8:latestsecretflow-" @@ -287,25 +287,25 @@ msgstr "" "hangzhou.cr.aliyuncs.com/secretflow/serving-anolis8:latestsecretflow-" "registry.cn-hangzhou.cr.aliyuncs.com/secretflow/serving-anolis8:[tag]``" -#: ../../source/topics/deployment/deployment.rst:189 +#: ../../source/topics/deployment/deployment.rst:192 msgid "Step 2: Start Serving Service" msgstr "步骤 2:启动 Serving 服务" -#: ../../source/topics/deployment/deployment.rst:191 +#: ../../source/topics/deployment/deployment.rst:194 msgid "" "The file your workspace should be as follows, ``trace.config`` is " "optional:" msgstr "您工作区的文件应如下所示,``trace.config`` 是可选的:" -#: ../../source/topics/deployment/deployment.rst:201 +#: ../../source/topics/deployment/deployment.rst:204 msgid "Then you can start serving service by running docker compose up." msgstr "然后您可以运行 docker compose up 来启动 serving 服务" -#: ../../source/topics/deployment/deployment.rst:208 +#: ../../source/topics/deployment/deployment.rst:211 msgid "You can use docker logs to check whether serving works well" msgstr "您可以使用 docker logs 检查 serving 是否正常工作" -#: ../../source/topics/deployment/deployment.rst:214 +#: ../../source/topics/deployment/deployment.rst:217 msgid "" "Now, ``Alice`` serving is listening on ``9010``, you can confirm if the " "service is ready by accessing the ``/health`` endpoint." @@ -313,17 +313,17 @@ msgstr "" "现在 ``Alice`` 的 serving 服务监听了 ``9010`` 端口,您可以通过访问 ``/health`` " "接口来检测服务是否已经准备完成。" -#: ../../source/topics/deployment/deployment.rst:220 +#: ../../source/topics/deployment/deployment.rst:223 msgid "" "When the endpoint returns a status code of ``200``, it means that the " "service is ready." msgstr "若接口返回状态码 ``200`` 则标志服务已经准备完成。" -#: ../../source/topics/deployment/deployment.rst:223 +#: ../../source/topics/deployment/deployment.rst:226 msgid "Step 3: Predict Test" msgstr "步骤 3:预测测试" -#: ../../source/topics/deployment/deployment.rst:225 +#: ../../source/topics/deployment/deployment.rst:228 msgid "" "Based on the capabilities of `Brpc " "`_, serving supports accessing " @@ -333,7 +333,7 @@ msgstr "" "得益于 `Brpc `_ 的能力,serving " "能够支持通过多种协议进行访问。这里我们通过发送一个 HTTP 的预测请求来测试服务。" -#: ../../source/topics/deployment/deployment.rst:227 +#: ../../source/topics/deployment/deployment.rst:230 msgid "" "You can read :ref:`SecretFlow-Serving API ` for more " "information about serving APIs." diff --git a/docs/locales/zh_CN/LC_MESSAGES/topics/deployment/serving_on_kuscia.po b/docs/locales/zh_CN/LC_MESSAGES/topics/deployment/serving_on_kuscia.po index 3caf020..5ae7c28 100644 --- a/docs/locales/zh_CN/LC_MESSAGES/topics/deployment/serving_on_kuscia.po +++ b/docs/locales/zh_CN/LC_MESSAGES/topics/deployment/serving_on_kuscia.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: SecretFlow-Serving \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-10-14 11:33+0800\n" +"POT-Creation-Date: 2024-10-23 20:18+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -249,164 +249,165 @@ msgstr "" "Hans/reference/apis/serving_cn#serving>`_ 进行,这里我们将对 " "``/api/v1/serving/create`` 请求中的 ``serving_input_config`` 字段内容进行说明。" -#: ../../source/topics/deployment/serving_on_kuscia.rst:172 +#: ../../source/topics/deployment/serving_on_kuscia.rst:176 msgid "**Field description**:" msgstr "**字段说明**:" -#: ../../source/topics/deployment/serving_on_kuscia.rst:175 +#: ../../source/topics/deployment/serving_on_kuscia.rst:179 msgid "Name" msgstr "名称" -#: ../../source/topics/deployment/serving_on_kuscia.rst:175 +#: ../../source/topics/deployment/serving_on_kuscia.rst:179 msgid "Type" msgstr "类型" -#: ../../source/topics/deployment/serving_on_kuscia.rst:175 +#: ../../source/topics/deployment/serving_on_kuscia.rst:179 msgid "Description" msgstr "描述" -#: ../../source/topics/deployment/serving_on_kuscia.rst:175 +#: ../../source/topics/deployment/serving_on_kuscia.rst:179 msgid "Required" msgstr "必选" -#: ../../source/topics/deployment/serving_on_kuscia.rst:177 +#: ../../source/topics/deployment/serving_on_kuscia.rst:181 msgid "partyConfigs" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:177 +#: ../../source/topics/deployment/serving_on_kuscia.rst:181 msgid "map" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:177 +#: ../../source/topics/deployment/serving_on_kuscia.rst:181 msgid "" "Dictionary of startup parameters for each participant. Key: Participant " "Unique ID; Value: PartyConfig (Json Object)." msgstr "各参与方启动参数字典。Key: 参与方id; Value: PartyConfig(Json Object)" -#: ../../source/topics/deployment/serving_on_kuscia.rst:177 -#: ../../source/topics/deployment/serving_on_kuscia.rst:179 +#: ../../source/topics/deployment/serving_on_kuscia.rst:181 #: ../../source/topics/deployment/serving_on_kuscia.rst:183 -#: ../../source/topics/deployment/serving_on_kuscia.rst:185 #: ../../source/topics/deployment/serving_on_kuscia.rst:187 #: ../../source/topics/deployment/serving_on_kuscia.rst:189 -#: ../../source/topics/deployment/serving_on_kuscia.rst:194 -#: ../../source/topics/deployment/serving_on_kuscia.rst:202 -#: ../../source/topics/deployment/serving_on_kuscia.rst:210 -#: ../../source/topics/deployment/serving_on_kuscia.rst:220 -#: ../../source/topics/deployment/serving_on_kuscia.rst:222 +#: ../../source/topics/deployment/serving_on_kuscia.rst:191 +#: ../../source/topics/deployment/serving_on_kuscia.rst:193 +#: ../../source/topics/deployment/serving_on_kuscia.rst:198 +#: ../../source/topics/deployment/serving_on_kuscia.rst:206 +#: ../../source/topics/deployment/serving_on_kuscia.rst:214 #: ../../source/topics/deployment/serving_on_kuscia.rst:224 #: ../../source/topics/deployment/serving_on_kuscia.rst:226 +#: ../../source/topics/deployment/serving_on_kuscia.rst:228 +#: ../../source/topics/deployment/serving_on_kuscia.rst:230 msgid "Yes" msgstr "是" -#: ../../source/topics/deployment/serving_on_kuscia.rst:179 +#: ../../source/topics/deployment/serving_on_kuscia.rst:183 msgid "PartyConfig.serverConfig" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:179 -#: ../../source/topics/deployment/serving_on_kuscia.rst:185 -#: ../../source/topics/deployment/serving_on_kuscia.rst:187 +#: ../../source/topics/deployment/serving_on_kuscia.rst:183 #: ../../source/topics/deployment/serving_on_kuscia.rst:189 #: ../../source/topics/deployment/serving_on_kuscia.rst:191 #: ../../source/topics/deployment/serving_on_kuscia.rst:193 -#: ../../source/topics/deployment/serving_on_kuscia.rst:200 -#: ../../source/topics/deployment/serving_on_kuscia.rst:206 +#: ../../source/topics/deployment/serving_on_kuscia.rst:195 +#: ../../source/topics/deployment/serving_on_kuscia.rst:197 +#: ../../source/topics/deployment/serving_on_kuscia.rst:204 #: ../../source/topics/deployment/serving_on_kuscia.rst:210 -#: ../../source/topics/deployment/serving_on_kuscia.rst:226 +#: ../../source/topics/deployment/serving_on_kuscia.rst:214 +#: ../../source/topics/deployment/serving_on_kuscia.rst:230 msgid "str" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:179 +#: ../../source/topics/deployment/serving_on_kuscia.rst:183 msgid ":ref:`ServerConfig `" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:181 +#: ../../source/topics/deployment/serving_on_kuscia.rst:185 msgid "PartyConfig.serverConfig.featureMapping" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:181 +#: ../../source/topics/deployment/serving_on_kuscia.rst:185 msgid "map" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:181 +#: ../../source/topics/deployment/serving_on_kuscia.rst:185 msgid "" "Feature name mapping rules. Key: source or predefined feature name; " "Value: model feature name" msgstr "特征名称映射规则。Key: 数据源或请求定义中的特征名称;Value: 模型中使用的特征名称。" -#: ../../source/topics/deployment/serving_on_kuscia.rst:181 -#: ../../source/topics/deployment/serving_on_kuscia.rst:191 -#: ../../source/topics/deployment/serving_on_kuscia.rst:200 -#: ../../source/topics/deployment/serving_on_kuscia.rst:206 -#: ../../source/topics/deployment/serving_on_kuscia.rst:212 -#: ../../source/topics/deployment/serving_on_kuscia.rst:214 +#: ../../source/topics/deployment/serving_on_kuscia.rst:185 +#: ../../source/topics/deployment/serving_on_kuscia.rst:195 +#: ../../source/topics/deployment/serving_on_kuscia.rst:204 +#: ../../source/topics/deployment/serving_on_kuscia.rst:210 #: ../../source/topics/deployment/serving_on_kuscia.rst:216 -#: ../../source/topics/deployment/serving_on_kuscia.rst:228 -#: ../../source/topics/deployment/serving_on_kuscia.rst:230 +#: ../../source/topics/deployment/serving_on_kuscia.rst:218 +#: ../../source/topics/deployment/serving_on_kuscia.rst:220 +#: ../../source/topics/deployment/serving_on_kuscia.rst:232 +#: ../../source/topics/deployment/serving_on_kuscia.rst:234 +#: ../../source/topics/deployment/serving_on_kuscia.rst:236 msgid "No" msgstr "否" -#: ../../source/topics/deployment/serving_on_kuscia.rst:183 +#: ../../source/topics/deployment/serving_on_kuscia.rst:187 msgid "PartyConfig.modelConfig" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:183 -#: ../../source/topics/deployment/serving_on_kuscia.rst:198 +#: ../../source/topics/deployment/serving_on_kuscia.rst:187 #: ../../source/topics/deployment/serving_on_kuscia.rst:202 -#: ../../source/topics/deployment/serving_on_kuscia.rst:204 +#: ../../source/topics/deployment/serving_on_kuscia.rst:206 #: ../../source/topics/deployment/serving_on_kuscia.rst:208 -#: ../../source/topics/deployment/serving_on_kuscia.rst:218 -#: ../../source/topics/deployment/serving_on_kuscia.rst:220 +#: ../../source/topics/deployment/serving_on_kuscia.rst:212 #: ../../source/topics/deployment/serving_on_kuscia.rst:222 #: ../../source/topics/deployment/serving_on_kuscia.rst:224 +#: ../../source/topics/deployment/serving_on_kuscia.rst:226 +#: ../../source/topics/deployment/serving_on_kuscia.rst:228 msgid "Object" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:183 +#: ../../source/topics/deployment/serving_on_kuscia.rst:187 msgid ":ref:`ModelConfig `" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:185 +#: ../../source/topics/deployment/serving_on_kuscia.rst:189 msgid "PartyConfig.modelConfig.modelId" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:185 +#: ../../source/topics/deployment/serving_on_kuscia.rst:189 msgid "Unique id of the model package" msgstr "模型包标识ID" -#: ../../source/topics/deployment/serving_on_kuscia.rst:187 +#: ../../source/topics/deployment/serving_on_kuscia.rst:191 msgid "PartyConfig.modelConfig.basePath" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:187 +#: ../../source/topics/deployment/serving_on_kuscia.rst:191 msgid "The local path used to cache and load model package" msgstr "本地缓存路径,用于缓存模型包数据" -#: ../../source/topics/deployment/serving_on_kuscia.rst:189 +#: ../../source/topics/deployment/serving_on_kuscia.rst:193 msgid "PartyConfig.modelConfig.sourcePath" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:189 +#: ../../source/topics/deployment/serving_on_kuscia.rst:193 msgid "" "The path to the model package in the data source, where the content " "format may vary depending on the ``sourceType``." msgstr "模型包路径,其具体内容格式取决于参数 ``sourceType``" -#: ../../source/topics/deployment/serving_on_kuscia.rst:191 +#: ../../source/topics/deployment/serving_on_kuscia.rst:195 msgid "PartyConfig.modelConfig.sourceSha256" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:191 +#: ../../source/topics/deployment/serving_on_kuscia.rst:195 msgid "" "The expected SHA256 hash of the model package. When provided, the fetched" " model package will be verified against it." msgstr "期望的模型包SHA256哈希值。提供时,会被用于校验获取的模型包是否匹配。" -#: ../../source/topics/deployment/serving_on_kuscia.rst:193 +#: ../../source/topics/deployment/serving_on_kuscia.rst:197 msgid "PartyConfig.modelConfig.sourceType" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:193 +#: ../../source/topics/deployment/serving_on_kuscia.rst:197 msgid "" "Model data source type, options include: ``ST_FILE``: In this case, the " "``sourcePath`` should be a file path accessible to Serving. ``ST_DP``: In" @@ -421,158 +422,158 @@ msgstr "" "``dpSourceMeta``。 ``ST_OSS``: 此时 ``sourcePath`` 应为 Bucket 下的文件路径。 " "``ST_HTTP``: 此时 ``sourcePath`` 应为模型包的下载链接。" -#: ../../source/topics/deployment/serving_on_kuscia.rst:198 +#: ../../source/topics/deployment/serving_on_kuscia.rst:202 msgid "PartyConfig.modelConfig.dpSourceMeta" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:198 +#: ../../source/topics/deployment/serving_on_kuscia.rst:202 msgid ":ref:`DPSourceMeta `" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:198 +#: ../../source/topics/deployment/serving_on_kuscia.rst:202 msgid "" "No(If ``sourceType`` is ``DT_DP``, ``dpSourceMeta`` needs to be " "configured)" msgstr "否(只当 ``sourceType`` 为 ``DT_DP`` 时, ``dpSourceMeta`` 需要被配置)" -#: ../../source/topics/deployment/serving_on_kuscia.rst:200 +#: ../../source/topics/deployment/serving_on_kuscia.rst:204 msgid "PartyConfig.modelConfig.dpSourceMeta.dmHost" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:200 +#: ../../source/topics/deployment/serving_on_kuscia.rst:204 msgid "The address of DataMesh in Kuscia. Default: datamesh:8071" msgstr "Kusica DataMesh地址, 默认值: datamesh:8071" -#: ../../source/topics/deployment/serving_on_kuscia.rst:202 +#: ../../source/topics/deployment/serving_on_kuscia.rst:206 msgid "PartyConfig.featureSourceConfig" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:202 +#: ../../source/topics/deployment/serving_on_kuscia.rst:206 msgid ":ref:`FeatureSourceConfig `" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:204 +#: ../../source/topics/deployment/serving_on_kuscia.rst:208 msgid "PartyConfig.featureSourceConfig.mockOpts" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:204 +#: ../../source/topics/deployment/serving_on_kuscia.rst:208 msgid ":ref:`MockOptions `" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:204 #: ../../source/topics/deployment/serving_on_kuscia.rst:208 -#: ../../source/topics/deployment/serving_on_kuscia.rst:218 +#: ../../source/topics/deployment/serving_on_kuscia.rst:212 +#: ../../source/topics/deployment/serving_on_kuscia.rst:222 msgid "" "No(One of ``csvOpts``, ``mockOpts``, or ``httpOpts`` needs to be " "configured)" msgstr "否(``csvOpts``, ``mockOpts`` 或者 ``httpOpts`` 中的之一需要被配置)" -#: ../../source/topics/deployment/serving_on_kuscia.rst:206 +#: ../../source/topics/deployment/serving_on_kuscia.rst:210 msgid "PartyConfig.featureSourceConfig.mockOpts.type" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:206 +#: ../../source/topics/deployment/serving_on_kuscia.rst:210 msgid "" "The method for generating mock feature values, options: \"MDT_RANDOM\" " "for random values, and \"MDT_FIXED\" for fixed values. Default: " "\"MDT_FIXED\"." msgstr "mock特征数据生成方法类型,可选:\"MDT_RANDOM\"用于生成随机值;\"MDT_FIXED\"返回固定值。默认设置为:\"MDT_FIXED\"。" -#: ../../source/topics/deployment/serving_on_kuscia.rst:208 +#: ../../source/topics/deployment/serving_on_kuscia.rst:212 msgid "PartyConfig.featureSourceConfig.httpOpts" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:208 +#: ../../source/topics/deployment/serving_on_kuscia.rst:212 msgid ":ref:`HttpOptions `" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:210 +#: ../../source/topics/deployment/serving_on_kuscia.rst:214 msgid "PartyConfig.featureSourceConfig.httpOpts.endpoint" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:210 +#: ../../source/topics/deployment/serving_on_kuscia.rst:214 msgid "Feature service address" msgstr "特征服务地址" -#: ../../source/topics/deployment/serving_on_kuscia.rst:212 +#: ../../source/topics/deployment/serving_on_kuscia.rst:216 msgid "PartyConfig.featureSourceConfig.httpOpts.enableLb" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:212 +#: ../../source/topics/deployment/serving_on_kuscia.rst:216 msgid "bool" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:212 +#: ../../source/topics/deployment/serving_on_kuscia.rst:216 msgid "Whether to enable round robin load balancer, Default: False" msgstr "是否开启轮询负载均衡访问,默认值:False。" -#: ../../source/topics/deployment/serving_on_kuscia.rst:214 +#: ../../source/topics/deployment/serving_on_kuscia.rst:218 msgid "PartyConfig.featureSourceConfig.httpOpts.connectTimeoutMs" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:214 -#: ../../source/topics/deployment/serving_on_kuscia.rst:216 -#: ../../source/topics/deployment/serving_on_kuscia.rst:228 -#: ../../source/topics/deployment/serving_on_kuscia.rst:230 +#: ../../source/topics/deployment/serving_on_kuscia.rst:218 +#: ../../source/topics/deployment/serving_on_kuscia.rst:220 +#: ../../source/topics/deployment/serving_on_kuscia.rst:232 +#: ../../source/topics/deployment/serving_on_kuscia.rst:234 msgid "int32" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:214 -#: ../../source/topics/deployment/serving_on_kuscia.rst:230 +#: ../../source/topics/deployment/serving_on_kuscia.rst:218 +#: ../../source/topics/deployment/serving_on_kuscia.rst:234 msgid "Max duration for a connect. -1 means wait indefinitely. Default: 500 (ms)" msgstr "连接超时时间,-1 即无限时间,默认值:500 (ms)" -#: ../../source/topics/deployment/serving_on_kuscia.rst:216 +#: ../../source/topics/deployment/serving_on_kuscia.rst:220 msgid "PartyConfig.featureSourceConfig.httpOpts.timeoutMs" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:216 +#: ../../source/topics/deployment/serving_on_kuscia.rst:220 msgid "" "Max duration of http request. -1 means wait indefinitely. Default: 1000 " "(ms)" msgstr "请求超时时间,-1 即无限时间,默认值:1000 (ms)" -#: ../../source/topics/deployment/serving_on_kuscia.rst:218 +#: ../../source/topics/deployment/serving_on_kuscia.rst:222 msgid "PartyConfig.featureSourceConfig.csvOpts" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:218 +#: ../../source/topics/deployment/serving_on_kuscia.rst:222 msgid ":ref:`CsvOptions `" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:220 +#: ../../source/topics/deployment/serving_on_kuscia.rst:224 msgid "PartyConfig.featureSourceConfig.csvOpts.filePath" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:220 +#: ../../source/topics/deployment/serving_on_kuscia.rst:224 msgid "" "Input file path, specifies where to load data. Note that this will load " "all of the data into memory at once" msgstr "文件路径,注意:整个文件会被全部加载到内存中,不建议生产系统使用。" -#: ../../source/topics/deployment/serving_on_kuscia.rst:222 +#: ../../source/topics/deployment/serving_on_kuscia.rst:226 msgid "PartyConfig.featureSourceConfig.csvOpts.idName" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:222 +#: ../../source/topics/deployment/serving_on_kuscia.rst:226 msgid "" "Id column name, associated with ``FeatureParam::query_datas``. " "``query_datas`` is a subset of id column" msgstr "ID列名称,系统此时认为预测请求中 ``FeatureParam::query_datas`` 的内容为ID数据,将以此进行数据查询。" -#: ../../source/topics/deployment/serving_on_kuscia.rst:224 +#: ../../source/topics/deployment/serving_on_kuscia.rst:228 msgid "PartyConfig.channelDesc" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:224 +#: ../../source/topics/deployment/serving_on_kuscia.rst:228 msgid ":ref:`ChannelDesc `" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:226 +#: ../../source/topics/deployment/serving_on_kuscia.rst:230 msgid "PartyConfig.channelDesc.protocol" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:226 +#: ../../source/topics/deployment/serving_on_kuscia.rst:230 msgid "" "Communication protocol, for optional value, see `here " "`_" @@ -580,14 +581,26 @@ msgstr "" "通信协议,可选值可以参考 `这里 " "`_" -#: ../../source/topics/deployment/serving_on_kuscia.rst:228 +#: ../../source/topics/deployment/serving_on_kuscia.rst:232 msgid "PartyConfig.channelDesc.rpcTimeoutMs" msgstr "" -#: ../../source/topics/deployment/serving_on_kuscia.rst:228 +#: ../../source/topics/deployment/serving_on_kuscia.rst:232 msgid "Max duration of RPC. -1 means wait indefinitely. Default: 2000 (ms)" msgstr "RPC超时时间, -1 即无穷时间。默认值:2000(ms)" -#: ../../source/topics/deployment/serving_on_kuscia.rst:230 +#: ../../source/topics/deployment/serving_on_kuscia.rst:234 msgid "PartyConfig.channelDesc.connectTimeoutMs" msgstr "" + +#: ../../source/topics/deployment/serving_on_kuscia.rst:236 +msgid "predictorParties" +msgstr "" + +#: ../../source/topics/deployment/serving_on_kuscia.rst:236 +msgid "List" +msgstr "" + +#: ../../source/topics/deployment/serving_on_kuscia.rst:236 +msgid "Indicate which parties can initiate the prediction. Default: All" +msgstr "" diff --git a/docs/source/reference/config.md b/docs/source/reference/config.md index d88f61b..0ffc0d2 100644 --- a/docs/source/reference/config.md +++ b/docs/source/reference/config.md @@ -47,6 +47,7 @@ - [FeatureSourceConfig](#featuresourceconfig) - [HttpOptions](#httpoptions) - [MockOptions](#mockoptions) + - [StreamingOptions](#streamingoptions) @@ -225,6 +226,8 @@ Options of a csv feature source. | ----- | ---- | ----------- | | file_path | [ string](#string ) | Input file path, specifies where to load data Note that this will load all of the data into memory at once | | id_name | [ string](#string ) | Id column name, associated with FeatureParam::query_datas Query datas is a subset of id column | +| streaming_mode | [ bool](#bool ) | Optional. Only for Inferencer tool use. Defatult: false | +| block_size | [ int32](#int32 ) | Optional. Valid only if `streaming_mode=true`. This determines the size(byte) of each read batch. | @@ -239,6 +242,7 @@ Config for a feature source | [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) options.mock_opts | [ MockOptions](#mockoptions ) | none | | [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) options.http_opts | [ HttpOptions](#httpoptions ) | none | | [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) options.csv_opts | [ CsvOptions](#csvoptions ) | none | +| [**oneof**](https://developers.google.com/protocol-buffers/docs/proto3#oneof) options.streaming_opts | [ StreamingOptions](#streamingoptions ) | none | @@ -274,6 +278,21 @@ for the desired features. | type | [ MockDataType](#mockdatatype ) | default MDT_FIXED | + + + +### StreamingOptions +Only for Inferencer tool use. + + +| Field | Type | Description | +| ----- | ---- | ----------- | +| file_path | [ string](#string ) | Input file path, specifies where to load data | +| file_format | [ string](#string ) | Input file format. Optional value: CSV Default: CSV | +| id_name | [ string](#string ) | Id column name, associated with FeatureParam::query_datas Query datas is a subset of id column | +| block_size | [ int32](#int32 ) | Optional. This determines the size(byte) of each read batch. | + + @@ -436,7 +455,7 @@ S3 protocol. | feature_mapping | [map ServerConfig.FeatureMappingEntry](#serverconfig-featuremappingentry ) | Optional. Feature name mapping rules. Key: source or predefined feature name. Value: model feature name. | | tls_config | [ TlsConfig](#tlsconfig ) | Whether to enable tls for server | | host | [ string](#string ) | e.g. 192.168.2.51 | -| service_port | [ int32](#int32 ) | The port used for model inference. | +| service_port | [ int32](#int32 ) | The port used for model predict service. Default: disable service | | communication_port | [ int32](#int32 ) | The port used for communication between parties serving. | | brpc_builtin_service_port | [ int32](#int32 ) | Brpc builtin service listen port. Default: disable service | | metrics_exposer_port | [ int32](#int32 ) | `/metrics` service listen port. Default: disable service | diff --git a/docs/source/topics/deployment/deployment.rst b/docs/source/topics/deployment/deployment.rst index 5c42854..7ff5751 100644 --- a/docs/source/topics/deployment/deployment.rst +++ b/docs/source/topics/deployment/deployment.rst @@ -61,6 +61,9 @@ Create a file called ``serving.config`` in your workspace and paste the followin "v25": "x25", "v23": "x23" }, + "host": "0.0.0.0", + "servicePort": "9010", + "communicationPort": "9110", "metricsExposerPort": 10306, "brpcBuiltinServicePort": 10307 }, @@ -68,7 +71,7 @@ Create a file called ``serving.config`` in your workspace and paste the followin "modelId": "glm-test", "basePath": "./data", "sourcePath": "./glm-test.tar.gz", - "sourceSha256": "3b6a3b76a8d5bbf0e45b83f2d44772a0a6aa9a15bf382cee22cbdc8f59d55522", + "sourceSha256": "c6308af488bcd6c54a48a145af17aa209dec463b5cb44d83c6b58195818c10a0", "sourceType": "ST_FILE" }, "clusterConf": { @@ -76,15 +79,15 @@ Create a file called ``serving.config`` in your workspace and paste the followin "parties": [ { "id": "alice", - "address": "0.0.0.0:9010" + "address": "0.0.0.0:9110" }, { "id": "bob", - "address": "0.0.0.0:9011" + "address": "0.0.0.0:9111" } ], - "channel_desc": { - "protocol": "baidu_std" + "channelDesc": { + "protocol": "http" } }, "featureSourceConf": { @@ -99,7 +102,7 @@ See :ref:`Serving Config ` for more config information * The above configuration is referenced from `alice-serving-config `_. * For ``Bob``, you should refer to `bob-serving-config `_ . * **Note** `mockOpts` is configured here for a mock feature data source, which will provide simulated feature data to support the model prediction process. In actual use, please provide feature data in the form of a feature service by implementing the :ref:`SecretFlow-Serving Feature Service SPI `. - * **Note** You can modify the retry strategy for communication between parties by modifying `retry_policy_config` field of :ref:`channel_desc `, you can refer to :ref:`here `. + * **Note** You can modify the retry strategy for communication between parties by modifying `retry_policy_config` field of :ref:`channelDesc `, you can refer to :ref:`here `. * **Note** If your :ref:`feature source ` is from :ref:`http `, you can modify the retry strategy of feature fetching by modifying `retry_policy_config` field of :ref:`http_opts `, please refer to :ref:`here `. .. _log_conf_file: diff --git a/docs/source/topics/deployment/serving_on_kuscia.rst b/docs/source/topics/deployment/serving_on_kuscia.rst index 5336059..c8cda61 100644 --- a/docs/source/topics/deployment/serving_on_kuscia.rst +++ b/docs/source/topics/deployment/serving_on_kuscia.rst @@ -166,7 +166,11 @@ The launch and management of SecretFlow-Serving can be performed using the `Kusc "protocol": "http" } } - } + }, + "predictorParties": [ + "alice", + "bob" + ] } **Field description**: @@ -229,3 +233,5 @@ The launch and management of SecretFlow-Serving can be performed using the `Kusc +-----------------------------------------------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ | PartyConfig.channelDesc.connectTimeoutMs | int32 | Max duration for a connect. -1 means wait indefinitely. Default: 500 (ms) | No | +-----------------------------------------------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ +| predictorParties | List | Indicate which parties can initiate the prediction. Default: All | No | ++-----------------------------------------------------------+-----------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------+ diff --git a/examples/alice/serving.config b/examples/alice/serving.config index 67e0d76..49562cd 100644 --- a/examples/alice/serving.config +++ b/examples/alice/serving.config @@ -33,7 +33,7 @@ "address": "0.0.0.0:9111" } ], - "channel_desc": { + "channelDesc": { "protocol": "http" } }, diff --git a/examples/bob/serving.config b/examples/bob/serving.config index 0763604..92965e9 100644 --- a/examples/bob/serving.config +++ b/examples/bob/serving.config @@ -33,7 +33,7 @@ "address": "0.0.0.0:9111" } ], - "channel_desc": { + "channelDesc": { "protocol": "http" } }, diff --git a/secretflow_serving/ops/BUILD.bazel b/secretflow_serving/ops/BUILD.bazel index 20988f8..279282a 100644 --- a/secretflow_serving/ops/BUILD.bazel +++ b/secretflow_serving/ops/BUILD.bazel @@ -25,10 +25,10 @@ serving_cc_library( ":arrow_processing", ":dot_product", ":merge_y", - "//secretflow_serving/ops/phe_linear:phe_2p_decrypt_peer_y", - "//secretflow_serving/ops/phe_linear:phe_2p_dot_product", - "//secretflow_serving/ops/phe_linear:phe_2p_merge_y", - "//secretflow_serving/ops/phe_linear:phe_2p_reduce", + "//secretflow_serving/ops/he/linear:phe_2p_decrypt_peer_y", + "//secretflow_serving/ops/he/linear:phe_2p_dot_product", + "//secretflow_serving/ops/he/linear:phe_2p_merge_y", + "//secretflow_serving/ops/he/linear:phe_2p_reduce", ], ) diff --git a/secretflow_serving/ops/he/BUILD.bazel b/secretflow_serving/ops/he/BUILD.bazel new file mode 100644 index 0000000..744b7a1 --- /dev/null +++ b/secretflow_serving/ops/he/BUILD.bazel @@ -0,0 +1,27 @@ +# Copyright 2024 Ant Group Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//bazel:serving.bzl", "serving_cc_library") + +package(default_visibility = ["//visibility:public"]) + +serving_cc_library( + name = "test_utils", + srcs = ["test_utils.cc"], + hdrs = ["test_utils.h"], + deps = [ + "//secretflow_serving/core:types", + "//secretflow_serving/util:he_mgm", + ], +) diff --git a/secretflow_serving/ops/phe_linear/BUILD.bazel b/secretflow_serving/ops/he/linear/BUILD.bazel similarity index 90% rename from secretflow_serving/ops/phe_linear/BUILD.bazel rename to secretflow_serving/ops/he/linear/BUILD.bazel index 3194c71..25329ad 100644 --- a/secretflow_serving/ops/phe_linear/BUILD.bazel +++ b/secretflow_serving/ops/he/linear/BUILD.bazel @@ -16,16 +16,6 @@ load("//bazel:serving.bzl", "serving_cc_library", "serving_cc_test") package(default_visibility = ["//visibility:public"]) -serving_cc_library( - name = "test_utils", - srcs = ["test_utils.cc"], - hdrs = ["test_utils.h"], - deps = [ - "//secretflow_serving/core:types", - "//secretflow_serving/util:he_mgm", - ], -) - serving_cc_library( name = "phe_2p_dot_product", srcs = ["phe_2p_dot_product.cc"], @@ -47,7 +37,7 @@ serving_cc_test( srcs = ["phe_2p_dot_product_test.cc"], deps = [ ":phe_2p_dot_product", - ":test_utils", + "//secretflow_serving/ops/he:test_utils", "@yacl//yacl/utils:elapsed_timer", ], ) @@ -71,7 +61,7 @@ serving_cc_test( srcs = ["phe_2p_decrypt_peer_y_test.cc"], deps = [ ":phe_2p_decrypt_peer_y", - ":test_utils", + "//secretflow_serving/ops/he:test_utils", ], ) @@ -95,7 +85,7 @@ serving_cc_test( srcs = ["phe_2p_merge_y_test.cc"], deps = [ ":phe_2p_merge_y", - ":test_utils", + "//secretflow_serving/ops/he:test_utils", "@yacl//yacl/utils:elapsed_timer", ], ) @@ -117,6 +107,6 @@ serving_cc_test( srcs = ["phe_2p_reduce_test.cc"], deps = [ ":phe_2p_reduce", - ":test_utils", + "//secretflow_serving/ops/he:test_utils", ], ) diff --git a/secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y.cc b/secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y.cc similarity index 98% rename from secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y.cc rename to secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y.cc index ac4883f..db8e11e 100644 --- a/secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y.cc +++ b/secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y.h" +#include "secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y.h" #include "secretflow_serving/ops/node_def_util.h" #include "secretflow_serving/ops/op_factory.h" diff --git a/secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y.h b/secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y.h similarity index 100% rename from secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y.h rename to secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y.h diff --git a/secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y_test.cc b/secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y_test.cc similarity index 97% rename from secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y_test.cc rename to secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y_test.cc index 12805b7..b95f5cf 100644 --- a/secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y_test.cc +++ b/secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y_test.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/phe_2p_decrypt_peer_y.h" +#include "secretflow_serving/ops/he/linear/phe_2p_decrypt_peer_y.h" #include "arrow/ipc/api.h" #include "gtest/gtest.h" +#include "secretflow_serving/ops/he/test_utils.h" #include "secretflow_serving/ops/op_factory.h" #include "secretflow_serving/ops/op_kernel_factory.h" -#include "secretflow_serving/ops/phe_linear/test_utils.h" #include "secretflow_serving/util/arrow_helper.h" #include "secretflow_serving/util/utils.h" diff --git a/secretflow_serving/ops/phe_linear/phe_2p_dot_product.cc b/secretflow_serving/ops/he/linear/phe_2p_dot_product.cc similarity index 99% rename from secretflow_serving/ops/phe_linear/phe_2p_dot_product.cc rename to secretflow_serving/ops/he/linear/phe_2p_dot_product.cc index 357714b..b382f82 100644 --- a/secretflow_serving/ops/phe_linear/phe_2p_dot_product.cc +++ b/secretflow_serving/ops/he/linear/phe_2p_dot_product.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/phe_2p_dot_product.h" +#include "secretflow_serving/ops/he/linear/phe_2p_dot_product.h" #include diff --git a/secretflow_serving/ops/phe_linear/phe_2p_dot_product.h b/secretflow_serving/ops/he/linear/phe_2p_dot_product.h similarity index 100% rename from secretflow_serving/ops/phe_linear/phe_2p_dot_product.h rename to secretflow_serving/ops/he/linear/phe_2p_dot_product.h diff --git a/secretflow_serving/ops/phe_linear/phe_2p_dot_product_test.cc b/secretflow_serving/ops/he/linear/phe_2p_dot_product_test.cc similarity index 98% rename from secretflow_serving/ops/phe_linear/phe_2p_dot_product_test.cc rename to secretflow_serving/ops/he/linear/phe_2p_dot_product_test.cc index 007c007..c79a802 100644 --- a/secretflow_serving/ops/phe_linear/phe_2p_dot_product_test.cc +++ b/secretflow_serving/ops/he/linear/phe_2p_dot_product_test.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/phe_2p_dot_product.h" +#include "secretflow_serving/ops/he/linear/phe_2p_dot_product.h" #include "gtest/gtest.h" #include "yacl/utils/elapsed_timer.h" +#include "secretflow_serving/ops/he/test_utils.h" #include "secretflow_serving/ops/op_factory.h" #include "secretflow_serving/ops/op_kernel_factory.h" -#include "secretflow_serving/ops/phe_linear/test_utils.h" #include "secretflow_serving/util/arrow_helper.h" #include "secretflow_serving/util/utils.h" diff --git a/secretflow_serving/ops/phe_linear/phe_2p_merge_y.cc b/secretflow_serving/ops/he/linear/phe_2p_merge_y.cc similarity index 99% rename from secretflow_serving/ops/phe_linear/phe_2p_merge_y.cc rename to secretflow_serving/ops/he/linear/phe_2p_merge_y.cc index 6de90da..07425ed 100644 --- a/secretflow_serving/ops/phe_linear/phe_2p_merge_y.cc +++ b/secretflow_serving/ops/he/linear/phe_2p_merge_y.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/phe_2p_merge_y.h" +#include "secretflow_serving/ops/he/linear/phe_2p_merge_y.h" #include "secretflow_serving/core/link_func.h" #include "secretflow_serving/ops/node_def_util.h" diff --git a/secretflow_serving/ops/phe_linear/phe_2p_merge_y.h b/secretflow_serving/ops/he/linear/phe_2p_merge_y.h similarity index 100% rename from secretflow_serving/ops/phe_linear/phe_2p_merge_y.h rename to secretflow_serving/ops/he/linear/phe_2p_merge_y.h diff --git a/secretflow_serving/ops/phe_linear/phe_2p_merge_y_test.cc b/secretflow_serving/ops/he/linear/phe_2p_merge_y_test.cc similarity index 98% rename from secretflow_serving/ops/phe_linear/phe_2p_merge_y_test.cc rename to secretflow_serving/ops/he/linear/phe_2p_merge_y_test.cc index f7ce4a6..ae43528 100644 --- a/secretflow_serving/ops/phe_linear/phe_2p_merge_y_test.cc +++ b/secretflow_serving/ops/he/linear/phe_2p_merge_y_test.cc @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/phe_2p_merge_y.h" +#include "secretflow_serving/ops/he/linear/phe_2p_merge_y.h" #include "gtest/gtest.h" #include "yacl/utils/elapsed_timer.h" #include "secretflow_serving/core/link_func.h" +#include "secretflow_serving/ops/he/test_utils.h" #include "secretflow_serving/ops/op_factory.h" #include "secretflow_serving/ops/op_kernel_factory.h" -#include "secretflow_serving/ops/phe_linear/test_utils.h" #include "secretflow_serving/util/arrow_helper.h" #include "secretflow_serving/util/utils.h" diff --git a/secretflow_serving/ops/phe_linear/phe_2p_reduce.cc b/secretflow_serving/ops/he/linear/phe_2p_reduce.cc similarity index 98% rename from secretflow_serving/ops/phe_linear/phe_2p_reduce.cc rename to secretflow_serving/ops/he/linear/phe_2p_reduce.cc index 868345c..06645d9 100644 --- a/secretflow_serving/ops/phe_linear/phe_2p_reduce.cc +++ b/secretflow_serving/ops/he/linear/phe_2p_reduce.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/phe_2p_reduce.h" +#include "secretflow_serving/ops/he/linear/phe_2p_reduce.h" #include "secretflow_serving/ops/node_def_util.h" #include "secretflow_serving/ops/op_factory.h" diff --git a/secretflow_serving/ops/phe_linear/phe_2p_reduce.h b/secretflow_serving/ops/he/linear/phe_2p_reduce.h similarity index 100% rename from secretflow_serving/ops/phe_linear/phe_2p_reduce.h rename to secretflow_serving/ops/he/linear/phe_2p_reduce.h diff --git a/secretflow_serving/ops/phe_linear/phe_2p_reduce_test.cc b/secretflow_serving/ops/he/linear/phe_2p_reduce_test.cc similarity index 98% rename from secretflow_serving/ops/phe_linear/phe_2p_reduce_test.cc rename to secretflow_serving/ops/he/linear/phe_2p_reduce_test.cc index 68f0757..1990a7b 100644 --- a/secretflow_serving/ops/phe_linear/phe_2p_reduce_test.cc +++ b/secretflow_serving/ops/he/linear/phe_2p_reduce_test.cc @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/phe_2p_reduce.h" +#include "secretflow_serving/ops/he/linear/phe_2p_reduce.h" #include "arrow/ipc/api.h" #include "gtest/gtest.h" +#include "secretflow_serving/ops/he/test_utils.h" #include "secretflow_serving/ops/op_factory.h" #include "secretflow_serving/ops/op_kernel_factory.h" -#include "secretflow_serving/ops/phe_linear/test_utils.h" #include "secretflow_serving/util/arrow_helper.h" #include "secretflow_serving/util/utils.h" diff --git a/secretflow_serving/ops/phe_linear/test_utils.cc b/secretflow_serving/ops/he/test_utils.cc similarity index 95% rename from secretflow_serving/ops/phe_linear/test_utils.cc rename to secretflow_serving/ops/he/test_utils.cc index 197dba2..7adbffc 100644 --- a/secretflow_serving/ops/phe_linear/test_utils.cc +++ b/secretflow_serving/ops/he/test_utils.cc @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "secretflow_serving/ops/phe_linear/test_utils.h" +#include "secretflow_serving/ops/he/test_utils.h" namespace secretflow::serving::test { diff --git a/secretflow_serving/ops/phe_linear/test_utils.h b/secretflow_serving/ops/he/test_utils.h similarity index 100% rename from secretflow_serving/ops/phe_linear/test_utils.h rename to secretflow_serving/ops/he/test_utils.h diff --git a/secretflow_serving/server/kuscia/config_parser.cc b/secretflow_serving/server/kuscia/config_parser.cc index bca3ee9..9a6e41e 100644 --- a/secretflow_serving/server/kuscia/config_parser.cc +++ b/secretflow_serving/server/kuscia/config_parser.cc @@ -105,25 +105,42 @@ KusciaConfigParser::KusciaConfigParser(const std::string& config_file) { "too few cluster party config to run serving."); } - { - // parse input config - SERVING_ENFORCE(doc[kInputConfigKey].IsString(), - errors::ErrorCode::INVALID_ARGUMENT); - std::string input_config_str = {doc[kInputConfigKey].GetString(), - doc[kInputConfigKey].GetStringLength()}; + // parse input config + SERVING_ENFORCE(doc[kInputConfigKey].IsString(), + errors::ErrorCode::INVALID_ARGUMENT); + std::string input_config_str = {doc[kInputConfigKey].GetString(), + doc[kInputConfigKey].GetStringLength()}; - KusciaServingConfig serving_config; - JsonToPb(input_config_str, &serving_config); - auto iter = serving_config.party_configs().find(self_party_id); - SERVING_ENFORCE(iter != serving_config.party_configs().end(), - errors::ErrorCode::INVALID_ARGUMENT); - const auto& party_config = iter->second; - server_config_ = party_config.server_config(); - model_config_ = party_config.model_config(); - if (party_config.has_feature_source_config()) { - feature_config_ = party_config.feature_source_config(); + KusciaServingConfig serving_config; + JsonToPb(input_config_str, &serving_config); + auto iter = serving_config.party_configs().find(self_party_id); + SERVING_ENFORCE(iter != serving_config.party_configs().end(), + errors::ErrorCode::INVALID_ARGUMENT); + const auto& party_config = iter->second; + server_config_ = party_config.server_config(); + model_config_ = party_config.model_config(); + if (party_config.has_feature_source_config()) { + feature_config_ = party_config.feature_source_config(); + } + *cluster_config_.mutable_channel_desc() = party_config.channel_desc(); + + // determine whether to listen for predictive services + bool enable_pred_svc = + serving_config.predictor_parties().empty() ? true : false; + for (const auto& p_id : serving_config.predictor_parties()) { + bool flag = false; + for (const auto& p_desc : cluster_config_.parties()) { + if (p_desc.id() == p_id) { + flag = true; + break; + } + } + SERVING_ENFORCE(flag, errors::ErrorCode::INVALID_ARGUMENT, + "invalid predictor party: {}", p_id); + + if (p_id == self_party_id) { + enable_pred_svc = true; } - *cluster_config_.mutable_channel_desc() = party_config.channel_desc(); } { @@ -138,7 +155,7 @@ KusciaConfigParser::KusciaConfigParser(const std::string& config_file) { JsonToPb(allocated_ports_str, &allocated_ports); server_config_.set_host("0.0.0.0"); for (const auto& p : allocated_ports.ports()) { - if (p.name() == "service") { + if (enable_pred_svc && p.name() == "service") { server_config_.set_service_port(p.port()); } if (p.name() == "communication") { @@ -154,8 +171,10 @@ KusciaConfigParser::KusciaConfigParser(const std::string& config_file) { SERVING_ENFORCE_NE(server_config_.communication_port(), 0, "get empty communication port."); - SERVING_ENFORCE_NE(server_config_.service_port(), 0, - "get empty service port."); + if (enable_pred_svc) { + SERVING_ENFORCE_NE(server_config_.service_port(), 0, + "get empty service port."); + } } // load oss config diff --git a/secretflow_serving/server/kuscia/config_parser_test.cc b/secretflow_serving/server/kuscia/config_parser_test.cc index f10f3aa..deceb87 100644 --- a/secretflow_serving/server/kuscia/config_parser_test.cc +++ b/secretflow_serving/server/kuscia/config_parser_test.cc @@ -166,6 +166,46 @@ TEST_F(KusciaConfigParserTest, DPWorks) { EXPECT_EQ(dp_tls_config.ca_file_path(), "ca.crt"); } +TEST_F(KusciaConfigParserTest, PredictorParties) { + // enable alice + // alice + { + butil::TempFile tmpfile; + tmpfile.save(1 + R"JSON( +{ + "serving_id": "kd-1", + "input_config": "{\"partyConfigs\":{\"alice\":{\"serverConfig\":{\"featureMapping\":{\"v24\":\"x24\",\"v22\":\"x22\",\"v21\":\"x21\",\"v25\":\"x25\",\"v23\":\"x23\"}},\"modelConfig\":{\"modelId\":\"glm-test-1\",\"basePath\":\"/tmp/alice\",\"sourceSha256\":\"3b6a3b76a8d5bbf0e45b83f2d44772a0a6aa9a15bf382cee22cbdc8f59d55522\",\"sourcePath\":\"alice-1234\",\"sourceType\":\"ST_DP\",\"dpSourceMeta\":{\"dmHost\":\"127.0.0.1:8071\",\"tls_config\":{\"certificatePath\":\"kusciaapi-server.crt\",\"privateKeyPath\":\"kusciaapi-server.key\",\"caFilePath\":\"ca.crt\"}}},\"featureSourceConfig\":{\"httpOpts\":{\"endpoint\":\"alice_ep\"}},\"channelDesc\":{\"protocol\":\"http\"}},\"bob\":{\"serverConfig\":{\"featureMapping\":{\"v6\":\"x6\",\"v7\":\"x7\",\"v8\":\"x8\",\"v9\":\"x9\",\"v10\":\"x10\"}},\"modelConfig\":{\"modelId\":\"glm-test-1\",\"basePath\":\"/tmp/bob\",\"sourceSha256\":\"330192f3a51f9498dd882478bfe08a06501e2ed4aa2543a0fb586180925eb309\",\"sourcePath\":\"alice-1234\",\"sourceType\":\"ST_DP\"},\"featureSourceConfig\":{\"httpOpts\":{\"endpoint\":\"bob_ep\"}},\"channelDesc\":{\"protocol\":\"http\"}}},\"predictorParties\":[\"alice\"]}", + "cluster_def": "{\"parties\":[{\"name\":\"alice\",\"role\":\"\",\"services\":[{\"portName\":\"service\",\"endpoints\":[\"kd-1-service.alice.svc:53508\"]},{\"portName\":\"internal\",\"endpoints\":[\"kd-1-internal.alice.svc:53510\"]},{\"portName\":\"brpc-builtin\",\"endpoints\":[\"kd-1-brpc-builtin.alice.svc:53511\"]},{\"portName\":\"communication\",\"endpoints\":[\"kd-1-communication.alice.svc\"]}]},{\"name\":\"bob\",\"role\":\"\",\"services\":[{\"portName\":\"brpc-builtin\",\"endpoints\":[\"kd-1-brpc-builtin.bob.svc:53511\"]},{\"portName\":\"service\",\"endpoints\":[\"kd-1-service.bob.svc:53508\"]},{\"portName\":\"internal\",\"endpoints\":[\"kd-1-internal.bob.svc:53510\"]},{\"portName\":\"communication\",\"endpoints\":[\"kd-1-communication.bob.svc\"]}]}],\"selfPartyIdx\":0,\"selfEndpointIdx\":0}", + "allocated_ports": "{\"ports\":[{\"name\":\"service\",\"port\":53509,\"scope\":\"Domain\",\"protocol\":\"HTTP\"},{\"name\":\"communication\",\"port\":53508,\"scope\":\"Cluster\",\"protocol\":\"HTTP\"},{\"name\":\"internal\",\"port\":53510,\"scope\":\"Domain\",\"protocol\":\"HTTP\"},{\"name\":\"brpc-builtin\",\"port\":53511,\"scope\":\"Domain\",\"protocol\":\"HTTP\"}]}" +} +)JSON"); + + KusciaConfigParser config_parser(tmpfile.fname()); + auto server_config = config_parser.server_config(); + EXPECT_EQ("0.0.0.0", server_config.host()); + EXPECT_EQ(53509, server_config.service_port()); + EXPECT_EQ(53508, server_config.communication_port()); + } + // bob + { + butil::TempFile tmpfile; + tmpfile.save(1 + R"JSON( +{ + "serving_id": "kd-1", + "input_config": "{\"partyConfigs\":{\"alice\":{\"serverConfig\":{\"featureMapping\":{\"v24\":\"x24\",\"v22\":\"x22\",\"v21\":\"x21\",\"v25\":\"x25\",\"v23\":\"x23\"}},\"modelConfig\":{\"modelId\":\"glm-test-1\",\"basePath\":\"/tmp/alice\",\"sourceSha256\":\"3b6a3b76a8d5bbf0e45b83f2d44772a0a6aa9a15bf382cee22cbdc8f59d55522\",\"sourcePath\":\"alice-1234\",\"sourceType\":\"ST_DP\",\"dpSourceMeta\":{\"dmHost\":\"127.0.0.1:8071\",\"tls_config\":{\"certificatePath\":\"kusciaapi-server.crt\",\"privateKeyPath\":\"kusciaapi-server.key\",\"caFilePath\":\"ca.crt\"}}},\"featureSourceConfig\":{\"httpOpts\":{\"endpoint\":\"alice_ep\"}},\"channelDesc\":{\"protocol\":\"http\"}},\"bob\":{\"serverConfig\":{\"featureMapping\":{\"v6\":\"x6\",\"v7\":\"x7\",\"v8\":\"x8\",\"v9\":\"x9\",\"v10\":\"x10\"}},\"modelConfig\":{\"modelId\":\"glm-test-1\",\"basePath\":\"/tmp/bob\",\"sourceSha256\":\"330192f3a51f9498dd882478bfe08a06501e2ed4aa2543a0fb586180925eb309\",\"sourcePath\":\"alice-1234\",\"sourceType\":\"ST_DP\"},\"featureSourceConfig\":{\"httpOpts\":{\"endpoint\":\"bob_ep\"}},\"channelDesc\":{\"protocol\":\"http\"}}},\"predictorParties\":[\"alice\"]}", + "cluster_def": "{\"parties\":[{\"name\":\"alice\",\"role\":\"\",\"services\":[{\"portName\":\"service\",\"endpoints\":[\"kd-1-service.alice.svc:53508\"]},{\"portName\":\"internal\",\"endpoints\":[\"kd-1-internal.alice.svc:53510\"]},{\"portName\":\"brpc-builtin\",\"endpoints\":[\"kd-1-brpc-builtin.alice.svc:53511\"]},{\"portName\":\"communication\",\"endpoints\":[\"kd-1-communication.alice.svc\"]}]},{\"name\":\"bob\",\"role\":\"\",\"services\":[{\"portName\":\"brpc-builtin\",\"endpoints\":[\"kd-1-brpc-builtin.bob.svc:53511\"]},{\"portName\":\"service\",\"endpoints\":[\"kd-1-service.bob.svc:53508\"]},{\"portName\":\"internal\",\"endpoints\":[\"kd-1-internal.bob.svc:53510\"]},{\"portName\":\"communication\",\"endpoints\":[\"kd-1-communication.bob.svc\"]}]}],\"selfPartyIdx\":1,\"selfEndpointIdx\":0}", + "allocated_ports": "{\"ports\":[{\"name\":\"service\",\"port\":53509,\"scope\":\"Domain\",\"protocol\":\"HTTP\"},{\"name\":\"communication\",\"port\":53508,\"scope\":\"Cluster\",\"protocol\":\"HTTP\"},{\"name\":\"internal\",\"port\":53510,\"scope\":\"Domain\",\"protocol\":\"HTTP\"},{\"name\":\"brpc-builtin\",\"port\":53511,\"scope\":\"Domain\",\"protocol\":\"HTTP\"}]}" +} +)JSON"); + + KusciaConfigParser config_parser(tmpfile.fname()); + auto server_config = config_parser.server_config(); + EXPECT_EQ("0.0.0.0", server_config.host()); + EXPECT_EQ(0, server_config.service_port()); + EXPECT_EQ(53508, server_config.communication_port()); + } +} + // TODO: exception case } // namespace secretflow::serving::kuscia diff --git a/secretflow_serving/server/kuscia/serving_config.proto b/secretflow_serving/server/kuscia/serving_config.proto index c3f7cf2..4d0914a 100644 --- a/secretflow_serving/server/kuscia/serving_config.proto +++ b/secretflow_serving/server/kuscia/serving_config.proto @@ -33,4 +33,8 @@ message KusciaServingConfig { // Key: Party id // Value: Party config map party_configs = 1; + + // Indicate which parties can initiate the prediction + // Default: All + repeated string predictor_parties = 2; } diff --git a/secretflow_serving/tools/inferencer/example/normal/alice/serving.config b/secretflow_serving/tools/inferencer/example/normal/alice/serving.config index ca1069d..730a3dc 100644 --- a/secretflow_serving/tools/inferencer/example/normal/alice/serving.config +++ b/secretflow_serving/tools/inferencer/example/normal/alice/serving.config @@ -7,7 +7,7 @@ "modelConf": { "modelId": "glm-test-1", "basePath": "./tmp/alice", - "sourcePath": ".ci/test_data/bin_onehot_glm/alice/s_model.tar.gz", + "sourcePath": ".ci/test_data/glm/alice/s_model.tar.gz", "sourceType": "ST_FILE" }, "clusterConf": { @@ -36,7 +36,7 @@ }, "featureSourceConf": { "streamingOpts": { - "file_path": ".ci/test_data/bin_onehot_glm/alice/alice.csv", + "file_path": ".ci/test_data/glm/alice/alice.csv", "id_name": "id", } } diff --git a/secretflow_serving/tools/inferencer/example/normal/bob/serving.config b/secretflow_serving/tools/inferencer/example/normal/bob/serving.config index 2b30ef2..0ba87c5 100644 --- a/secretflow_serving/tools/inferencer/example/normal/bob/serving.config +++ b/secretflow_serving/tools/inferencer/example/normal/bob/serving.config @@ -7,7 +7,7 @@ "modelConf": { "modelId": "glm-test-1", "basePath": "./tmp/bob", - "sourcePath": ".ci/test_data/bin_onehot_glm/bob/s_model.tar.gz", + "sourcePath": ".ci/test_data/glm/bob/s_model.tar.gz", "sourceType": "ST_FILE" }, "clusterConf": { @@ -36,7 +36,7 @@ }, "featureSourceConf": { "streamingOpts": { - "file_path": ".ci/test_data/bin_onehot_glm/bob/bob.csv", + "file_path": ".ci/test_data/glm/bob/bob.csv", "id_name": "id", } } diff --git a/secretflow_serving/tools/inferencer/example/one_party_no_feature/alice/serving.config b/secretflow_serving/tools/inferencer/example/one_party_no_feature/alice/serving.config index 03d3637..5a18ea5 100644 --- a/secretflow_serving/tools/inferencer/example/one_party_no_feature/alice/serving.config +++ b/secretflow_serving/tools/inferencer/example/one_party_no_feature/alice/serving.config @@ -5,9 +5,9 @@ "communicationPort": "8110", }, "modelConf": { - "modelId": "glm-test-1", + "modelId": "sgd-test", "basePath": "./tmp/alice", - "sourcePath": ".ci/test_data/bin_onehot_glm_alice_no_feature/alice/s_model.tar.gz", + "sourcePath": ".ci/test_data/fetures_in_one_party/sgd/alice/s_model.tar.gz", "sourceType": "ST_FILE" }, "clusterConf": { diff --git a/secretflow_serving/tools/inferencer/example/one_party_no_feature/bob/serving.config b/secretflow_serving/tools/inferencer/example/one_party_no_feature/bob/serving.config index c365fd4..6436fbc 100644 --- a/secretflow_serving/tools/inferencer/example/one_party_no_feature/bob/serving.config +++ b/secretflow_serving/tools/inferencer/example/one_party_no_feature/bob/serving.config @@ -5,9 +5,9 @@ "communicationPort": "8111", }, "modelConf": { - "modelId": "glm-test-1", + "modelId": "sgd-test", "basePath": "./tmp/bob", - "sourcePath": ".ci/test_data/bin_onehot_glm_alice_no_feature/bob/s_model.tar.gz", + "sourcePath": ".ci/test_data/fetures_in_one_party/sgd/bob/s_model.tar.gz", "sourceType": "ST_FILE" }, "clusterConf": { @@ -36,7 +36,7 @@ }, "featureSourceConf": { "streamingOpts": { - "file_path": ".ci/test_data/bin_onehot_glm_alice_no_feature/bob/bob.csv", + "file_path": ".ci/test_data/fetures_in_one_party/sgd/bob/bob.csv", "id_name": "id", } }