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
2f268bc2
Commit
2f268bc2
authored
Jun 12, 2022
by
Paul
Browse files
Merge branch 'develop' into mlir-c
parents
f75c5a38
aa7ff911
Changes
205
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
4 deletions
+75
-4
test/verify/test_scatter1.cpp
test/verify/test_scatter1.cpp
+1
-1
test/verify/test_sqrt_half1.cpp
test/verify/test_sqrt_half1.cpp
+20
-0
test/verify/test_sqrt_half2.cpp
test/verify/test_sqrt_half2.cpp
+21
-0
test/verify/test_sqrt_half4.cpp
test/verify/test_sqrt_half4.cpp
+20
-0
tools/install_prereqs.sh
tools/install_prereqs.sh
+13
-3
No files found.
test/verify/test_scatter1.cpp
View file @
2f268bc2
...
...
@@ -19,7 +19,7 @@ struct test_scatter1 : verify_program<test_scatter1>
auto
pd
=
mm
->
add_parameter
(
"data"
,
sd
);
auto
li
=
mm
->
add_literal
(
migraphx
::
literal
{
si
,
vi
});
auto
pu
=
mm
->
add_parameter
(
"update"
,
su
);
auto
r
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"scatter"
,
{{
"axis"
,
-
2
}}),
pd
,
li
,
pu
);
auto
r
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"scatter
_none
"
,
{{
"axis"
,
-
2
}}),
pd
,
li
,
pu
);
mm
->
add_return
({
r
});
return
p
;
...
...
test/verify/test_sqrt_half1.cpp
0 → 100644
View file @
2f268bc2
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
// math op on half-precision float with odd size tensor can't fit half2 packing
struct
test_sqrt_half1
:
verify_program
<
test_sqrt_half1
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
s
{
migraphx
::
shape
::
half_type
,
{
5
}};
auto
param
=
mm
->
add_parameter
(
"x"
,
s
);
auto
param_abs
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"abs"
),
param
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"sqrt"
),
param_abs
);
return
p
;
}
};
test/verify/test_sqrt_half2.cpp
0 → 100644
View file @
2f268bc2
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
// math op on half-precision float with tensor size that's divisible by 2,
// but not divisible by 4
struct
test_sqrt_half2
:
verify_program
<
test_sqrt_half2
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
s
{
migraphx
::
shape
::
half_type
,
{
6
}};
auto
param
=
mm
->
add_parameter
(
"x"
,
s
);
auto
param_abs
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"abs"
),
param
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"sqrt"
),
param_abs
);
return
p
;
}
};
test/verify/test_sqrt_half4.cpp
0 → 100644
View file @
2f268bc2
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
// math op on half-precision float with tensor size that fits into half4 packing
struct
test_sqrt_half4
:
verify_program
<
test_sqrt_half4
>
{
migraphx
::
program
create_program
()
const
{
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
migraphx
::
shape
s
{
migraphx
::
shape
::
half_type
,
{
8
}};
auto
param
=
mm
->
add_parameter
(
"x"
,
s
);
auto
param_abs
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"abs"
),
param
);
mm
->
add_instruction
(
migraphx
::
make_op
(
"sqrt"
),
param_abs
);
return
p
;
}
};
tools/install_prereqs.sh
View file @
2f268bc2
...
...
@@ -4,12 +4,20 @@
set
-e
#install pip3, rocm-cmake, rocblas and miopen
apt update
&&
apt
install
-y
python3-pip rocm-cmake rocblas miopen-hip openmp-extras
export
LC_ALL
=
C.UTF-8
export
LANG
=
C.UTF-8
# Need pip3 and Python headers to build dependencies
apt update
&&
apt
install
-y
python3-pip python3-dev cmake rocm-cmake rocblas miopen-hip openmp-extras
# Needed for cmake to build various pip packages
pip3
install
setuptools wheel
# install rbuild to build dependencies
pip3
install
https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
PREFIX
=
/usr/local
REQ_FILE_DIR
=
""
if
[
"$#"
-ge
2
]
;
then
...
...
@@ -19,7 +27,7 @@ elif [ "$#" -eq 1 ]; then
PREFIX
=
$1
fi
echo
"Dependencies are install at
$PREFIX
"
echo
"Dependencies are install
ed
at
$PREFIX
"
# Install deps with rbuild
rbuild prepare
-d
$PREFIX
-s
develop
...
...
@@ -27,3 +35,5 @@ rbuild prepare -d $PREFIX -s develop
# install onnx package for unit tests
pip3
install
onnx
==
1.8.1
numpy
==
1.18.5
typing
==
3.7.4
pytest
==
6.0.1
packaging
==
16.8
# pin version of protobuf in Python for onnx runtime unit tests
pip3
install
protobuf
==
3.20.0
Prev
1
…
7
8
9
10
11
Next
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