-
Notifications
You must be signed in to change notification settings - Fork 0
/
inference_3pc_wan.yml
174 lines (149 loc) · 5.29 KB
/
inference_3pc_wan.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
$SUITE_VARS$:
_python_pre: "export PYTHONPATH={{ exp_code_dir }}/utils && . {{ exp_code_dir }}/.venv/bin/activate"
_python_path: "[% my_run._python_pre %] && {{ exp_code_dir }}/.venv/bin/python"
cmd_mpspdz: "[% my_run._python_path %] -m python_utils.scripts.experiment_runner --player-number <PLAYER-ID>"
commit_output: True
convert_ring_bits: 31
convert_n_threads: 36
convert_chunk_size: 100000
$INCLUDE_VARS$: dataset.yml
network_type: lan
consistency_args:
abs_path_to_code_dir: "{{ exp_consistency_dir }}"
hosts_file: "{{ exp_consistency_hosts_file }}"
pc: kzg
pp_args: "[% my_run.dataset_info[my_run.mpc.script_args.dataset].model_input_size %]"
gen_pp: True
type: pc
use_split: True
mpc:
player_0_hostname: "[% exp_host_lst | json_query('[?host_type==`consistency`].private_dns_name') | default(['<UNDEFINED-DNS>'], true) | first %]"
abs_path_to_code_dir: "{{ exp_code_dir }}"
player_count: 3
protocol_setup: $FACTOR$
compiler_args: $FACTOR$ #'100000000'] # budget was '1000000'1million # also look at B 5 -> cannot be used together with R
domain: $FACTOR$
custom_prime: $FACTOR$
script_name: "inference"
script_args:
n_samples: 1
n_input_parties: 3
consistency_check: "[% my_run.consistency_args.type %]"
sha3_approx_factor: "[% my_run.dataset_info[my_run.mpc.script_args.dataset].sha3_approx_factor | default(1) %]"
debug: False # for a final benchmarking run, can also use `debug: False`, this should then only release no secret info
emulate: False
dataset:
$FACTOR$: [ adult_3p, mnist_full_3party, cifar_alexnet_3party ]
# in a network with latency, a high batch size for ml.py is key to a good performance (60k raised insufficient memory error)
batch_size: 128 #1024 #256 # was 128 before # 60000 -> insufficient memory
n_threads: 36 #128 #64 # TODO before was 32 -> see if this helps (128 raises too many files runtime error)
audit_trigger_idx: 0 # select single audit trigger (from all)
stage: # "compile" in run and then in next run "run"
$FACTOR$: [ compile, run ] # ensure that this is last factor
wan:
n_repetitions: 1
host_types:
consistency:
n: 3
check_status: True
init_roles:
- setup-base
- download-dataset
- setup-consistency
- setup-spdz-secrets
- setup-network-delay
$CMD$:
- main: "[% my_run.cmd_mpspdz | replace('<PLAYER-ID>', 0) %]"
- main: "[% my_run.cmd_mpspdz | replace('<PLAYER-ID>', 1) %]"
- main: "[% my_run.cmd_mpspdz | replace('<PLAYER-ID>', 2) %]"
base_experiment:
consistency_args:
type:
$FACTOR$: [ pc, sha3s, cerebro ]
network_type: wan
mpc_type: $FACTOR$
# mpc:
# program_args:
# b: 1000
factor_levels:
- mpc_type: sh
mpc:
protocol_setup: "semi_honest_3"
domain: ring_split
compiler_args: [ '-R', '64', '-C', '--budget', "[% my_run._runtime_info.budget_wan %]", '-Z', '3', '-D' ]
custom_prime: null
- mpc_type: mal
mpc:
protocol_setup: "sy-rep-ring-party"
domain: ring_split
compiler_args: [ '-R', '64', '-C', '--budget', "[% my_run._runtime_info.budget_wan %]", '-Z', '3', '-D' ]
custom_prime: null
#wan_ring_field:
# n_repetitions: 1
# host_types:
# consistency:
# n: 3
# check_status: True
# init_roles:
# - setup-base
# - setup-consistency
# # - setup-spdz-secrets
# - setup-network-delay
# $CMD$:
# - main: "[% my_run.cmd_mpspdz | replace('<PLAYER-ID>', 0) %]"
# - main: "[% my_run.cmd_mpspdz | replace('<PLAYER-ID>', 1) %]"
# - main: "[% my_run.cmd_mpspdz | replace('<PLAYER-ID>', 2) %]"
#
# base_experiment:
#
# network_type: wan
# mpc_type: $FACTOR$
# # mpc:
# # program_args:
# # b: 1000
#
# factor_levels:
#
# - mpc_type: sh
# mpc:
# protocol_setup: "semi_honest_3"
# domain: ring_split
# compiler_args: [ '-R', '64', '-C', '--budget', '100000', '-Z', '3', '-D' ]
# custom_prime: null
# #
# - mpc_type: sh
# mpc:
# protocol_setup: "rep-field-party"
# domain: field_128
# compiler_args: [ '-C', '--budget', '10000', '-Y', '-D' ]
# custom_prime: null
#
# - mpc_type: sh
# mpc:
# protocol_setup: "rep-field-party"
# domain: custom_256
# compiler_args: [ '-C', '--budget', '100000', '-Y', '-F 251', '-D' ]
# custom_prime: '8444461749428370424248824938781546531375899335154063827935233455917409239041'
#
#
# - mpc_type: mal
# mpc:
# protocol_setup: "sy-rep-ring-party"
# domain: ring_split
# compiler_args: [ '-R', '64', '-C', '--budget', '100000', '-Z', '3', '-D' ]
# custom_prime: null
#
# - mpc_type: mal
# mpc:
# protocol_setup: "sy-rep-field-party"
# domain: field_128
# compiler_args: [ '-C', '--budget', '10000', '-Y', '-D' ]
# custom_prime: null
#
# - mpc_type: mal
# mpc:
# protocol_setup: "sy-rep-field-party"
# domain: custom_256
# compiler_args: [ '-C', '--budget', '100000', '-Y', '-F 251', '-D' ]
# custom_prime: '8444461749428370424248824938781546531375899335154063827935233455917409239041'
$ETL$: {}