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
9c91c08d
Unverified
Commit
9c91c08d
authored
Jul 07, 2023
by
Chris Austen
Committed by
GitHub
Jul 07, 2023
Browse files
Merge branch 'develop' into enable_navi_32_ci
parents
a56bb11d
c1b8c975
Changes
124
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
24 deletions
+169
-24
tools/docker/ubuntu_2204.dockerfile
tools/docker/ubuntu_2204.dockerfile
+127
-0
tools/include/operation.hpp
tools/include/operation.hpp
+5
-3
tools/include/target.hpp
tools/include/target.hpp
+34
-19
tools/install_prereqs.sh
tools/install_prereqs.sh
+3
-2
No files found.
tools/docker/ubuntu_2204.dockerfile
0 → 100644
View file @
9c91c08d
FROM
ubuntu:22.04
ARG
PREFIX=/usr/local
# Support multiarch
RUN
dpkg
--add-architecture
i386
# Install rocm key
RUN
apt-get update
&&
apt-get
install
-y
gnupg2
--no-install-recommends
curl
&&
\
curl
-fsSL
http://repo.radeon.com/rocm/rocm.gpg.key | gpg
--dearmor
-o
/etc/apt/trusted.gpg.d/rocm-keyring.gpg
# Add rocm repository
RUN
sh
-c
"echo 'deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] http://repo.radeon.com/rocm/apt/5.5 jammy main' > /etc/apt/sources.list.d/rocm.list"
# From docs.amd.com for installing rocm. Needed to install properly
RUN
sh
-c
"echo 'Package: *
\n
Pin: release o=repo.radeon.com
\n
Pin-priority: 600' > /etc/apt/preferences.d/rocm-pin-600"
# Install dependencies
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
--allow-unauthenticated
\
apt-utils
\
build-essential
\
#clang-format-10
\
cmake
\
curl
\
doxygen
\
#g++-7
\
gdb
\
git
\
lcov
\
locales
\
pkg-config
\
python3
\
python3-dev
\
python3-pip
\
software-properties-common
\
wget
\
rocm-device-libs
\
hip-base
\
libnuma-dev
\
miopen-hip
\
rocblas
\
hipfft
\
rocthrust
\
rocrand
\
hipsparse
\
rccl
\
rccl-dev
\
rocm-smi-lib
\
rocm-dev
\
roctracer-dev
\
hipcub
\
hipblas
\
hipify-clang
\
half
\
libssl-dev
\
zlib1g-dev
&&
\
apt-get clean
&&
\
rm
-rf
/var/lib/apt/lists/
*
# add this for roctracer dependancies
RUN
pip3
install
CppHeaderParser
# Workaround broken rocm packages
RUN
ln
-s
/opt/rocm-
*
/opt/rocm
RUN
echo
"/opt/rocm/lib"
>
/etc/ld.so.conf.d/rocm.conf
RUN
echo
"/opt/rocm/llvm/lib"
>
/etc/ld.so.conf.d/rocm-llvm.conf
RUN
ldconfig
RUN
locale-gen en_US.UTF-8
RUN
update-locale
LANG
=
en_US.UTF-8
ENV
LC_ALL=C.UTF-8
ENV
LANG=C.UTF-8
# Install dependencies
ADD
dev-requirements.txt /dev-requirements.txt
ADD
requirements.txt /requirements.txt
ADD
rbuild.ini /rbuild.ini
COPY
./tools/install_prereqs.sh /
RUN
/install_prereqs.sh /usr/local /
&&
rm
/install_prereqs.sh
RUN
test
-f
/usr/local/hash
||
exit
1
# Install yapf
RUN
pip3
install
yapf
==
0.28.0
# Install doc requirements
ADD
doc/requirements.txt /doc-requirements.txt
RUN
pip3
install
-r
/doc-requirements.txt
# Download real models to run onnx unit tests
ENV
ONNX_HOME=/.onnx
COPY
./tools/download_models.sh /
RUN
/download_models.sh
&&
rm
/download_models.sh
# Install latest ccache version
RUN
cget
-p
$PREFIX
install
facebook/zstd@v1.4.5
-X
subdir
-DCMAKE_DIR
=
build/cmake
RUN
cget
-p
$PREFIX
install
ccache@v4.1
-DENABLE_TESTING
=
OFF
RUN
cget
-p
/opt/cmake
install
kitware/cmake@v3.24.3
COPY
./test/onnx/.onnxrt-commit /
ARG
ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG
ONNXRUNTIME_BRANCH=main
ARG
ONNXRUNTIME_COMMIT
RUN
git clone
--single-branch
--branch
${
ONNXRUNTIME_BRANCH
}
--recursive
${
ONNXRUNTIME_REPO
}
onnxruntime
&&
\
cd
onnxruntime
&&
\
if
[
-z
"
$ONNXRUNTIME_COMMIT
"
]
;
then
git checkout
$(
cat
/.onnxrt-commit
)
;
else
git checkout
${
ONNXRUNTIME_COMMIT
}
;
fi
&&
\
/bin/sh /onnxruntime/dockerfiles/scripts/install_common_deps.sh
ADD
tools/build_and_test_onnxrt.sh /onnxruntime/build_and_test_onnxrt.sh
RUN
cget
-p
/usr/local
install
ROCmSoftwarePlatform/rocMLIR@a997d5f51314b45d7a4c04f1599966dcf53f9b4d
-DBUILD_MIXR_TARGET
=
On
-DLLVM_ENABLE_ZSTD
=
Off
-DLLVM_ENABLE_THREADS
=
Off
ENV
MIOPEN_FIND_DB_PATH=/tmp/miopen/find-db
ENV
MIOPEN_USER_DB_PATH=/tmp/miopen/user-db
ENV
LD_LIBRARY_PATH=$PREFIX/lib
# Setup ubsan environment to printstacktrace
ENV
UBSAN_OPTIONS=print_stacktrace=1
ENV
ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
RUN
ln
-s
/opt/rocm/llvm/bin/llvm-symbolizer /usr/bin/llvm-symbolizer
tools/include/operation.hpp
View file @
9c91c08d
...
...
@@ -261,11 +261,13 @@ auto compute_op(rank<1>,
template
<
class
T
,
class
F
>
argument
compute_op
(
rank
<
0
>
,
const
T
&
x
,
const
shape
&
,
const
std
::
vector
<
argument
>&
,
const
std
::
vector
<
module_ref
>&
,
const
shape
&
output
,
const
std
::
vector
<
argument
>&
inputs
,
const
std
::
vector
<
module_ref
>&
module_args
,
F
)
{
if
(
module_args
.
empty
())
return
compute_op
(
x
,
output
,
inputs
);
std
::
string
name
=
x
.
name
();
MIGRAPHX_THROW
(
"Not computable: "
+
name
);
}
...
...
tools/include/target.hpp
View file @
9c91c08d
...
...
@@ -45,6 +45,8 @@
namespace
migraphx
{
inline
namespace
MIGRAPHX_INLINE_NS
{
struct
value
;
#ifdef DOXYGEN
/// An interface for a compilation target
...
...
@@ -123,28 +125,41 @@ supported_segments target_find_supported(T&, const_module_ref, support_metric)
}
<%
interface
(
'
target
'
,
virtual
(
'
name
'
,
returns
=
'
std
::
string
'
,
const
=
True
),
virtual
(
'
get_passes
'
,
ctx
=
'
context
&
'
,
options
=
'
const
compile_options
&
'
,
returns
=
'
std
::
vector
<
pass
>
'
,
const
=
True
),
virtual
(
'
get_context
'
,
returns
=
'
context
'
,
const
=
True
),
virtual
(
'
find_supported
'
,
returns
=
'
supported_segments
'
,
mod
=
'
const_module_ref
'
,
m
=
'
support_metric
'
,
const
=
True
,
default
=
'
target_find_supported
'
),
virtual
(
'
copy_to
'
,
returns
=
'
argument
'
,
input
=
'
const
argument
&
'
,
const
=
True
,
default
=
'
copy_to_target
'
),
virtual
(
'
copy_from
'
,
returns
=
'
argument
'
,
input
=
'
const
argument
&
'
,
const
=
True
,
default
=
'
copy_from_target
'
),
virtual
(
'
allocate
'
,
s
=
'
const
shape
&
'
,
returns
=
'
argument
'
,
const
=
True
,
default
=
'
target_allocate
'
)
)
%>
interface
(
'
target
'
,
virtual
(
'
name
'
,
returns
=
'
std
::
string
'
,
const
=
True
),
virtual
(
'
get_passes
'
,
ctx
=
'
context
&
'
,
options
=
'
const
compile_options
&
'
,
returns
=
'
std
::
vector
<
pass
>
'
,
const
=
True
),
virtual
(
'
get_context
'
,
returns
=
'
context
'
,
const
=
True
),
virtual
(
'
find_supported
'
,
returns
=
'
supported_segments
'
,
mod
=
'
const_module_ref
'
,
m
=
'
support_metric
'
,
const
=
True
,
default
=
'
target_find_supported
'
),
virtual
(
'
copy_to
'
,
returns
=
'
argument
'
,
input
=
'
const
argument
&
'
,
const
=
True
,
default
=
'
copy_to_target
'
),
virtual
(
'
copy_from
'
,
returns
=
'
argument
'
,
input
=
'
const
argument
&
'
,
const
=
True
,
default
=
'
copy_from_target
'
),
virtual
(
'
allocate
'
,
s
=
'
const
shape
&
'
,
returns
=
'
argument
'
,
const
=
True
,
default
=
'
target_allocate
'
))
%>
#endif
void
migraphx_to_value
(
value
&
v
,
const
target
&
t
);
void
migraphx_from_value
(
const
value
&
v
,
target
&
t
);
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace migraphx
...
...
tools/install_prereqs.sh
View file @
9c91c08d
...
...
@@ -56,8 +56,9 @@ echo "Dependencies are installed at $PREFIX"
# Install deps with rbuild
rbuild prepare
-d
$PREFIX
-s
develop
# install onnx package for unit tests
export
CMAKE_ARGS
=
"-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
pip3
install
onnx
==
1.10.2
numpy
==
1.21.6
typing
==
3.7.4
pytest
==
6.0.1
packaging
==
23.0
# pin version of protobuf in Python for onnx runtime unit tests
# pin version of protobuf in Python for onnx runtime unit tests
between dist versions
pip3
install
protobuf
==
3.20.0
Prev
1
…
3
4
5
6
7
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