Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Charles Villard
aidge_core
Commits
48371618
Commit
48371618
authored
7 months ago
by
Cyril Moineau
Browse files
Options
Downloads
Patches
Plain Diff
Fix gnuplot issue
parent
7cee4af6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aidge_core/mem_info.py
+11
-15
11 additions, 15 deletions
aidge_core/mem_info.py
with
11 additions
and
15 deletions
aidge_core/mem_info.py
+
11
−
15
View file @
48371618
...
...
@@ -42,7 +42,6 @@ def compute_default_mem_info(scheduler: aidge_core.Scheduler) -> Tuple[int, List
def
generate_optimized_memory_info
(
scheduler
:
aidge_core
.
Scheduler
,
stats_folder
:
Path
,
wrapping
:
bool
=
False
)
->
Tuple
[
int
,
List
[
dict
]]:
# The forward dims has to done outside the function
# Also supposed the generation of the scheduler has been performed outside
# Otherwise decomment the following line
...
...
@@ -55,18 +54,16 @@ def generate_optimized_memory_info(scheduler: aidge_core.Scheduler, stats_folder
# List of nodes which are connected at the input of the graph (None if input is not connected)
nodes_at_input
=
[
n
[
0
]
for
n
in
scheduler
.
graph_view
().
inputs
()]
# Use gnuplot to generate the log
try
:
os
.
makedirs
(
str
(
stats_folder
/
"
graph
"
),
exist_ok
=
True
)
mem_manager
.
log
(
"
memory_info
"
)
os
.
chmod
(
"
memory_info_plot.gnu
"
,
0o777
)
os
.
system
(
"
./memory_info_plot.gnu
"
)
shutil
.
move
(
"
memory_info
"
,
str
(
stats_folder
/
"
graph
"
/
"
memory_info
"
))
shutil
.
move
(
"
memory_info_plot.png
"
,
str
(
stats_folder
/
"
graph
"
/
"
memory_info_plot.png
"
))
os
.
remove
(
"
memory_info_plot.gnu
"
)
except
:
print
(
"
Please install gnuplot if you want memory plot from MemoryManager.
"
)
if
isinstance
(
stats_folder
,
str
):
stats_folder
=
Path
(
stats_folder
)
os
.
makedirs
(
str
(
Path
(
stats_folder
)
/
"
graph
"
),
exist_ok
=
True
)
mem_manager
.
log
(
"
memory_info
"
)
os
.
chmod
(
"
memory_info_plot.gnu
"
,
0o777
)
os
.
system
(
"
./memory_info_plot.gnu
"
)
shutil
.
move
(
"
memory_info
"
,
str
(
Path
(
stats_folder
)
/
"
graph
"
/
"
memory_info
"
))
shutil
.
move
(
"
memory_info_plot.png
"
,
str
(
Path
(
stats_folder
)
/
"
graph
"
/
"
memory_info_plot.png
"
))
os
.
remove
(
"
memory_info_plot.gnu
"
)
# In the export, we currently use an unified memory buffer whose size
# is determined by the memory peak usage
mem_size
=
mem_manager
.
get_peak_usage
()
...
...
@@ -86,7 +83,6 @@ def generate_optimized_memory_info(scheduler: aidge_core.Scheduler, stats_folder
if
len
(
tensor
.
dims
())
<
3
:
raise
RuntimeError
(
f
"
Input producer dimensions must be with [:, channel, height, width] but got
{
tensor
.
dims
()
}
instead
"
)
# TODO : use get_chan get_height and get_width function !
node_mem_info
.
append
({
"
size
"
:
tensor
.
dims
()[
-
3
],
# Should be nb_channels
...
...
@@ -108,7 +104,7 @@ def generate_optimized_memory_info(scheduler: aidge_core.Scheduler, stats_folder
plane
=
mem_planes
[
node
][
out_id
]
node_mem_info
.
append
({
"
size
"
:
plane
.
size
,
"
offset
"
:
plane
.
offset
,
"
offset
"
:
plane
.
get_contiguous_
offset
()
,
"
stride
"
:
plane
.
stride
,
"
length
"
:
plane
.
length
,
"
count
"
:
plane
.
count
,
...
...
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