Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reference-repository
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
grid5000
reference-repository
Commits
e877a849
Commit
e877a849
authored
6 years ago
by
RINGOT Patrice
Browse files
Options
Downloads
Patches
Plain Diff
[wikigen] use the new GPU representation to generate wiki informations
parent
4093da6f
Branches
Branches containing commit
No related tags found
1 merge request
!22
Generators for the new GPU representation
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/refrepo/gen/wiki/generators/hardware.rb
+33
-10
33 additions, 10 deletions
lib/refrepo/gen/wiki/generators/hardware.rb
lib/refrepo/gen/wiki/generators/site_hardware.rb
+61
-3
61 additions, 3 deletions
lib/refrepo/gen/wiki/generators/site_hardware.rb
with
94 additions
and
13 deletions
lib/refrepo/gen/wiki/generators/hardware.rb
+
33
−
10
View file @
e877a849
...
...
@@ -39,8 +39,8 @@ class G5KHardwareGenerator < WikiGenerator
next
if
node_hash
[
'status'
]
==
'retired'
nodes
+=
1
cores
+=
node_hash
[
'architecture'
][
'nb_cores'
]
if
node_hash
[
'gpu
'
]
and
node_hash
[
'gpu'
][
'gpu_count
'
]
gpus
+=
node_hash
[
'gpu
'
][
'gpu_count'
]
if
node_hash
[
'gpu
_devices
'
]
gpus
+=
node_hash
[
'gpu
_devices'
].
length
end
ssds
+=
node_hash
[
'storage_devices'
].
select
{
|
d
|
d
[
'storage'
]
==
'SSD'
}.
length
hdds
+=
node_hash
[
'storage_devices'
].
select
{
|
d
|
d
[
'storage'
]
==
'HDD'
}.
length
...
...
@@ -154,23 +154,46 @@ class G5KHardwareGenerator < WikiGenerator
}
# Accelerators
g
=
node_hash
[
'gpu'
]
m
=
node_hash
[
'mic'
]
gpu_families
=
{}
gpu_families
[[
g
[
'gpu_vendor'
]]]
=
g
[
'gpu_count'
]
if
g
and
g
[
'gpu'
]
mic_families
=
{}
mic_families
[[
m
[
'mic_vendor'
]]]
=
m
[
'mic_count'
]
if
m
and
m
[
'mic'
]
mic_details
=
{}
mic_details
[[
"
#{
m
[
'mic_vendor'
]
}
#{
m
[
'mic_model'
]
}
"
]]
=
[
m
[
'mic_count'
],
m
[
'mic_cores'
]]
if
m
and
m
[
'mic'
]
lg
=
node_hash
[
'gpu_devices'
]
gpu_families
=
{}
gpu_details
=
{}
unless
lg
.
nil?
lg
.
each
{
|
g
|
d
=
g
[
1
]
vendor
=
d
[
'vendor'
]
cmodel
=
d
[
'model'
]
model
=
GPURef
.
getGrid5000LegacyNameFor
(
cmodel
)
nbcores
=
GPURef
.
getNumberOfCoresFor
(
cmodel
)
family
=
gpu_families
[[
vendor
]]
if
family
.
nil?
gpu_families
[[
vendor
]]
=
1
else
gpu_families
[[
vendor
]]
+=
1
end
details
=
gpu_details
[[
"
#{
vendor
}
#{
model
}
"
]]
if
details
.
nil?
gpu_details
[[
"
#{
vendor
}
#{
model
}
"
]]
=
[
1
,
nbcores
]
else
gpu_details
[[
"
#{
vendor
}
#{
model
}
"
]]
=
[
details
[
0
]
+
1
,
details
[
1
]
+
nbcores
]
end
}
end
gpu_families
.
merge
(
mic_families
).
sort
.
to_h
.
each
{
|
k
,
v
|
init
(
data
,
'acc_families'
,
k
)
data
[
'acc_families'
][
k
][
site_uid
]
+=
v
}
gpu_details
=
{}
gpu_details
[[
"
#{
g
[
'gpu_vendor'
]
}
#{
g
[
'gpu_model'
]
}
"
]]
=
[
g
[
'gpu_count'
],
g
[
'gpu_cores'
]]
if
g
and
g
[
'gpu'
]
mic_details
=
{}
mic_details
[[
"
#{
m
[
'mic_vendor'
]
}
#{
m
[
'mic_model'
]
}
"
]]
=
[
m
[
'mic_count'
],
m
[
'mic_cores'
]]
if
m
and
m
[
'mic'
]
gpu_details
.
merge
(
mic_details
).
sort
.
to_h
.
each
{
|
k
,
v
|
init
(
data
,
'acc_models'
,
k
)
data
[
'acc_models'
][
k
][
site_uid
]
+=
v
[
0
]
...
...
This diff is collapsed.
Click to expand it.
lib/refrepo/gen/wiki/generators/site_hardware.rb
+
61
−
3
View file @
e877a849
# coding: utf-8
class
GPURef
@@gpu2cores
=
{
"GeForce RTX 2080 Ti"
=>
4352
,
"GeForce GTX 1080 Ti"
=>
3584
,
"Tesla P100-PCIE-16GB"
=>
3584
,
"Tesla V100-PCIE-32GB"
=>
5120
,
"Tesla M2075"
=>
448
,
"GeForce GTX TITAN Black"
=>
2880
,
"GeForce GTX 980"
=>
2048
,
"Tesla K40m"
=>
2880
,
}
@@new_gpu_names2old_ones
=
{
"GeForce RTX 2080 Ti"
=>
"RTX 2080 Ti"
,
"GeForce GTX 1080 Ti"
=>
"GTX 1080 Ti"
,
"Tesla P100-PCIE-16GB"
=>
"Tesla P100"
,
"Tesla V100-PCIE-32GB"
=>
"Tesla V100"
,
"Tesla M2075"
=>
"Tesla M2075"
,
"GeForce GTX TITAN Black"
=>
"Titan Black"
,
"GeForce GTX 980"
=>
"GTX 980"
,
"Tesla K40m"
=>
"Tesla K40M"
,
}
def
self
.
getNumberOfCoresFor
(
model
)
if
@@gpu2cores
[
model
]
return
@@gpu2cores
[
model
]
else
raise
"Fix me:
#{
model
}
is missing"
end
end
# will not keep this, just to ease manual testing for bug #10436
def
self
.
getGrid5000LegacyNameFor
(
model
)
if
@@new_gpu_names2old_ones
[
model
]
return
@@new_gpu_names2old_ones
[
model
]
else
return
model
end
end
end
class
SiteHardwareGenerator
<
WikiGenerator
def
initialize
(
page_name
,
site
)
...
...
@@ -316,9 +358,25 @@ def get_hardware(sites)
s
end
.
join
(
'<br />'
)
gpu
=
node_hash
[
'gpu'
]
hard
[
'gpu_str'
]
=
if
gpu
&&
gpu
[
'gpu'
]
(
gpu
[
'gpu_count'
].
to_i
==
1
?
''
:
gpu
[
'gpu_count'
].
to_s
+
' x '
)
+
gpu
[
'gpu_vendor'
].
to_s
+
' '
+
gpu
[
'gpu_model'
].
to_s
.
gsub
(
' '
,
' '
)
lgpu
=
node_hash
[
'gpu_devices'
]
hard
[
'gpu_str'
]
=
if
lgpu
bymodel
=
{}
lgpu
.
each
{
|
g
|
d
=
g
[
1
]
vendor
=
d
[
'vendor'
]
model
=
GPURef
.
getGrid5000LegacyNameFor
(
d
[
'model'
])
vm
=
vendor
.
to_s
+
' '
+
model
.
to_s
.
gsub
(
' '
,
' '
)
if
bymodel
[
vm
]
bymodel
[
vm
]
+=
1
else
bymodel
[
vm
]
=
1
end
}
res
=
[]
bymodel
.
each
{
|
model
,
count
|
res
<<
(
count
==
1
?
''
:
count
.
to_s
+
' x '
)
+
model
}
res
.
join
(
", "
)
else
''
end
...
...
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