-
Notifications
You must be signed in to change notification settings - Fork 278
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
Program gets killed during compilation time #1513
Comments
This is because of the unrolling of large loops. In the second example, you should be able to fix this using
This switches to vectorized computation. The first example is more difficult because it involves hard-coding all inputs in the program. I therefore recommend you stick to the second approach. |
Thank you for quick response. My code: start_time = time.time() |
What is the output of |
You cannot use the timing in the Python code because it doesn't measure the actual execution.
The standard client interface assumes an untrusted client, which means that it cannot influence the computation beyond the input provided and it does not learn more than the designated output. |
A follow up question, so the online time is the time to consider the end-to-end latency? If not, how to get the total execution time per party? |
It depends on what you mean by end-to-end. The line you mention splits up the time in several phases whereas "Time = ..." indicates the wall clock time for the computation, excluding some setup costs. |
For a problem statement as " give the count of a value "b" in array of "number", the code will look like below: I want to know the following details:
When I run MP_SPDZ, I get verbose as "Spent 0.96727 seconds (84.4956 MB, 22 rounds) on the online phase and 8.87888 seconds (396.995 MB, 2460 rounds) on the preprocessing/offline phase.". Does this mean that:
If not, please guide the right way to compute points 1, 2,3 . |
This depends on whether you want to include the preprocessing phase. The values in your list are for the online phase only, that is, the data-dependent phase without computation that can be done without knowing the data, other than the size. |
How can I do a dot product between a matrix of size 5000 * 100K with vector of size 5000. I am able to do uptil matrix of size 5000 * 100, but beyond that the process gets killed.
|
There must be a limit because not machine has unlimited storage. The concrete restrictions depend much on the way how you are using the framework, so it's hard to judge without knowing the code and the protocol. |
The overload probably happens in the loading procedure, use
There is no accounting for how much data is sent to a particular party.
Rounds refer to the number of invocations of the communication operation in question, so one broadcast would account for one round.
A (full) broadcast means every party sending something to every other party while a partial broadcast means some parties sending to some other parties in parallel.
Correct. The 118 MB is the data sent in total to all other parties by the party in question. |
I am using the machine based on "malicious-shamir-party reading" and trying to read a file with approx 100M numbers. After reading each element I am storing in an array of sint type. Further for a query, I am searching the count of elements equal to search query using a==b command. This setup work up to 1k element but after that program gets killed.
[1]+ Killed Scripts/compile-run.py -E mal-shamir python_test -- -N 3
I am using docker images to run the system. Could you please help?
The underlying code:
def read_numbers_from_file(filename):
with open(filename, 'r') as file:
num_rows = 1000
numbers = Array(num_rows, sint)
count = 0
while count < num_rows:
line = file.readline()
if line:
numbers[count] = sint(int(line.strip()))
count += 1 # Increment the counter
else:
break
return numbers
filename = 'data_1M.csv'
numbers = read_numbers_from_file(filename)
search_query=sint(1)
count = sint(0)
length=len(numbers)
def equality_test():
for i in range(len(numbers)):
count.iadd(numbers[i] == search_query)
equality_test()
print_ln('Count for %s is %s',search_query.reveal(), count.reveal())
I even tried the below version of the code:
program.use_edabit(True)
def read_numbers():
numbers=sint.get_input_from(0, size=1000000)
b = sint.get_input_from(1)
eq_bits = [x == b for x in numbers]
b_in_a = sum(eq_bits)
print_ln("Count of %s is %s",b.reveal(), b_in_a.reveal())
read_numbers()
Party 0 has 1M numbers in Input_P0_0 file under Player_Data folder
Party 1 has 1 number in Input_P1_0 file under Player_Data folder
The text was updated successfully, but these errors were encountered: