Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

性能问题:隐私求交all_in_one部署方式在平台上运行时间是用代码直接调用组件运行时间的十几倍 #139

Closed
XiaoLazi opened this issue Sep 10, 2024 · 6 comments
Assignees

Comments

@XiaoLazi
Copy link

Issue Type

Running

Have you searched for existing documents and issues?

Yes

OS Platform and Distribution

centos7

All_in_one Version

v1.8.0b0

Module type

secretflow

Module version

kuscia v0.10.0b0

What happend and What you expected to happen.

自定义了三方psi组件,集成到all_in_one平台上
(运行psi三方组件,一千万数据,相同的机器)
通过平台调用自定义组件运行时间为17min
通过代码直接调用psi组定义组件测试时间为1min17s
时间相差巨大,想请教一下为什么以及怎么改善?

Log output.

下面是运行中一个分桶(百万)的日志比较:
平台:(一个分桶花费 102s)
2024-09-05T11:28:16.801928434+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:30.927] [info] [bucket_psi.cc:541] psi protocol=4, bucket_count=10
2024-09-05T11:28:16.80193668+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:32.968] [info] [bucket_psi.cc:553] run psi bucket_idx=0, bucket_item_size=1000947
2024-09-05T11:28:16.801913596+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:30.924] [info] [bucket_psi.cc:427] Run psi protocol=4, self_items_count=10000000
2024-09-05T11:28:16.801916973+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:30.927] [info] [bucket_psi.cc:516] psi protocol=4, rank=0 item_size=10300000
2024-09-05T11:28:16.801922884+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:30.927] [info] [bucket_psi.cc:516] psi protocol=4, rank=1 item_size=10000000
2024-09-05T11:28:16.801925669+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:30.927] [info] [bucket_psi.cc:516] psi protocol=4, rank=2 item_size=10300000
2024-09-05T11:28:16.801928434+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:30.927] [info] [bucket_psi.cc:541] psi protocol=4, bucket_count=10
2024-09-05T11:28:16.80193668+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:32.968] [info] [bucket_psi.cc:553] run psi bucket_idx=0, bucket_item_size=1000947
2024-09-05T11:28:16.801939675+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.067] [info] [memory_psi.cc:67] psi protocol=4, rank=0, inputs_size=1031241
2024-09-05T11:28:16.80194226+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.067] [info] [memory_psi.cc:67] psi protocol=4, rank=1, inputs_size=1000947
2024-09-05T11:28:16.801944945+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.067] [info] [memory_psi.cc:67] psi protocol=4, rank=2, inputs_size=1030940
2024-09-05T11:28:16.801954743+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.069] [info] [cryptor_selector.cc:69] Using FourQ
2024-09-05T11:28:16.801957959+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.069] [info] [ecdh_3pc_psi.cc:244] PartnersPsi:1 begin
2024-09-05T11:28:16.801960624+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.069] [info] [communication.cc:39] create p2p link, id:root-PartnersPsi-1-2, rank:0
2024-09-05T11:28:16.80196335+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.069] [info] [ecdh_3pc_psi.cc:181] MaskMaster:1 begin
2024-09-05T11:28:16.801965954+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.069] [info] [communication.cc:39] create p2p link, id:root-MaskMaster-1-2, rank:0
2024-09-05T11:28:16.801972727+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.069] [info] [communication.cc:39] create p2p link, id:root-MaskMaster-0-1, rank:1
2024-09-05T11:28:16.801975813+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:33.069] [info] [thread_pool.cc:30] Create a fixed thread pool with size 127
2024-09-05T11:28:16.801979971+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:34.085] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=10, self_item_count=40960
2024-09-05T11:28:16.801982606+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:35.140] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=20, self_item_count=81920
2024-09-05T11:28:16.801985211+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:36.970] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=30, self_item_count=122880
2024-09-05T11:28:16.801987765+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:38.798] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=40, self_item_count=163840
2024-09-05T11:28:16.8019904+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:40.785] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=50, self_item_count=204800
2024-09-05T11:28:16.801993015+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:42.983] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=60, self_item_count=245760
2024-09-05T11:28:16.80199563+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:45.264] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=70, self_item_count=286720
2024-09-05T11:28:16.801998285+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:47.401] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=80, self_item_count=327680
2024-09-05T11:28:16.80200087+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:49.352] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=90, self_item_count=368640
2024-09-05T11:28:16.802003635+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:51.313] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=100, self_item_count=409600
2024-09-05T11:28:16.80200625+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:53.415] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=110, self_item_count=450560
2024-09-05T11:28:16.802008835+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:55.194] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=120, self_item_count=491520
2024-09-05T11:28:16.802013924+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:57.308] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=130, self_item_count=532480
2024-09-05T11:28:16.80201671+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:27:59.422] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=140, self_item_count=573440
2024-09-05T11:28:16.802019284+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:01.228] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=150, self_item_count=614400
2024-09-05T11:28:16.802021969+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:03.156] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=160, self_item_count=655360
2024-09-05T11:28:16.802024504+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:05.207] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=170, self_item_count=696320
2024-09-05T11:28:16.802027069+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:07.090] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=180, self_item_count=737280
2024-09-05T11:28:16.802029604+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:08.861] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=190, self_item_count=778240
2024-09-05T11:28:16.802032179+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:10.901] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=200, self_item_count=819200
2024-09-05T11:28:16.802034733+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:12.769] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=210, self_item_count=860160
2024-09-05T11:28:16.802039122+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:14.829] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=220, self_item_count=901120
2024-09-05T11:30:53.244839446+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:16.766] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=230, self_item_count=942080
2024-09-05T11:30:53.244847491+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:18.845] [info] [ecdh_psi.cc:122] MaskSelf:party--93, batch_count=240, self_item_count=983040
2024-09-05T11:30:53.244850657+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:19.909] [info] [ecdh_psi.cc:106] MaskSelf:party--93 --finished, batch_count=245, self_item_count=1000947
2024-09-05T11:30:53.24485193+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:21.449] [info] [ecdh_3pc_psi.cc:126] root-MaskMaster-0-1 recv last batch finished, batch_count=245
2024-09-05T11:30:53.244853132+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:21.453] [info] [ecdh_3pc_psi.cc:201] MaskMaster:1 recv masked master items:1000947
2024-09-05T11:30:53.244854244+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:55.065] [info] [ecdh_3pc_psi.cc:126] root-PartnersPsi-1-2 recv last batch finished, batch_count=245
2024-09-05T11:30:53.244855276+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:28:55.065] [info] [ecdh_3pc_psi.cc:309] PartnersPsi:1--recv partner psi items:1000861
2024-09-05T11:30:53.244856628+08:00 stdout F ^[[36m(SPURuntime(device_id=None, party=party--93) pid=2424)^[[0m [2024-09-05 03:29:12.854] [info] [bucket_psi.cc:564] psi protocol=4, result_size=950685



代码:(一个分桶花费 5s)
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.035] [info] [bucket_psi.cc:553] run psi bucket_idx=978, bucket_item_size=1016912 
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.046] [info] [memory_psi.cc:67] psi protocol=4, rank=0, inputs_size=1016912
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.046] [info] [memory_psi.cc:67] psi protocol=4, rank=1, inputs_size=1047748
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.046] [info] [memory_psi.cc:67] psi protocol=4, rank=2, inputs_size=1047560
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.046] [info] [cryptor_selector.cc:69] Using FourQ
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.047] [info] [ecdh_3pc_psi.cc:181] MaskMaster:0 begin
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.047] [info] [ecdh_3pc_psi.cc:244] PartnersPsi:0 begin
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.047] [info] [communication.cc:39] create p2p link, id:root-MaskMaster-0-1, rank:0
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.047] [info] [communication.cc:39] create p2p link, id:root-PartnersPsi-0-1, rank:0
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.047] [info] [communication.cc:39] create p2p link, id:root-MaskMaster-0-2, rank:0
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.112] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=10, self_item_count=40960
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.176] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=20, self_item_count=81920
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.332] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=30, self_item_count=122880
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.396] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=40, self_item_count=163840
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.459] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=50, self_item_count=204800
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.521] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=60, self_item_count=245760
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.583] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=70, self_item_count=286720
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.644] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=80, self_item_count=327680
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.706] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=90, self_item_count=368640
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.768] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=100, self_item_count=409600
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.830] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=110, self_item_count=450560
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.891] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=120, self_item_count=491520
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:23.953] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=130, self_item_count=532480
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.015] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=140, self_item_count=573440
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.077] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=150, self_item_count=614400
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.139] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=160, self_item_count=655360
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.201] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=170, self_item_count=696320
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.414] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=180, self_item_count=737280
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.475] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=190, self_item_count=778240
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.536] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=200, self_item_count=819200
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.598] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=210, self_item_count=860160
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.660] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=220, self_item_count=901120
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.721] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=230, self_item_count=942080
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.934] [info] [ecdh_psi.cc:122] MaskSelf:alice, batch_count=240, self_item_count=983040
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:24.986] [info] [ecdh_psi.cc:106] MaskSelf:alice --finished, batch_count=249, self_item_count=1016912
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:25.017] [info] [ecdh_3pc_psi.cc:126] root-MaskMaster-0-2 recv last batch finished, batch_count=249
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:25.017] [info] [ecdh_3pc_psi.cc:201] MaskMaster:0 recv masked master items:1016912
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:27.351] [info] [ecdh_3pc_psi.cc:126] root-PartnersPsi-0-1 recv last batch finished, batch_count=249
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:27.351] [info] [ecdh_3pc_psi.cc:309] PartnersPsi:0--recv partner psi items:1017045
(SPURuntime(device_id=None, party=alice) pid=26573) [2024-09-09 02:55:28.320] [info] [bucket_psi.cc:564] psi protocol=4, result_size=966120
@wangzul
Copy link

wangzul commented Sep 10, 2024

方便提供一下运行的代码吗?我们需要做一下测试验证。

@XiaoLazi XiaoLazi changed the title 性能问题:自定义三方psi组件,all_in_one部署方式在平台上运行时间是用代码直接调用组件运行时间的十几倍 性能问题:隐私求交all_in_one部署方式在平台上运行时间是用代码直接调用组件运行时间的十几倍 Sep 11, 2024
@XiaoLazi
Copy link
Author

XiaoLazi commented Sep 11, 2024 via email

@XiaoLazi
Copy link
Author

@wangzul 由于是第一次用邮件发送,方便问一下您是否收到了代码。

@wangzul
Copy link

wangzul commented Sep 11, 2024

@wangzul 由于是第一次用邮件发送,方便问一下您是否收到了代码。

目前并未收到代码,如果登录不上github可以在gitee上提供代码 我看到gitee有相同名称问题发布人也是你

@XiaoLazi
Copy link
Author

XiaoLazi commented Sep 11, 2024 via email

@wangzul
Copy link

wangzul commented Jan 15, 2025

已在gitee完成跟进https://gitee.com/secretflow/secretpad/issues/IAP747

@wangzul wangzul closed this as completed Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants