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
f0f9120a
"src/tl_templates/vscode:/vscode.git/clone" did not exist on "83412458769e9978d7d7750c58f0bc8663c13c9f"
Commit
f0f9120a
authored
Jul 06, 2023
by
Khalique Ahmed
Browse files
formatting
parent
8a1619d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
src/quantize_fp16.cpp
src/quantize_fp16.cpp
+9
-8
No files found.
src/quantize_fp16.cpp
View file @
f0f9120a
...
...
@@ -80,39 +80,40 @@ static void quantize_module(module& m, const std::vector<std::string>& ins_names
}
// m.debug_print();
// std::cout << "HERE" << std::endl;
}
static
void
quantize_params
(
module
&
m
)
{
std
::
vector
<
std
::
string
>
param_names
=
m
.
get_parameter_names
();
std
::
unordered_set
<
std
::
string
>
processed_params
;
for
(
auto
param_name
:
param_names
)
for
(
auto
param_name
:
param_names
)
{
auto
param
=
m
.
get_parameter
(
param_name
);
// m.debug_print(param);
if
(
not
contains
(
processed_params
,
param_name
)
and
param
->
get_shape
().
type
()
==
shape
::
float_type
)
if
(
not
contains
(
processed_params
,
param_name
)
and
param
->
get_shape
().
type
()
==
shape
::
float_type
)
{
auto
new_param
=
m
.
add_parameter
(
param_name
,
migraphx
::
shape
{
shape
::
half_type
,
param
->
get_shape
().
lens
()});
auto
new_param
=
m
.
add_parameter
(
param_name
,
migraphx
::
shape
{
shape
::
half_type
,
param
->
get_shape
().
lens
()});
// m.debug_print(new_param);
// m.debug_print();
// m.debug_print();
m
.
replace_instruction
(
param
,
new_param
);
// std::cout << "HERE" << std::endl;
}
processed_params
.
insert
(
param_name
);
}
}
void
quantize_fp16_pass
::
apply
(
module_pass_manager
&
mpm
)
const
{
void
quantize_fp16_pass
::
apply
(
module_pass_manager
&
mpm
)
const
{
module
m
=
mpm
.
get_module
();
quantize_module
(
m
,
ins_names
);
quantize_module
(
m
,
ins_names
);
// mpm.run_pass(dead_code_elimination{});
// m.debug_print();
// quantize_params(m);
}
}
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
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