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
0b3353d1
"vscode:/vscode.git/clone" did not exist on "b2589957f3ceaa47e34c3fa8586d8b15021618da"
Unverified
Commit
0b3353d1
authored
Aug 12, 2022
by
Chris Austen
Committed by
GitHub
Aug 12, 2022
Browse files
Merge branch 'develop' into jit-layernorm
parents
a1983e93
55cb7d3a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
Dockerfile
Dockerfile
+1
-1
src/targets/gpu/mlir.cpp
src/targets/gpu/mlir.cpp
+12
-2
No files found.
Dockerfile
View file @
0b3353d1
...
@@ -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 @
0b3353d1
...
@@ -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
);
...
...
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