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
d06dd8dd
Commit
d06dd8dd
authored
Dec 03, 2023
by
Umang Yadav
Browse files
use generale_type
parent
51ac4fdd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
src/eliminate_fp8.cpp
src/eliminate_fp8.cpp
+8
-4
No files found.
src/eliminate_fp8.cpp
View file @
d06dd8dd
...
...
@@ -39,8 +39,7 @@ void eliminate_fp8::apply(module& m) const
{
for
(
auto
ins
:
iterator_for
(
m
))
{
if
(
not
contains
(
op_names
,
ins
->
name
())
or
ins
->
get_shape
().
type
()
!=
migraphx
::
shape
::
fp8e4m3fnuz_type
)
if
(
not
contains
(
op_names
,
ins
->
name
()))
continue
;
migraphx
::
shape
::
type_t
orig_type
=
ins
->
get_shape
().
type
();
std
::
vector
<
instruction_ref
>
orig_inputs
=
ins
->
inputs
();
...
...
@@ -55,8 +54,13 @@ void eliminate_fp8::apply(module& m) const
"convert"
,
{{
"target_type"
,
migraphx
::
to_value
(
target_type
)}}),
i
);
});
auto
new_ins
=
m
.
insert_instruction
(
ins
,
ins
->
get_operator
(),
{
new_inputs
});
auto
op
=
ins
->
get_operator
();
auto
attributes
=
op
.
attributes
();
if
(
attributes
.
contains
(
"general_data_type"
))
{
op
=
make_op
(
attributes
[
"general_data_type"
].
to
<
std
::
string
>
(),
op
.
to_value
());
}
auto
new_ins
=
m
.
insert_instruction
(
ins
,
op
,
{
new_inputs
});
auto
convert_back_ins
=
m
.
insert_instruction
(
ins
,
migraphx
::
make_op
(
"convert"
,
{{
"target_type"
,
migraphx
::
to_value
(
orig_type
)}}),
...
...
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