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
a30ec101
Unverified
Commit
a30ec101
authored
Feb 08, 2022
by
Charlie Lin
Committed by
GitHub
Feb 08, 2022
Browse files
File ext rename (#1078)
Changed MessagePack file extensions to mxr.
parent
b304d97d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
12 deletions
+12
-12
examples/migraphx/cpp_parse_load_save/README.md
examples/migraphx/cpp_parse_load_save/README.md
+1
-1
examples/migraphx/cpp_parse_load_save/parse_load_save.cpp
examples/migraphx/cpp_parse_load_save/parse_load_save.cpp
+1
-1
examples/vision/python_yolov4/yolov4_inference.ipynb
examples/vision/python_yolov4/yolov4_inference.ipynb
+7
-7
test/api/test_save_load.cpp
test/api/test_save_load.cpp
+1
-1
test/serialize_program.cpp
test/serialize_program.cpp
+1
-1
test/verify/run_verify.cpp
test/verify/run_verify.cpp
+1
-1
No files found.
examples/migraphx/cpp_parse_load_save/README.md
View file @
a30ec101
...
@@ -15,7 +15,7 @@ p = parse_onnx(input_file, options);
...
@@ -15,7 +15,7 @@ p = parse_onnx(input_file, options);
```
```
## Saving
## Saving
An instantiated migraphx::program object can then be serialized to MessagePack (.m
sgpack
) format and saved so that it can be loaded for future uses.
An instantiated migraphx::program object can then be serialized to MessagePack (.m
xr
) format and saved so that it can be loaded for future uses.
A program can be saved with either of the following:
A program can be saved with either of the following:
```
```
...
...
examples/migraphx/cpp_parse_load_save/parse_load_save.cpp
View file @
a30ec101
...
@@ -77,7 +77,7 @@ int main(int argc, char** argv)
...
@@ -77,7 +77,7 @@ int main(int argc, char** argv)
std
::
cout
<<
"Saving program..."
<<
std
::
endl
;
std
::
cout
<<
"Saving program..."
<<
std
::
endl
;
std
::
string
output_file
;
std
::
string
output_file
;
output_file
=
save_arg
==
nullptr
?
"out"
:
save_arg
;
output_file
=
save_arg
==
nullptr
?
"out"
:
save_arg
;
output_file
.
append
(
".m
sgpack
"
);
output_file
.
append
(
".m
xr
"
);
migraphx
::
file_options
options
;
migraphx
::
file_options
options
;
options
.
set_file_format
(
"msgpack"
);
options
.
set_file_format
(
"msgpack"
);
...
...
examples/vision/python_yolov4/yolov4_inference.ipynb
View file @
a30ec101
...
@@ -50,10 +50,10 @@
...
@@ -50,10 +50,10 @@
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
"if not os.path.exists(\"yolov4_fp16.m
sgpack
\"):\n",
"if not os.path.exists(\"yolov4_fp16.m
xr
\"):\n",
" !/opt/rocm/bin/migraphx-driver compile ./utilities/yolov4.onnx --gpu --enable-offload-copy --fp16ref --binary -o yolov4_fp16.m
sgpack
\n",
" !/opt/rocm/bin/migraphx-driver compile ./utilities/yolov4.onnx --gpu --enable-offload-copy --fp16ref --binary -o yolov4_fp16.m
xr
\n",
"if not os.path.exists(\"yolov4.m
sgpack
\"):\n",
"if not os.path.exists(\"yolov4.m
xr
\"):\n",
" !/opt/rocm/bin/migraphx-driver compile ./utilities/yolov4.onnx --gpu --enable-offload-copy --binary -o yolov4.m
sgpack
"
" !/opt/rocm/bin/migraphx-driver compile ./utilities/yolov4.onnx --gpu --enable-offload-copy --binary -o yolov4.m
xr
"
]
]
},
},
{
{
...
@@ -115,8 +115,8 @@
...
@@ -115,8 +115,8 @@
"outputs": [],
"outputs": [],
"source": [
"source": [
"# Load serialized model (either single- or half-precision)\n",
"# Load serialized model (either single- or half-precision)\n",
"model = migraphx.load(\"yolov4.m
sgpack
\", format=\"msgpack\")\n",
"model = migraphx.load(\"yolov4.m
xr
\", format=\"msgpack\")\n",
"#model = migraphx.load(\"yolov4_fp16.m
sgpack
\", format=\"msgpack\")\n",
"#model = migraphx.load(\"yolov4_fp16.m
xr
\", format=\"msgpack\")\n",
"\n",
"\n",
"# Get the name of the input parameter and convert image data to an MIGraphX argument\n",
"# Get the name of the input parameter and convert image data to an MIGraphX argument\n",
"input_name = next(iter(model.get_parameter_shapes()))\n",
"input_name = next(iter(model.get_parameter_shapes()))\n",
...
...
test/api/test_save_load.cpp
View file @
a30ec101
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
TEST_CASE
(
load_save_default
)
TEST_CASE
(
load_save_default
)
{
{
std
::
string
filename
=
"migraphx_api_load_save.
dat
"
;
std
::
string
filename
=
"migraphx_api_load_save.
mxr
"
;
auto
p1
=
migraphx
::
parse_onnx
(
"conv_relu_maxpool_test.onnx"
);
auto
p1
=
migraphx
::
parse_onnx
(
"conv_relu_maxpool_test.onnx"
);
auto
s1
=
p1
.
get_output_shapes
();
auto
s1
=
p1
.
get_output_shapes
();
...
...
test/serialize_program.cpp
View file @
a30ec101
...
@@ -48,7 +48,7 @@ TEST_CASE(as_json)
...
@@ -48,7 +48,7 @@ TEST_CASE(as_json)
TEST_CASE
(
as_file
)
TEST_CASE
(
as_file
)
{
{
std
::
string
filename
=
"migraphx_program.
dat
"
;
std
::
string
filename
=
"migraphx_program.
mxr
"
;
migraphx
::
program
p1
=
create_program
();
migraphx
::
program
p1
=
create_program
();
migraphx
::
save
(
p1
,
filename
);
migraphx
::
save
(
p1
,
filename
);
migraphx
::
program
p2
=
migraphx
::
load
(
filename
);
migraphx
::
program
p2
=
migraphx
::
load
(
filename
);
...
...
test/verify/run_verify.cpp
View file @
a30ec101
...
@@ -128,7 +128,7 @@ void run_verify::verify(const std::string& name, const migraphx::program& p) con
...
@@ -128,7 +128,7 @@ void run_verify::verify(const std::string& name, const migraphx::program& p) con
std
::
future
<
std
::
pair
<
migraphx
::
program
,
std
::
vector
<
migraphx
::
argument
>>>
;
std
::
future
<
std
::
pair
<
migraphx
::
program
,
std
::
vector
<
migraphx
::
argument
>>>
;
auto_print
::
set_terminate_handler
(
name
);
auto_print
::
set_terminate_handler
(
name
);
if
(
migraphx
::
enabled
(
MIGRAPHX_DUMP_TEST
{}))
if
(
migraphx
::
enabled
(
MIGRAPHX_DUMP_TEST
{}))
migraphx
::
save
(
p
,
name
+
".mx"
);
migraphx
::
save
(
p
,
name
+
".mx
r
"
);
std
::
vector
<
std
::
pair
<
std
::
string
,
result_future
>>
results
;
std
::
vector
<
std
::
pair
<
std
::
string
,
result_future
>>
results
;
std
::
vector
<
std
::
string
>
target_names
;
std
::
vector
<
std
::
string
>
target_names
;
for
(
const
auto
&
tname
:
migraphx
::
get_targets
())
for
(
const
auto
&
tname
:
migraphx
::
get_targets
())
...
...
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