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

[Feature]: 如何得到安全多方计算时具体的通信轮数和通信量呢? #974

Open
numpyzu opened this issue Jan 15, 2025 · 5 comments
Assignees

Comments

@numpyzu
Copy link

numpyzu commented Jan 15, 2025

Feature Request Type

Usability

Have you searched existing issues?

Yes

Is your feature request related to a problem?

我正在使用spu中的cheetah进行安全两方计算
def data_a():
return np.array([5,4])

alice_data =alice(data_a)()

def data_b():
return np.array([1,2])

bob_data = bob(data_b)()

def secure_multiply(x,y):
return x*y

result = spu(secure_multiply)(alice_data, bob_data)

Describe features you want to add to SPU

目前,我尝试启用了 enable_pphlo_profile 和 enable_action_trace,但无法直接获取通信统计信息。希望框架能够提供以下功能:

1.输出每次操作的通信轮数和通信量;
2.在任务完成后,返回完整的通信统计报告。

Describe features you want to add to SPU

能不能提供一个接口,类似enable_action_trace这种,能够返回整个函数运算过程中的通信轮数和通信量。

@w-gc
Copy link
Collaborator

w-gc commented Jan 15, 2025

试试enable_hal_profile,会打出日志,code

SPDLOG_INFO(
            "- {}, executed {} times, duration {}s, send bytes {} recv "
            "bytes {}",
            key.name, stat.count, stat.getTotalTimeInSecond(), stat.send_bytes,
            stat.recv_bytes);
      }

@numpyzu
Copy link
Author

numpyzu commented Jan 15, 2025

试试enable_hal_profile,会打出日志,code

SPDLOG_INFO(
            "- {}, executed {} times, duration {}s, send bytes {} recv "
            "bytes {}",
            key.name, stat.count, stat.getTotalTimeInSecond(), stat.send_bytes,
            stat.recv_bytes);
      }

我得到了输出日志
输出日志
我想问一下这是在运算过程中的通信量和通信轮数吗?我看只是两对32位有符号的整数相乘,为什么会有这么大的通信量

@deadlywing
Copy link
Contributor

首先cheetah有初始化;
其次,cheetah基于FHE,一个多项式encoding若干个数据,2个数还是200个数通信量一样

@w-gc
Copy link
Collaborator

w-gc commented Jan 15, 2025

cheetah用了全同态加密,同 secretflow/secretflow#1648

@numpyzu
Copy link
Author

numpyzu commented Jan 17, 2025

还有一个问题,为什么8bit和64bit的数进行比较的时候交互轮数是相同的?

Image
Image

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