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
07bef2a0
Unverified
Commit
07bef2a0
authored
Sep 28, 2023
by
Ted Themistokleous
Committed by
GitHub
Sep 28, 2023
Browse files
Merge branch 'develop' into enable_navi_32_ci
parents
fc60486e
dcc7b0a5
Changes
135
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
92 additions
and
47 deletions
+92
-47
.github/workflows/benchmark.yaml
.github/workflows/benchmark.yaml
+1
-1
.github/workflows/ci.yaml
.github/workflows/ci.yaml
+8
-0
.github/workflows/performance.yaml
.github/workflows/performance.yaml
+2
-2
.gitignore
.gitignore
+3
-0
CMakeLists.txt
CMakeLists.txt
+2
-0
Dockerfile
Dockerfile
+1
-1
Jenkinsfile
Jenkinsfile
+8
-7
docs/.sphinx/requirements.txt
docs/.sphinx/requirements.txt
+2
-2
docs/dev_intro.rst
docs/dev_intro.rst
+1
-1
docs/driver.rst
docs/driver.rst
+10
-2
examples/migraphx/migraphx_driver/README.md
examples/migraphx/migraphx_driver/README.md
+3
-1
hip-clang.docker
hip-clang.docker
+1
-1
rbuild.ini
rbuild.ini
+9
-0
src/CMakeLists.txt
src/CMakeLists.txt
+1
-0
src/auto_contiguous.cpp
src/auto_contiguous.cpp
+0
-1
src/driver/main.cpp
src/driver/main.cpp
+11
-5
src/driver/verify.cpp
src/driver/verify.cpp
+15
-16
src/driver/verify.hpp
src/driver/verify.hpp
+4
-3
src/include/migraphx/instruction.hpp
src/include/migraphx/instruction.hpp
+1
-0
src/include/migraphx/op/allocate.hpp
src/include/migraphx/op/allocate.hpp
+9
-4
No files found.
.github/workflows/benchmark.yaml
View file @
07bef2a0
...
...
@@ -7,7 +7,7 @@ jobs:
benchmark
:
uses
:
ROCmSoftwarePlatform/actions/.github/workflows/benchmarks.yml@main
with
:
rocm_version
:
5.
2
rocm_version
:
5.
7
script_repo
:
migraphx-benchmark/benchmark-utils
result_path
:
/usr/share/migraphx/test-results
result_repo
:
ROCmSoftwarePlatform/comparison-results
...
...
.github/workflows/ci.yaml
View file @
07bef2a0
...
...
@@ -142,6 +142,7 @@ jobs:
-DROCM_ENABLE_GH_ANNOTATIONS=On \
-DCLANG_TIDY_DEPEND_ON_TARGET=Off \
-DCLANG_TIDY_CACHE=/data/tidy-cache \
-DGPU_TARGETS=gfx908 \
..
make -j$(nproc) -k onnx-proto tf-proto tidy
...
...
@@ -191,6 +192,7 @@ jobs:
-DCPPCHECK_BUILD_DIR=/data/cppcheck-cache \
-DBUILD_DEV=On \
-DROCM_ENABLE_GH_ANNOTATIONS=On \
-DGPU_TARGETS=gfx908 \
..
make -j$(nproc) cppcheck
...
...
@@ -227,6 +229,7 @@ jobs:
-
name
:
Free space
uses
:
jlumbroso/free-disk-space@main
continue-on-error
:
true
with
:
tool-cache
:
true
android
:
true
...
...
@@ -279,6 +282,7 @@ jobs:
-DBUILD_DEV=On \
-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache \
-DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache \
-DGPU_TARGETS=gfx908 \
..
make -j$(nproc) tests driver
...
...
@@ -305,6 +309,7 @@ jobs:
steps
:
-
name
:
Free space
uses
:
jlumbroso/free-disk-space@main
continue-on-error
:
true
with
:
tool-cache
:
true
android
:
true
...
...
@@ -335,6 +340,7 @@ jobs:
steps
:
-
name
:
Free space
uses
:
jlumbroso/free-disk-space@main
continue-on-error
:
true
with
:
tool-cache
:
true
android
:
true
...
...
@@ -375,6 +381,7 @@ jobs:
steps
:
-
name
:
Free space
uses
:
jlumbroso/free-disk-space@main
continue-on-error
:
true
with
:
tool-cache
:
true
android
:
true
...
...
@@ -493,6 +500,7 @@ jobs:
steps
:
-
name
:
Free space
uses
:
jlumbroso/free-disk-space@main
continue-on-error
:
true
with
:
tool-cache
:
true
android
:
true
...
...
.github/workflows/performance.yaml
View file @
07bef2a0
...
...
@@ -12,7 +12,7 @@ on:
rocm_release
:
description
:
ROCm Version
required
:
true
default
:
'
5.
6
'
default
:
'
5.
7
'
performance_reports_repo
:
description
:
Repository where performance reports are stored
required
:
true
...
...
@@ -50,7 +50,7 @@ jobs:
release
:
uses
:
ROCmSoftwarePlatform/migraphx-benchmark/.github/workflows/perf-test.yml@main
with
:
rocm_release
:
${{ github.event.inputs.rocm_release || '5.
6
' }}
rocm_release
:
${{ github.event.inputs.rocm_release || '5.
7
' }}
result_number
:
${{ github.event.inputs.result_number || '10' }}
flags
:
${{ github.event.inputs.flags || '-r' }}
performance_reports_repo
:
${{ github.event.inputs.performance_reports_repo || 'ROCmSoftwarePlatform/migraphx-reports' }}
...
...
.gitignore
View file @
07bef2a0
...
...
@@ -80,3 +80,6 @@ docs/html
cmake-build*/
build*/
# Recommended location to install rbuild dependencies from README.md
depend
CMakeLists.txt
View file @
07bef2a0
...
...
@@ -162,6 +162,8 @@ rocm_enable_clang_tidy(
-cppcoreguidelines-pro-type-vararg
-cppcoreguidelines-special-member-functions
-cppcoreguidelines-virtual-class-destructor
-cppcoreguidelines-avoid-capture-default-when-capturing-this
-cppcoreguidelines-rvalue-reference-param-not-moved
-google-readability-*
-google-runtime-int
-google-runtime-references
...
...
Dockerfile
View file @
07bef2a0
...
...
@@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y gnupg2 --no-install-recommends curl &&
curl
-sL
http://repo.radeon.com/rocm/rocm.gpg.key | apt-key add -
# Add rocm repository
RUN
sh
-c
'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/5.
6
/ focal main > /etc/apt/sources.list.d/rocm.list'
RUN
sh
-c
'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/5.
7
/ focal 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"
...
...
Jenkinsfile
View file @
07bef2a0
...
...
@@ -109,11 +109,11 @@ rocmtest clang_debug: rocmnode('cdna') { cmake_build ->
stage
(
'hipRTC Debug'
)
{
def
sanitizers
=
"undefined"
def
debug_flags
=
"-g -O2 -fsanitize=${sanitizers} -fno-sanitize-recover=${sanitizers}"
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_PYTHON=Off -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags}' -DCMAKE_C_FLAGS_DEBUG='${debug_flags}' -DMIGRAPHX_USE_HIPRTC=On"
,
gpu_debug:
true
)
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_PYTHON=Off -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags}' -DCMAKE_C_FLAGS_DEBUG='${debug_flags}' -DMIGRAPHX_USE_HIPRTC=On
-DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
"
,
gpu_debug:
true
)
}
},
clang_release:
rocmnode
(
'
cdna
'
)
{
cmake_build
->
},
clang_release:
rocmnode
(
'
mi100+
'
)
{
cmake_build
->
stage
(
'Hip Clang Release'
)
{
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=release"
)
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=release
-DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
"
)
stash
includes:
'build/*.deb'
,
name:
'migraphx-package'
}
// }, hidden_symbols: rocmnode('cdna') { cmake_build ->
...
...
@@ -122,7 +122,7 @@ rocmtest clang_debug: rocmnode('cdna') { cmake_build ->
// }
},
all_targets_debug
:
rocmnode
(
'cdna'
)
{
cmake_build
->
stage
(
'All targets Release'
)
{
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=release -DMIGRAPHX_ENABLE_GPU=On -DMIGRAPHX_ENABLE_CPU=On -DMIGRAPHX_ENABLE_FPGA=On"
)
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=release -DMIGRAPHX_ENABLE_GPU=On -DMIGRAPHX_ENABLE_CPU=On -DMIGRAPHX_ENABLE_FPGA=On
-DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
"
)
}
},
mlir_debug:
rocmnode
(
'cdna'
)
{
cmake_build
->
stage
(
'MLIR Debug'
)
{
...
...
@@ -131,13 +131,13 @@ rocmtest clang_debug: rocmnode('cdna') { cmake_build ->
// Note: the -fno-sanitize= is copied from upstream LLVM_UBSAN_FLAGS.
def
debug_flags_cxx
=
"-g -O2 -fsanitize=${sanitizers} -fno-sanitize=vptr,function -fno-sanitize-recover=${sanitizers}"
def
debug_flags
=
"-g -O2 -fsanitize=${sanitizers} -fno-sanitize=vptr -fno-sanitize-recover=${sanitizers}"
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_PYTHON=Off -DMIGRAPHX_ENABLE_MLIR=On -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags_cxx}' -DCMAKE_C_FLAGS_DEBUG='${debug_flags}'"
)
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_PYTHON=Off -DMIGRAPHX_ENABLE_MLIR=On -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags_cxx}' -DCMAKE_C_FLAGS_DEBUG='${debug_flags}'
-DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
"
)
}
}
},
ck_release:
rocmnode
(
'mi100+'
)
{
cmake_build
->
stage
(
'CK Release'
)
{
withEnv
([
'MIGRAPHX_ENABLE_CK=1'
,
'MIGRAPHX_TUNE_CK=1'
])
{
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=release"
)
cmake_build
(
flags:
"-DCMAKE_BUILD_TYPE=release
-DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
"
)
}
}
},
clang_asan:
rocmnode
(
'nogpu'
)
{
cmake_build
->
...
...
@@ -163,13 +163,14 @@ def onnxnode(name, body) {
}
}
rocmtest
onnx:
onnxnode
(
'
cdna
'
)
{
cmake_build
->
rocmtest
onnx:
onnxnode
(
'
mi100+
'
)
{
cmake_build
->
stage
(
"Onnx runtime"
)
{
sh
'''
apt install half
#ls -lR
md5sum ./build/*.deb
dpkg -i ./build/*.deb
env
cd /onnxruntime && ./build_and_test_onnxrt.sh
'''
}
...
...
docs/.sphinx/requirements.txt
View file @
07bef2a0
...
...
@@ -21,7 +21,7 @@ charset-normalizer==3.1.0
# via requests
click==8.1.3
# via sphinx-external-toc
cryptography==41.0.
3
cryptography==41.0.
4
# via pyjwt
deprecated==1.2.13
# via pygithub
...
...
@@ -87,7 +87,7 @@ requests==2.28.2
# via
# pygithub
# sphinx
rocm-docs-core
>
=0.2
0.0
rocm-docs-core
=
=0.2
4.2
# via -r requirements.in
smmap==5.0.0
# via gitdb
...
...
docs/dev_intro.rst
View file @
07bef2a0
...
...
@@ -131,7 +131,7 @@ In this case, we can create `argument <migraphx::argument>` objects directly fro
std::vector<float> results_vector(64);
result.visit([&](auto output) { results_vector.assign(output.begin(), output.end()); });
EXPECT(migraphx::verify::verify_range(results_vector, sol));
EXPECT(migraphx::verify::verify_
rms_
range(results_vector, sol));
An `argument <migraphx::argument>` can handle memory buffers from either the GPU or the CPU.
By default when running the `program <migraphx::program>`, buffers are allocated on the corresponding target.
...
...
docs/driver.rst
View file @
07bef2a0
...
...
@@ -50,9 +50,17 @@ Runs reference and CPU or GPU implementations and checks outputs for consistency
.. include:: ./driver/compile.rst
.. option:: --
tolerance
[double]
.. option:: --
rms-tol
[double]
Tolerance for errors (Default: 80)
Tolerance for RMS error (Default: 0.001)
.. option:: --atol [double]
Tolerance for elementwise absolute difference (Default: 0.001)
.. option:: --rtol [double]
Tolerance for elementwise relative difference (Default: 0.001)
.. option:: -i, --per-instruction
...
...
examples/migraphx/migraphx_driver/README.md
View file @
07bef2a0
...
...
@@ -55,7 +55,9 @@ See below for a comprehensive list of commands and option arguments, as well as
| --exhaustive-tune | Enable exhaustive search to find fastest kernel |
| --fp16 | Quantize for fp16 |
| --int8 | Quantize for int8 |
| --tolerance | Tolerance for errors |
| --rms-tol | Tolerance for the RMS error (Default: 0.001) |
| --atol | Tolerance for elementwise absolute difference (Default: 0.001) |
| --rtol | Tolerance for elementwise relative difference (Default: 0.001) |
| --per-instruction
\|
-i | Verify each instruction |
| --reduce
\|
-r | Reduce program and verify |
| --iterations
\|
-n | Number of iterations to run for perf report |
...
...
hip-clang.docker
View file @
07bef2a0
...
...
@@ -6,7 +6,7 @@ ARG PREFIX=/usr/local
RUN
dpkg
--add-architecture
i386
# Add rocm repository
RUN
sh
-c
'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/5.
6
/ focal main > /etc/apt/sources.list.d/rocm.list'
RUN
sh
-c
'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/5.
7
/ focal main > /etc/apt/sources.list.d/rocm.list'
# Install dependencies
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
--allow-unauthenticated
\
...
...
rbuild.ini
View file @
07bef2a0
...
...
@@ -29,3 +29,12 @@ define =
CMAKE_CXX_COMPILER_LAUNCHER
=
${deps_dir}/bin/ccache
MIGRAPHX_ENABLE_CPU
=
On
BUILD_DEV
=
On
[cibuild]
cxx
=
${rocm_path}/llvm/bin/clang++
cc
=
${rocm_path}/llvm/bin/clang
deps
=
-f
dev-requirements.txt
define
=
CMAKE_C_COMPILER_LAUNCHER
=
${deps_dir}/bin/ccache
CMAKE_CXX_COMPILER_LAUNCHER
=
${deps_dir}/bin/ccache
src/CMakeLists.txt
View file @
07bef2a0
...
...
@@ -197,6 +197,7 @@ register_migraphx_ops(
reduce_sum
relu
reshape
reshape_lazy
reverse
rnn
rnn_last_cell_output
...
...
src/auto_contiguous.cpp
View file @
07bef2a0
...
...
@@ -25,7 +25,6 @@
#include <migraphx/program.hpp>
#include <migraphx/instruction.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/iterator_for.hpp>
namespace
migraphx
{
...
...
src/driver/main.cpp
View file @
07bef2a0
...
...
@@ -536,13 +536,19 @@ struct params : command<params>
struct
verify
:
command
<
verify
>
{
compiler
c
;
double
tolerance
=
80
;
migraphx
::
verify
::
tolerance
tols
;
bool
per_instruction
=
false
;
bool
reduce
=
false
;
void
parse
(
argument_parser
&
ap
)
{
c
.
parse
(
ap
);
ap
(
tolerance
,
{
"--tolerance"
},
ap
.
help
(
"Tolerance for errors"
));
ap
(
tols
.
rms_tol
,
{
"--rms-tol"
},
ap
.
help
(
"Tolerance for the RMS error (Default: 0.001)"
));
ap
(
tols
.
atol
,
{
"--atol"
},
ap
.
help
(
"Tolerance for the elementwise absolute difference (Default: 0.001)"
));
ap
(
tols
.
rtol
,
{
"--rtol"
},
ap
.
help
(
"Tolerance for the elementwise relative difference (Default: 0.001)"
));
ap
(
per_instruction
,
{
"-i"
,
"--per-instruction"
},
ap
.
help
(
"Verify each instruction"
),
...
...
@@ -567,15 +573,15 @@ struct verify : command<verify>
if
(
per_instruction
)
{
verify_instructions
(
p
,
t
,
c
.
co
,
quantize
,
tol
erance
);
verify_instructions
(
p
,
t
,
c
.
co
,
quantize
,
tol
s
);
}
else
if
(
reduce
)
{
verify_reduced_program
(
p
,
t
,
c
.
co
,
quantize
,
m
,
tol
erance
);
verify_reduced_program
(
p
,
t
,
c
.
co
,
quantize
,
m
,
tol
s
);
}
else
{
verify_program
(
c
.
l
.
file
,
p
,
t
,
c
.
co
,
quantize
,
m
,
tol
erance
);
verify_program
(
c
.
l
.
file
,
p
,
t
,
c
.
co
,
quantize
,
m
,
tol
s
);
}
}
};
...
...
src/driver/verify.cpp
View file @
07bef2a0
...
...
@@ -77,24 +77,24 @@ void verify_program(const std::string& name,
compile_options
options
,
precision
quantize
,
const
parameter_map
&
inputs
,
double
tolerance
)
verify
::
tolerance
tols
)
{
auto
x
=
run_ref
(
p
,
inputs
);
auto
y
=
run_target
(
p
,
t
,
options
,
quantize
,
inputs
);
auto
ref_outs
=
run_ref
(
p
,
inputs
);
auto
target_outs
=
run_target
(
p
,
t
,
options
,
quantize
,
inputs
);
std
::
size_t
output_num
=
x
.
size
();
std
::
size_t
output_num
=
ref_outs
.
size
();
for
(
std
::
size_t
i
=
0
;
i
<
output_num
;
++
i
)
{
if
(
x
[
i
].
get_shape
().
type
()
!=
y
[
i
].
get_shape
().
type
()
or
x
[
i
].
get_shape
().
lens
()
!=
y
[
i
].
get_shape
().
lens
())
if
(
ref_outs
[
i
].
get_shape
().
type
()
!=
target_outs
[
i
].
get_shape
().
type
()
or
ref_outs
[
i
].
get_shape
().
lens
()
!=
target_outs
[
i
].
get_shape
().
lens
())
{
std
::
cout
<<
"FAILED: "
<<
name
<<
std
::
endl
;
std
::
cout
<<
"Shape mismatch {"
<<
x
[
i
].
get_shape
()
<<
"} != {"
<<
y
[
i
].
get_shape
()
<<
"}"
<<
std
::
endl
;
std
::
cout
<<
"Shape mismatch {"
<<
ref_outs
[
i
].
get_shape
()
<<
"} != {"
<<
target_outs
[
i
].
get_shape
()
<<
"}"
<<
std
::
endl
;
}
else
{
verify_args
(
name
,
x
[
i
],
y
[
i
],
tol
erance
);
verify_args
(
name
,
target_outs
[
i
],
verify
::
expected
{
ref_outs
[
i
]
}
,
tol
s
);
}
}
}
...
...
@@ -103,7 +103,7 @@ void verify_instructions(const program& prog,
const
target
&
t
,
compile_options
options
,
precision
quantize
,
double
tolerance
)
verify
::
tolerance
tols
)
{
const
auto
*
mm_prog
=
prog
.
get_main_module
();
for
(
auto
&&
ins
:
(
*
mm_prog
))
...
...
@@ -134,8 +134,7 @@ void verify_instructions(const program& prog,
{
std
::
cout
<<
"Verify: "
<<
ins
.
name
()
<<
std
::
endl
;
std
::
cout
<<
p
<<
std
::
endl
;
verify_program
(
ins
.
name
(),
p
,
t
,
options
,
quantize
,
create_param_map
(
p
,
false
),
tolerance
);
verify_program
(
ins
.
name
(),
p
,
t
,
options
,
quantize
,
create_param_map
(
p
,
false
),
tols
);
}
catch
(...)
{
...
...
@@ -151,7 +150,7 @@ void verify_reduced(program p,
compile_options
options
,
precision
quantize
,
const
parameter_map
&
inputs
,
double
tolerance
)
verify
::
tolerance
tols
)
{
auto
*
mm
=
p
.
get_main_module
();
auto
last
=
std
::
prev
(
mm
->
end
(),
n
);
...
...
@@ -160,7 +159,7 @@ void verify_reduced(program p,
std
::
cout
<<
p
<<
std
::
endl
;
try
{
verify_program
(
std
::
to_string
(
n
),
p
,
t
,
options
,
quantize
,
inputs
,
tol
erance
);
verify_program
(
std
::
to_string
(
n
),
p
,
t
,
options
,
quantize
,
inputs
,
tol
s
);
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -174,7 +173,7 @@ void verify_reduced_program(const program& p,
compile_options
options
,
precision
quantize
,
const
parameter_map
&
inputs
,
double
tolerance
)
verify
::
tolerance
tols
)
{
const
auto
*
mm
=
p
.
get_main_module
();
auto
n
=
std
::
distance
(
mm
->
begin
(),
mm
->
end
());
...
...
@@ -187,7 +186,7 @@ void verify_reduced_program(const program& p,
std
::
cout
<<
"Skip: "
<<
i
<<
std
::
endl
;
continue
;
}
verify_reduced
(
p
,
i
,
t
,
options
,
quantize
,
inputs
,
tol
erance
);
verify_reduced
(
p
,
i
,
t
,
options
,
quantize
,
inputs
,
tol
s
);
}
}
...
...
src/driver/verify.hpp
View file @
07bef2a0
...
...
@@ -26,6 +26,7 @@
#include "precision.hpp"
#include <migraphx/program.hpp>
#include <migraphx/verify.hpp>
namespace
migraphx
{
namespace
driver
{
...
...
@@ -37,18 +38,18 @@ void verify_program(const std::string& name,
compile_options
options
=
compile_options
{},
precision
quantize
=
precision
::
fp32
,
const
parameter_map
&
inputs
=
{},
double
tolerance
=
100
);
verify
::
tolerance
tols
=
verify
::
tolerance
{}
);
void
verify_instructions
(
const
program
&
prog
,
const
target
&
t
,
compile_options
options
=
compile_options
{},
precision
quantize
=
precision
::
fp32
,
double
tolerance
=
80
);
verify
::
tolerance
tols
=
verify
::
tolerance
{}
);
void
verify_reduced_program
(
const
program
&
p
,
const
target
&
t
,
compile_options
options
=
compile_options
{},
precision
quantize
=
precision
::
fp32
,
const
parameter_map
&
inputs
=
{},
double
tolerance
=
80
);
verify
::
tolerance
tols
=
verify
::
tolerance
{}
);
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace driver
...
...
src/include/migraphx/instruction.hpp
View file @
07bef2a0
...
...
@@ -81,6 +81,7 @@ struct MIGRAPHX_EXPORT instruction
const
std
::
vector
<
module_ref
>&
module_inputs
()
const
;
/// Where this instruction is used as an input to another instruction
const
std
::
vector
<
instruction_ref
>&
outputs
()
const
;
friend
bool
operator
==
(
const
instruction
&
x
,
const
instruction
&
y
);
...
...
src/include/migraphx/op/allocate.hpp
View file @
07bef2a0
...
...
@@ -49,17 +49,22 @@ struct allocate
shape
compute_shape
(
const
std
::
vector
<
shape
>&
inputs
)
const
{
migraphx
::
check_shapes
{
inputs
,
*
this
,
true
}.
has
(
0
,
1
);
// check if shape attribute is not default
if
(
s
!=
shape
())
{
if
(
inputs
.
size
()
==
1
)
{
migraphx
::
check_shapes
{
inputs
,
*
this
,
false
}.
only_dims
(
1
);
}
else
{
migraphx
::
check_shapes
{
inputs
,
*
this
,
false
}.
has
(
0
);
}
return
s
;
}
else
{
migraphx
::
check_shapes
{
inputs
,
*
this
,
false
}.
has
(
1
).
only_dims
(
1
);
const
auto
&
out_dims
=
inputs
.
at
(
0
);
assert
(
not
out_dims
.
dynamic
());
assert
(
out_dims
.
ndim
()
==
1
);
std
::
size_t
max_val
=
std
::
numeric_limits
<
std
::
size_t
>::
max
();
std
::
vector
<
shape
::
dynamic_dimension
>
dyn_dims
(
out_dims
.
lens
().
at
(
0
),
shape
::
dynamic_dimension
{
0
,
max_val
});
...
...
Prev
1
2
3
4
5
…
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