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
3984358b
"tests/git@developer.sourcefind.cn:SIYIXNI/vllm.git" did not exist on "1951f47847aae1746f318435dfb746d22f73b4ed"
Commit
3984358b
authored
Aug 15, 2022
by
turneram
Browse files
Merge remote-tracking branch 'origin/develop' into unbatch-horiz-dot
parents
b60895cd
bab9502a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
Dockerfile
Dockerfile
+1
-1
src/targets/gpu/mlir.cpp
src/targets/gpu/mlir.cpp
+12
-2
test/onnx/onnx_test.cpp
test/onnx/onnx_test.cpp
+0
-4
No files found.
Dockerfile
View file @
3984358b
...
@@ -77,7 +77,7 @@ RUN cget -p $PREFIX install ccache@v4.1
...
@@ -77,7 +77,7 @@ RUN cget -p $PREFIX install ccache@v4.1
RUN
cget
-p
/opt/cmake
install
kitware/cmake@v3.13.4
RUN
cget
-p
/opt/cmake
install
kitware/cmake@v3.13.4
ARG
ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG
ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG
ONNXRUNTIME_BRANCH=ma
ster
ARG
ONNXRUNTIME_BRANCH=ma
in
ARG
ONNXRUNTIME_COMMIT=24f1bd6156cf5968bbc76dfb0e801a9b9c56b9fc
ARG
ONNXRUNTIME_COMMIT=24f1bd6156cf5968bbc76dfb0e801a9b9c56b9fc
RUN
git clone
--single-branch
--branch
${
ONNXRUNTIME_BRANCH
}
--recursive
${
ONNXRUNTIME_REPO
}
onnxruntime
&&
\
RUN
git clone
--single-branch
--branch
${
ONNXRUNTIME_BRANCH
}
--recursive
${
ONNXRUNTIME_REPO
}
onnxruntime
&&
\
cd
onnxruntime
&&
\
cd
onnxruntime
&&
\
...
...
src/targets/gpu/mlir.cpp
View file @
3984358b
...
@@ -48,6 +48,10 @@
...
@@ -48,6 +48,10 @@
#include <deque>
#include <deque>
#include <variant>
#include <variant>
#if defined(MLIR_MIGRAPHX_DIALECT_API_VERSION) && MLIR_MIGRAPHX_DIALECT_API_VERSION >= 2
#define MIGRAPHX_MLIR_BARE_POINTER
#endif
namespace
migraphx
{
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
inline
namespace
MIGRAPHX_INLINE_NS
{
namespace
gpu
{
namespace
gpu
{
...
@@ -606,9 +610,15 @@ instruction_ref insert_mlir(module& m,
...
@@ -606,9 +610,15 @@ instruction_ref insert_mlir(module& m,
code_object_op
co
,
code_object_op
co
,
const
std
::
vector
<
instruction_ref
>&
inputs
)
const
std
::
vector
<
instruction_ref
>&
inputs
)
{
{
std
::
vector
<
instruction_ref
>
refs
;
std
::
vector
<
instruction_ref
>
refs
;
std
::
size_t
last
=
0
;
#ifdef MIGRAPHX_MLIR_BARE_POINTER
refs
.
reserve
(
inputs
.
size
());
std
::
copy
(
inputs
.
begin
(),
inputs
.
end
(),
std
::
back_inserter
(
refs
));
last
=
refs
.
size
()
-
1
;
#else
refs
.
reserve
(
inputs
.
size
()
*
15
);
refs
.
reserve
(
inputs
.
size
()
*
15
);
std
::
unordered_map
<
uint64_t
,
instruction_ref
>
literal_map
{};
std
::
unordered_map
<
uint64_t
,
instruction_ref
>
literal_map
{};
auto
get_literal
=
[
&
](
uint64_t
value
)
{
auto
get_literal
=
[
&
](
uint64_t
value
)
{
auto
fi
=
literal_map
.
find
(
value
);
auto
fi
=
literal_map
.
find
(
value
);
...
@@ -619,7 +629,6 @@ instruction_ref insert_mlir(module& m,
...
@@ -619,7 +629,6 @@ instruction_ref insert_mlir(module& m,
return
lit
;
return
lit
;
};
};
std
::
size_t
last
=
0
;
for
(
auto
input
:
inputs
)
for
(
auto
input
:
inputs
)
{
{
const
size_t
offset
=
0
;
const
size_t
offset
=
0
;
...
@@ -643,6 +652,7 @@ instruction_ref insert_mlir(module& m,
...
@@ -643,6 +652,7 @@ instruction_ref insert_mlir(module& m,
[
&
](
const
auto
&
lval
)
{
return
get_literal
(
lval
);
});
[
&
](
const
auto
&
lval
)
{
return
get_literal
(
lval
);
});
// refs.push_back(get_literal(1)); // G
// refs.push_back(get_literal(1)); // G
}
}
#endif
co
.
expected_inputs
=
to_shapes
(
refs
);
co
.
expected_inputs
=
to_shapes
(
refs
);
co
.
output_arg
=
last
;
co
.
output_arg
=
last
;
return
m
.
insert_instruction
(
ins
,
co
,
refs
);
return
m
.
insert_instruction
(
ins
,
co
,
refs
);
...
...
test/onnx/onnx_test.cpp
View file @
3984358b
...
@@ -954,13 +954,11 @@ TEST_CASE(conv_dynamic_img_same_upper)
...
@@ -954,13 +954,11 @@ TEST_CASE(conv_dynamic_img_same_upper)
TEST_CASE
(
conv_dynamic_kernel_same_lower
)
TEST_CASE
(
conv_dynamic_kernel_same_lower
)
{
{
std
::
cout
<<
"here1
\n
"
;
migraphx
::
program
p
;
migraphx
::
program
p
;
auto
*
mm
=
p
.
get_main_module
();
auto
*
mm
=
p
.
get_main_module
();
auto
l0
=
mm
->
add_parameter
(
"0"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
5
,
5
}});
auto
l0
=
mm
->
add_parameter
(
"0"
,
{
migraphx
::
shape
::
float_type
,
{
1
,
3
,
5
,
5
}});
auto
l1
=
mm
->
add_parameter
(
auto
l1
=
mm
->
add_parameter
(
"1"
,
{
migraphx
::
shape
::
float_type
,
{{
1
,
1
,
0
},
{
3
,
3
,
0
},
{
2
,
4
,
0
},
{
2
,
4
,
0
}}});
"1"
,
{
migraphx
::
shape
::
float_type
,
{{
1
,
1
,
0
},
{
3
,
3
,
0
},
{
2
,
4
,
0
},
{
2
,
4
,
0
}}});
std
::
cout
<<
"here2
\n
"
;
auto
c0
=
mm
->
add_instruction
(
auto
c0
=
mm
->
add_instruction
(
migraphx
::
make_op
(
"convolution"
,
migraphx
::
make_op
(
"convolution"
,
{{
"padding"
,
{
0
,
0
}},
{{
"padding"
,
{
0
,
0
}},
...
@@ -970,12 +968,10 @@ TEST_CASE(conv_dynamic_kernel_same_lower)
...
@@ -970,12 +968,10 @@ TEST_CASE(conv_dynamic_kernel_same_lower)
{
"use_dynamic_same_auto_pad"
,
true
}}),
{
"use_dynamic_same_auto_pad"
,
true
}}),
l0
,
l0
,
l1
);
l1
);
std
::
cout
<<
"here3
\n
"
;
mm
->
add_return
({
c0
});
mm
->
add_return
({
c0
});
migraphx
::
onnx_options
options
;
migraphx
::
onnx_options
options
;
options
.
default_dyn_dim_value
=
{
2
,
4
,
0
};
options
.
default_dyn_dim_value
=
{
2
,
4
,
0
};
std
::
cout
<<
"here
\n
"
;
auto
prog
=
migraphx
::
parse_onnx
(
"conv_dynamic_kernel_same_lower_test.onnx"
,
options
);
auto
prog
=
migraphx
::
parse_onnx
(
"conv_dynamic_kernel_same_lower_test.onnx"
,
options
);
EXPECT
(
p
==
prog
);
EXPECT
(
p
==
prog
);
}
}
...
...
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