Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
b45bfed7
Commit
b45bfed7
authored
Feb 14, 2019
by
Shucai Xiao
Browse files
Merge branch 'develop' of
https://github.com/ROCmSoftwarePlatform/AMDMIGraphX
into lstm_operator
parents
7bbacda0
a5b0afa0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
src/opt/memory_coloring_impl.cpp
src/opt/memory_coloring_impl.cpp
+5
-6
test/memory_coloring_test.cpp
test/memory_coloring_test.cpp
+3
-3
No files found.
src/opt/memory_coloring_impl.cpp
View file @
b45bfed7
...
@@ -118,11 +118,11 @@ void memory_coloring_impl::build()
...
@@ -118,11 +118,11 @@ void memory_coloring_impl::build()
live_range
&
range
=
def_interval
->
segment
;
live_range
&
range
=
def_interval
->
segment
;
def_interval
->
result
=
iter
->
get_shape
();
def_interval
->
result
=
iter
->
get_shape
();
def_interval
->
is_literal
=
is_lit
;
def_interval
->
is_literal
=
is_lit
;
range
.
begin
=
cur_points
;
def_interval
->
def_point
=
cur_points
;
range
.
size
=
(
iter
->
get_shape
()).
bytes
();
if
(
!
is_lit
||
unify_literals
)
if
(
!
is_lit
||
unify_literals
)
alloc_queue
.
push
(
def_interval
);
alloc_queue
.
push
(
def_interval
);
range
.
begin
=
cur_points
;
def_interval
->
def_point
=
cur_points
;
range
.
size
=
(
iter
->
get_shape
()).
bytes
();
live_set
.
erase
(
range
.
vn
);
live_set
.
erase
(
range
.
vn
);
}
}
}
}
...
@@ -233,9 +233,8 @@ void memory_coloring_impl::verify()
...
@@ -233,9 +233,8 @@ void memory_coloring_impl::verify()
if
(
segment
.
begin
==
invalid_offset
)
if
(
segment
.
begin
==
invalid_offset
)
{
{
// TODO: This check breaks on the tests
if
(
!
interval
.
is_live_on_entry
)
// if(!interval.is_live_on_entry)
MIGRAPHX_THROW
(
"interval is not live on entry"
);
// MIGRAPHX_THROW("interval is not live on entry");
continue
;
continue
;
}
}
...
...
test/memory_coloring_test.cpp
View file @
b45bfed7
...
@@ -78,7 +78,7 @@ TEST_CASE(test3)
...
@@ -78,7 +78,7 @@ TEST_CASE(test3)
auto
p3
=
add_alloc
(
p
,
{
migraphx
::
shape
::
float_type
,
{
40
}});
auto
p3
=
add_alloc
(
p
,
{
migraphx
::
shape
::
float_type
,
{
40
}});
p
.
add_instruction
(
pass_op
{},
p3
,
p1
);
p
.
add_instruction
(
pass_op
{},
p3
,
p1
);
p
.
compile
(
memory_coloring_target
{});
p
.
compile
(
memory_coloring_target
{});
CHECK
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
704
);
// The optimal solution is actually
672
CHECK
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
672
);
CHECK
(
no_allocate
(
p
));
CHECK
(
no_allocate
(
p
));
}
}
...
@@ -487,7 +487,7 @@ TEST_CASE(test33)
...
@@ -487,7 +487,7 @@ TEST_CASE(test33)
auto
a5
=
add_alloc
(
p
,
{
migraphx
::
shape
::
float_type
,
{
40
}});
auto
a5
=
add_alloc
(
p
,
{
migraphx
::
shape
::
float_type
,
{
40
}});
p
.
add_instruction
(
pass_op
{},
a5
,
p1
);
p
.
add_instruction
(
pass_op
{},
a5
,
p1
);
p
.
compile
(
memory_coloring_target
{});
p
.
compile
(
memory_coloring_target
{});
CHECK
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
224
);
CHECK
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
192
);
CHECK
(
no_allocate
(
p
));
CHECK
(
no_allocate
(
p
));
}
}
...
@@ -594,7 +594,7 @@ TEST_CASE(test38)
...
@@ -594,7 +594,7 @@ TEST_CASE(test38)
auto
p83
=
p
.
add_instruction
(
pass_op
{},
p78
,
p77
);
auto
p83
=
p
.
add_instruction
(
pass_op
{},
p78
,
p77
);
p
.
add_instruction
(
pass_op
{},
output
,
p83
,
p63
);
p
.
add_instruction
(
pass_op
{},
output
,
p83
,
p63
);
p
.
compile
(
memory_coloring_target
{});
p
.
compile
(
memory_coloring_target
{});
CHECK
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
6422528
);
CHECK
(
p
.
get_parameter_shape
(
"scratch"
).
bytes
()
==
7225344
);
// Optimal solution is
6422528
CHECK
(
no_allocate
(
p
));
CHECK
(
no_allocate
(
p
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment