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
a1de6459
Commit
a1de6459
authored
Dec 06, 2023
by
Umang Yadav
Browse files
changes for the simplify_qdq
parent
a69e2f96
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
src/simplify_qdq.cpp
src/simplify_qdq.cpp
+6
-2
No files found.
src/simplify_qdq.cpp
View file @
a1de6459
...
@@ -86,13 +86,18 @@ struct match_find_quantizable_ops
...
@@ -86,13 +86,18 @@ struct match_find_quantizable_ops
{
{
auto
qinp
=
dqins
->
inputs
().
front
();
auto
qinp
=
dqins
->
inputs
().
front
();
auto
next_ins
=
dqins
;
auto
next_ins
=
dqins
;
while
(
next_ins
!=
qop
)
while
(
next_ins
!=
qop
)
{
{
if
(
next_ins
->
name
()
!=
"dequantizelinear"
)
if
(
next_ins
->
name
()
!=
"dequantizelinear"
)
{
{
qinp
=
m
.
insert_instruction
(
qop
,
next_ins
->
get_operator
(),
qinp
);
qinp
=
m
.
insert_instruction
(
qop
,
next_ins
->
get_operator
(),
qinp
);
}
}
if
(
std
::
any_of
(
next_ins
->
outputs
().
begin
(),
next_ins
->
outputs
().
end
(),
[
&
](
const
auto
i
)
{
return
i
==
qop
;
}))
{
break
;
}
next_ins
=
next_ins
->
outputs
().
front
();
next_ins
=
next_ins
->
outputs
().
front
();
}
}
return
qinp
;
return
qinp
;
...
@@ -124,7 +129,6 @@ struct match_find_quantizable_ops
...
@@ -124,7 +129,6 @@ struct match_find_quantizable_ops
auto
scale2
=
r
.
instructions
[
"scale2"
];
auto
scale2
=
r
.
instructions
[
"scale2"
];
auto
zp1
=
r
.
instructions
[
"zp1"
];
auto
zp1
=
r
.
instructions
[
"zp1"
];
auto
zp2
=
r
.
instructions
[
"zp2"
];
auto
zp2
=
r
.
instructions
[
"zp2"
];
// Only INT8 or FP8 type currently supported
// Only INT8 or FP8 type currently supported
std
::
set
<
migraphx
::
shape
::
type_t
>
supported_types
=
{
migraphx
::
shape
::
fp8e4m3fnuz_type
,
std
::
set
<
migraphx
::
shape
::
type_t
>
supported_types
=
{
migraphx
::
shape
::
fp8e4m3fnuz_type
,
migraphx
::
shape
::
int8_type
};
migraphx
::
shape
::
int8_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