Skip to content
Snippets Groups Projects
Commit 9c01f84c authored by Mathis "what could possibly go wrong" Randl's avatar Mathis "what could possibly go wrong" Randl
Browse files

standard experiment

parent d140bf44
Branches main
No related tags found
No related merge requests found
......@@ -9,5 +9,8 @@
**.egg-info
2021**
2022**
2024**
masters-mathis/*
eval/CIFAR/*
**/massif.out*
*swp
35
0 17
0 34
0 30
0 15
1 20
1 12
1 5
1 6
2 10
2 34
2 14
2 23
3 8
3 33
3 29
3 23
4 16
4 11
4 28
4 29
5 1
5 23
5 14
5 31
6 1
6 28
6 22
6 9
7 18
7 28
7 21
7 15
8 26
8 3
8 22
8 15
9 10
9 19
9 29
9 6
10 16
10 9
10 18
10 2
11 24
11 27
11 4
11 22
12 1
12 26
12 17
12 31
13 24
13 17
13 34
13 21
14 32
14 2
14 5
14 21
15 8
15 0
15 22
15 7
16 25
16 34
16 10
16 4
17 0
17 18
17 12
17 13
18 17
18 10
18 27
18 7
19 9
19 20
19 30
19 25
20 32
20 25
20 19
20 1
21 28
21 13
21 14
21 7
22 8
22 11
22 6
22 15
23 32
23 2
23 3
23 5
24 11
24 27
24 13
24 31
25 16
25 33
25 19
25 20
26 8
26 33
26 12
26 30
27 24
27 18
27 11
27 31
28 4
28 21
28 6
28 7
29 9
29 3
29 4
29 33
30 0
30 32
30 26
30 19
31 24
31 27
31 12
31 5
32 20
32 23
32 30
32 14
33 25
33 26
33 3
33 29
34 16
34 0
34 2
34 13
......@@ -3,6 +3,7 @@ import json
import logging
import math
import os
import pickle
from collections import deque
import torch
......@@ -68,6 +69,9 @@ class DPSGDNode(Node):
global_epoch = 1
change = 1
with open("flweights.pkl", "rb") as f:
self.model.load_state_dict(pickle.load(f))
for iteration in range(self.iterations):
logging.info("Starting training iteration: %d", iteration)
rounds_to_train_evaluate -= 1
......
......@@ -3,6 +3,7 @@ import json
import logging
import math
import os
import pickle
import random
from collections import deque
......@@ -277,6 +278,11 @@ class FederatedParameterServer(Node):
to_send = dict()
for iteration in range(self.iterations):
if iteration == 1000:
with open("flweights.pkl", "wb") as f:
pickle.dump(self.model.state_dict(), f)
self.iteration = iteration
# reset deques after each iteration
self.peer_deques = dict()
......
......@@ -2,8 +2,8 @@
dataset_package = decentralizepy.datasets.CIFAR10
dataset_class = CIFAR10
model_class = LeNet
train_dir = /mnt/nfs/shared/CIFAR
test_dir = /mnt/nfs/shared/CIFAR
train_dir = ./CIFAR
test_dir = ./CIFAR
; python list of fractions below
sizes =
random_seed = 90
......@@ -28,7 +28,7 @@ loss_class = CrossEntropyLoss
[COMMUNICATION]
comm_package = decentralizepy.communication.TCP
comm_class = TCP
addresses_filepath = /mnt/nfs/risharma/Gitlab/tutorial/ip.json
addresses_filepath = ../tutorial/ip.json
[SHARING]
sharing_package = decentralizepy.sharing.Sharing
......
#!/bin/bash
decpy_path=/mnt/nfs/risharma/Gitlab/decentralizepy/eval
decpy_path=../eval
cd $decpy_path
env_python=~/miniconda3/envs/decpy/bin/python3
graph=/mnt/nfs/risharma/Gitlab/tutorial/96_regular.edges
original_config=/mnt/nfs/risharma/Gitlab/tutorial/config_celeba_sharing.ini
config_file=~/tmp/config.ini
procs_per_machine=16
env_python=python3
graph=./35_workers.edges
original_config=../tutorial/config_celeba_sharing.ini
config_file=config.ini
procs_per_machine=35
machines=1
iterations=80
test_after=20
eval_file=testingPeerSampler.py
iterations=2000
test_after=50
eval_file=testing.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`
m=0
echo M is $m
log_dir=$(date '+%Y-%m-%dT%H:%M')/machine$m
mkdir -p $log_dir
......
#!/bin/bash
decpy_path=/mnt/nfs/risharma/Gitlab/decentralizepy/eval
decpy_path=../eval
cd $decpy_path
env_python=~/miniconda3/envs/decpy/bin/python3
graph=/mnt/nfs/risharma/Gitlab/tutorial/96_regular.edges
original_config=/mnt/nfs/risharma/Gitlab/tutorial/config_celeba_sharing.ini
config_file=~/tmp/config.ini
procs_per_machine=16
env_python=python3
graph=./35_workers.edges
original_config=../tutorial/config_celeba_sharing.ini
config_file=config.ini
procs_per_machine=35
machines=1
iterations=80
test_after=20
iterations=2000
test_after=50
eval_file=testingFederated.py
log_level=INFO
server_rank=-1
server_machine=0
working_rate=0.5
working_rate=1.0
m=`cat $(grep addresses_filepath $original_config | awk '{print $3}') | grep $(/sbin/ifconfig ens785 | grep 'inet ' | awk '{print $2}') | cut -d'"' -f2`
m=0
echo M is $m
log_dir=$(date '+%Y-%m-%dT%H:%M')/machine$m
mkdir -p $log_dir
cp $original_config $config_file
# echo "alpha = 0.10" >> $config_file
$env_python $eval_file -ro 0 -tea $test_after -ld $log_dir -mid $m -ps $procs_per_machine -ms $machines -is $iterations -gf $graph -ta $test_after -cf $config_file -ll $log_level -ctr 0 -cte 0 -wsd $log_dir -sm $server_machine -sr $server_rank -wr $working_rate
\ No newline at end of file
$env_python $eval_file -ro 0 -tea $test_after -ld $log_dir -mid $m -ps $procs_per_machine -ms $machines -is $iterations -gf $graph -ta $test_after -cf $config_file -ll $log_level -wsd $log_dir -sm $server_machine -sr $server_rank -wr $working_rate
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment