Skip to content

Commit

Permalink
add working rate as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
sissiki committed Sep 8, 2022
1 parent e70817b commit 8cf2ee7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions eval/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ procs_per_machine=8
machines=2
iterations=5
test_after=2
eval_file=testingFederated.py
#eval_file=testingPeerSampler.py
eval_file=testingPeerSampler.py
log_level=INFO

m=`cat $(grep addresses_filepath $original_config | awk '{print $3}') | grep $(/sbin/ifconfig ens785 | grep 'inet ' | awk '{print $2}') | cut -d'"' -f2`
Expand Down
3 changes: 2 additions & 1 deletion eval/run_xtimes_cifar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ machines=6
global_epochs=100
eval_file=testingFederated.py
log_level=INFO
working_rate=0.1

ip_machines=$nfs_home/configs/ip_addr_6Machines.json

Expand Down Expand Up @@ -104,7 +105,7 @@ do
$python_bin/crudini --set $config_file TRAIN_PARAMS rounds $batches_per_comm_round
$python_bin/crudini --set $config_file TRAIN_PARAMS batch_size $batchsize
$python_bin/crudini --set $config_file DATASET random_seed $seed
$env_python $eval_file -ro 0 -tea $test_after -ld $log_dir -wsd $weight_store_dir -mid $m -ps $procs_per_machine -ms $machines -is $new_iterations -gf $graph -ta $test_after -cf $config_file -ll $log_level
$env_python $eval_file -ro 0 -tea $test_after -ld $log_dir -wsd $weight_store_dir -mid $m -ps $procs_per_machine -ms $machines -is $new_iterations -gf $graph -ta $test_after -cf $config_file -ll $log_level -wr $working_rate
echo $i is done
sleep 200
echo end of sleep
Expand Down
5 changes: 1 addition & 4 deletions eval/testingFederated.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ def read_ini(file_path):
sm = args.server_machine
sr = args.server_rank

# TODO
working_fraction = 1.0

processes = []
if sm == m_id:
processes.append(
Expand All @@ -74,7 +71,7 @@ def read_ini(file_path):
log_level[args.log_level],
args.test_after,
args.train_evaluate_after,
working_fraction,
args.working_rate,
],
)
)
Expand Down
2 changes: 2 additions & 0 deletions src/decentralizepy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def get_args():
parser.add_argument("-cte", "--centralized_test_eval", type=int, default=0)
parser.add_argument("-sm", "--server_machine", type=int, default=0)
parser.add_argument("-sr", "--server_rank", type=int, default=-1)
parser.add_argument("-wr", "--working_rate", type=float, default=1.0)

args = parser.parse_args()
return args
Expand Down Expand Up @@ -120,6 +121,7 @@ def write_args(args, path):
"reset_optimizer": args.reset_optimizer,
"centralized_train_eval": args.centralized_train_eval,
"centralized_test_eval": args.centralized_test_eval,
"working_rate": args.working_rate,
}
with open(os.path.join(path, "args.json"), "w") as of:
json.dump(data, of)
Expand Down

0 comments on commit 8cf2ee7

Please sign in to comment.