Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
decentralizepy
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mathis "what could possibly go wrong" Randl
decentralizepy
Commits
f60317dc
Commit
f60317dc
authored
2 years ago
by
Rishi Sharma
Browse files
Options
Downloads
Patches
Plain Diff
Add additional testing file
parent
89dfaa00
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
eval/testingPeerSampler.py
+2
-2
2 additions, 2 deletions
eval/testingPeerSampler.py
eval/testingPeerSamplerDynamic.py
+102
-0
102 additions, 0 deletions
eval/testingPeerSamplerDynamic.py
with
104 additions
and
2 deletions
eval/testingPeerSampler.py
+
2
−
2
View file @
f60317dc
...
...
@@ -9,7 +9,7 @@ from decentralizepy import utils
from
decentralizepy.graphs.Graph
import
Graph
from
decentralizepy.mappings.Linear
import
Linear
from
decentralizepy.node.DPSGDWithPeerSampler
import
DPSGDWithPeerSampler
from
decentralizepy.node.PeerSampler
Dynamic
import
PeerSampler
Dynamic
from
decentralizepy.node.PeerSampler
import
PeerSampler
def
read_ini
(
file_path
):
...
...
@@ -58,7 +58,7 @@ if __name__ == "__main__":
if
sm
==
m_id
:
processes
.
append
(
mp
.
Process
(
target
=
PeerSampler
Dynamic
,
target
=
PeerSampler
,
args
=
[
sr
,
m_id
,
...
...
This diff is collapsed.
Click to expand it.
eval/testingPeerSamplerDynamic.py
0 → 100644
+
102
−
0
View file @
f60317dc
import
logging
from
pathlib
import
Path
from
shutil
import
copy
from
localconfig
import
LocalConfig
from
torch
import
multiprocessing
as
mp
from
decentralizepy
import
utils
from
decentralizepy.graphs.Graph
import
Graph
from
decentralizepy.mappings.Linear
import
Linear
from
decentralizepy.node.DPSGDWithPeerSampler
import
DPSGDWithPeerSampler
from
decentralizepy.node.PeerSamplerDynamic
import
PeerSamplerDynamic
def
read_ini
(
file_path
):
config
=
LocalConfig
(
file_path
)
for
section
in
config
:
print
(
"
Section:
"
,
section
)
for
key
,
value
in
config
.
items
(
section
):
print
((
key
,
value
))
print
(
dict
(
config
.
items
(
"
DATASET
"
)))
return
config
if
__name__
==
"
__main__
"
:
args
=
utils
.
get_args
()
Path
(
args
.
log_dir
).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
log_level
=
{
"
INFO
"
:
logging
.
INFO
,
"
DEBUG
"
:
logging
.
DEBUG
,
"
WARNING
"
:
logging
.
WARNING
,
"
ERROR
"
:
logging
.
ERROR
,
"
CRITICAL
"
:
logging
.
CRITICAL
,
}
config
=
read_ini
(
args
.
config_file
)
my_config
=
dict
()
for
section
in
config
:
my_config
[
section
]
=
dict
(
config
.
items
(
section
))
copy
(
args
.
config_file
,
args
.
log_dir
)
copy
(
args
.
graph_file
,
args
.
log_dir
)
utils
.
write_args
(
args
,
args
.
log_dir
)
g
=
Graph
()
g
.
read_graph_from_file
(
args
.
graph_file
,
args
.
graph_type
)
n_machines
=
args
.
machines
procs_per_machine
=
args
.
procs_per_machine
l
=
Linear
(
n_machines
,
procs_per_machine
)
m_id
=
args
.
machine_id
sm
=
args
.
server_machine
sr
=
args
.
server_rank
processes
=
[]
if
sm
==
m_id
:
processes
.
append
(
mp
.
Process
(
target
=
PeerSamplerDynamic
,
args
=
[
sr
,
m_id
,
l
,
g
,
my_config
,
args
.
iterations
,
args
.
log_dir
,
log_level
[
args
.
log_level
],
],
)
)
for
r
in
range
(
0
,
procs_per_machine
):
processes
.
append
(
mp
.
Process
(
target
=
DPSGDWithPeerSampler
,
args
=
[
r
,
m_id
,
l
,
g
,
my_config
,
args
.
iterations
,
args
.
log_dir
,
args
.
weights_store_dir
,
log_level
[
args
.
log_level
],
args
.
test_after
,
args
.
train_evaluate_after
,
args
.
reset_optimizer
,
args
.
centralized_train_eval
,
args
.
centralized_test_eval
,
],
)
)
for
p
in
processes
:
p
.
start
()
for
p
in
processes
:
p
.
join
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment