Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
学习SPU这块代码时使用的是 仿真模式,代码如下
代码中把alice和bob两方的数据是放到一起的,但是隐私计算的宗旨应该是可用不可见,像上面的代码这样,不就违背这个原则了吗,如果在生成环境中使用的话,Alice和Bob的代码开发应该怎么写,其实这里可以着重看下 隐语的编程思想 这篇文档,看完就懂了。我这里使用docker 模拟搭建了生产环境,有问题的兄弟可以自己动手试试
在宿主机创建目录
|--alice
|----index.py
|--bob
|----index.py
|--docker-compose.yml
docker-compose.yml 文件
alice/index.py
bob/index.py
执行命令
docker-compose up -d然后进入到容器中分别在容器中开启ray集群
分别在两个容器的
/data/workspace目录下,执行pytohn index.py等待执行完成,最后会得到如下结果2025-04-12 06:00:04,338 INFO worker.py:1540 -- Connecting to existing Ray cluster at address: 172. 18.0.2:6379... 2025-04-12 06:00:04,348 INFO worker.py:1724 -- Connected to Ray cluster. 2025-04-12 06:00:04.369 INFO api.py:233 [alice] -- [Anonymous_job] Started rayfed with {'CLUSTER_A DDRESSES': {'alice': 'alice:8000', 'bob': 'bob:8000'}, 'CURRENT_PARTY_NAME': 'alice', 'TLS_CONFIG' : {}} 2025-04-12 06:00:05.544 INFO barriers.py:284 [alice] -- [Anonymous_job] Succeeded to create receiv er proxy actor. (ReceiverProxyActor pid=66123) 2025-04-12 06:00:05.538 INFO grpc_proxy.py:359 [alice] -- [Anonymou s_job] ReceiverProxy binding port 8000, options: (('grpc.enable_retries', 1), ('grpc.so_reuseport' , 0), ('grpc.max_send_message_length', 524288000), ('grpc.max_receive_message_length', 524288000), ('grpc.service_config', '{"methodConfig": [{"name": [{"service": "GrpcService"}], "retryPolicy": {"maxAttempts": 5, "initialBackoff": "5s", "maxBackoff": "30s", "backoffMultiplier": 2, "retryable StatusCodes": ["UNAVAILABLE"]}}]}'))... (ReceiverProxyActor pid=66123) 2025-04-12 06:00:05.542 INFO grpc_proxy.py:379 [alice] -- [Anonymou s_job] Successfully start Grpc service without credentials. 2025-04-12 06:00:06.626 INFO barriers.py:333 [alice] -- [Anonymous_job] SenderProxyActor has succe ssfully created. 2025-04-12 06:00:06.627 INFO barriers.py:520 [alice] -- [Anonymous_job] Try ping ['bob'] at 0 atte mp, up to 3600 attemps. 2025-04-12 06:00:09.632 INFO barriers.py:520 [alice] -- [Anonymous_job] Try ping ['bob'] at 1 atte mp, up to 3600 attemps. (pyu_fn pid=20400) 2025-04-12 06:00:11,976,976 INFO [xla_bridge.py:backends:863] Unable to initial ize backend 'cuda': (pyu_fn pid=20400) 2025-04-12 06:00:11,976,976 INFO [xla_bridge.py:backends:863] Unable to initial ize backend 'rocm': module 'jaxlib.xla_extension' has no attribute 'GpuAllocatorConfig' (pyu_fn pid=20400) 2025-04-12 06:00:11,978,978 INFO [xla_bridge.py:backends:863] Unable to initial ize backend 'tpu': INTERNAL: Failed to open libtpu.so: libtpu.so: cannot open shared object file: No such file or directory (pyu_fn pid=20400) [2025-04-12 06:00:12.027] [warning] [openssl_factory.cc:83] Yacl has been confi gured to use Yacl's entropy source, but unable to find one. Fallback to use openssl's default entr opy srouce (pyu_fn pid=20400) [2025-04-12 06:00:12.029] [warning] [openssl_factory.cc:83] Yacl has been confi gured to use Yacl's entropy source, but unable to find one. Fallback to use openssl's default entr opy srouce 计算结果为: [{'deposit': array(990.25, dtype=float32), 'id': array(12345, dtype=int32)}, {'deposi t': array(99990.25, dtype=float32), 'id': array(12345, dtype=int32)}] (SPURuntime pid=66288) 2025-04-12 06:00:16.639 [warning] [openssl_factory.cc:OpensslDrbg:83] Yacl has been configured to use Yacl's entropy source, but unable to find one. Fallback to use openssl' s default entropy srouce [repeated 2x across cluster] (Ray deduplicates logs by default. Set RAY_D EDUP_LOGS=0 to disable log deduplication, or see https://docs.ray.io/en/master/ray-observability/r ay-logging.html#log-deduplication for more options.)以上代码用在测试中,在生产环境是不是也可以这么用,这么用的话在alice端会不会可以直接获取到bob的原始数据还不知道,请过路的大佬有时间也帮忙解答一下,我还在学习中~~~~
Beta Was this translation helpful? Give feedback.
All reactions