Skip to content

Commit

Permalink
Upgrade CI environment to 5.3.0 (#1198)
Browse files Browse the repository at this point in the history
Upgraded Dockerfiles and fixed tidy issues to make Ubuntu 20.04 and ROCm 5.3.0 the default
  • Loading branch information
causten authored Oct 27, 2022
1 parent 0d841de commit 4b1c1c4
Show file tree
Hide file tree
Showing 23 changed files with 29 additions and 40 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ci.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
with:
access_token: ${{ github.token }}
tidy:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Free space
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
make -j2 -k onnx-proto tf-proto tidy
cppcheck:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Free space
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
make -j2 cppcheck
format:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Free space
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
| xargs -n 1 -P 1 -I{} -t sh -c 'yapf {} | diff - {}'
pyflakes:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Free space
Expand All @@ -163,7 +163,7 @@ jobs:
mypy tools/api.py
licensing:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Free space
Expand All @@ -190,7 +190,6 @@ jobs:
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
configuration:
- debug
Expand All @@ -204,7 +203,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: 3.7
- name: Cache dependencies
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
Expand Down Expand Up @@ -287,7 +286,6 @@ jobs:
strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
configuration:
- debug
Expand All @@ -301,7 +299,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
python-version: 3.7
- name: Cache dependencies
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ rocm_enable_clang_tidy(
hicpp-signed-bitwise
llvm-namespace-comment
misc-*
-misc-confusable-identifiers
modernize-*
performance-*
readability-*
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.2/ ubuntu main > /etc/apt/sources.list.d/rocm.list'
RUN sh -c 'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/5.3/ ubuntu main > /etc/apt/sources.list.d/rocm.list'

# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
Expand Down Expand Up @@ -71,7 +71,7 @@ RUN /download_models.sh && rm /download_models.sh

# Install latest ccache version
RUN cget -p $PREFIX install facebook/[email protected] -X subdir -DCMAKE_DIR=build/cmake
RUN cget -p $PREFIX install [email protected]
RUN cget -p $PREFIX install [email protected] -DENABLE_TESTING=OFF

# Install newer cmake for onnx runtime
RUN cget -p /opt/cmake install kitware/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#####################################################################################
ROCmSoftwarePlatform/rocm-recipes
facebook/[email protected] -X subdir -DCMAKE_DIR=build/cmake
[email protected]
[email protected] -DENABLE_TESTING=OFF
pcre,pfultz2/[email protected] -H sha256:d6f7182602a775a7d500a0cedca6449af0400c6493951513046d17615ed0bf11
danmar/[email protected] -DHAVE_RULES=1
RadeonOpenCompute/rocm-cmake@1ebf7e7bc61bb5e949c171562b421264065230a7 --build
Expand Down
2 changes: 1 addition & 1 deletion hip-clang.docker
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.2/ ubuntu main > /etc/apt/sources.list.d/rocm.list'
RUN sh -c 'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/5.3/ ubuntu main > /etc/apt/sources.list.d/rocm.list'

# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
Expand Down
2 changes: 1 addition & 1 deletion src/fuse_pointwise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static literal get_scalar(instruction_ref ins)
if(ins->name() == "contiguous")
return get_scalar(ins->inputs().front());
const auto& s = ins->get_shape();
if(not(s.elements() == 1 or s.scalar()))
if(s.elements() != 1 && not(s.scalar()))
return {};
if(not ins->can_eval())
return {};
Expand Down
7 changes: 4 additions & 3 deletions src/include/migraphx/op/convolution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ struct convolution

void check_attribute_size() const
{
if(not((padding.size() == stride.size() or (padding.size() / 2) == stride.size()) and
stride.size() == dilation.size()))
if((padding.size() != stride.size() and (padding.size() / 2) != stride.size()) or
stride.size() != dilation.size())
{
MIGRAPHX_THROW("CONVOLUTION: inconsistent attribute sizes");
}
Expand All @@ -74,7 +74,8 @@ struct convolution
// num of dims of input and attribute should match
const auto input_size = inputs[0].max_lens().size();
const auto padding_size = padding.size();
if(not(input_size == padding_size / 2 + 2 or input_size == padding_size + 2))

if(input_size != padding_size / 2 + 2 && input_size != padding_size + 2)
{
MIGRAPHX_THROW("CONVOLUTION: input and attribute size mismatch!");
}
Expand Down
4 changes: 2 additions & 2 deletions src/include/migraphx/op/deconvolution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ struct deconvolution

void check_attribute_size() const
{
if(not((padding.size() == stride.size() or (padding.size() / 2) == stride.size()) and
stride.size() == dilation.size()))
if((padding.size() != stride.size() and (padding.size() / 2) != stride.size()) or
stride.size() != dilation.size())
{
MIGRAPHX_THROW("deconvolution: inconsistent attribute sizes");
}
Expand Down
6 changes: 3 additions & 3 deletions src/include/migraphx/op/pooling.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ struct pooling

void check_attribute_size() const
{
if(not((padding.size() == stride.size() or (padding.size() / 2) == stride.size()) and
stride.size() == lengths.size()))
if((padding.size() != stride.size() and (padding.size() / 2) != stride.size()) or
stride.size() != lengths.size())
{
MIGRAPHX_THROW("POOLING: inconsistent attribute sizes");
}
Expand All @@ -83,7 +83,7 @@ struct pooling
size_t kdims = input_lens.size() - 2;
auto input_size = inputs[0].lens().size();
auto padding_size = padding.size();
if(not(input_size == padding_size / 2 + 2 or input_size == padding_size + 2))
if(input_size != padding_size / 2 + 2 and input_size != padding_size + 2)
{
MIGRAPHX_THROW("POOLING: input and attribute size mismatch!");
}
Expand Down
4 changes: 2 additions & 2 deletions src/include/migraphx/op/quant_convolution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ struct quant_convolution

void check_attribute_size() const
{
if(not((padding.size() == stride.size() or (padding.size() / 2) == stride.size()) and
stride.size() == dilation.size()))
if((padding.size() != stride.size() and (padding.size() / 2) != stride.size()) or
stride.size() != dilation.size())
{
MIGRAPHX_THROW("QUANT_CONVOLUTION: inconsistent attribute sizes");
}
Expand Down
1 change: 0 additions & 1 deletion src/load_save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <migraphx/file_buffer.hpp>
#include <migraphx/json.hpp>
#include <migraphx/msgpack.hpp>
#include <migraphx/file_buffer.hpp>
#include <fstream>

namespace migraphx {
Expand Down
1 change: 0 additions & 1 deletion src/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <migraphx/pass_manager.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/register_target.hpp>
#include <migraphx/make_op.hpp>
#include <migraphx/json.hpp>
#include <iostream>
#include <sstream>
Expand Down
2 changes: 1 addition & 1 deletion src/onnx/conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace onnx {

void recalc_conv_attributes(value& v, size_t kdims)
{
if(not(v["padding"].size() == kdims or v["padding"].size() == kdims * 2))
if(v["padding"].size() != kdims and v["padding"].size() != kdims * 2)
{
v["padding"].resize(kdims);
std::fill_n(v["padding"].begin(), kdims, 0);
Expand Down
3 changes: 0 additions & 3 deletions src/rewrite_rnn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
#include <migraphx/iterator_for.hpp>
#include <migraphx/dfor.hpp>
#include <migraphx/ranges.hpp>
#include <migraphx/op/common.hpp>
#include <migraphx/op/rnn_var_sl_last_output.hpp>
#include <migraphx/op/rnn_variable_seq_lens.hpp>

namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
Expand Down
2 changes: 1 addition & 1 deletion src/simplify_algebra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ MIGRAPHX_PRED_MATCHER(horiz_conv_dot, instruction_ref ins)
};
auto dots = std::count_if(ins->outputs().begin(), ins->outputs().end(), pred("dot"));
auto convs = std::count_if(ins->outputs().begin(), ins->outputs().end(), pred("convolution"));
return not(dots < 2 and convs < 2);
return (dots >= 2 or convs >= 2);
}

struct find_conv_dot_horiz_fusion
Expand Down
1 change: 0 additions & 1 deletion src/targets/cpu/target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include <migraphx/rewrite_quantization.hpp>
#include <migraphx/rewrite_rnn.hpp>
#include <migraphx/schedule.hpp>
#include <migraphx/memory_coloring.hpp>
#include <migraphx/simplify_algebra.hpp>
#include <migraphx/simplify_qdq.hpp>
#include <migraphx/simplify_reshapes.hpp>
Expand Down
4 changes: 2 additions & 2 deletions src/targets/gpu/hip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ argument register_on_gpu(const argument& arg)
{
auto arg_shared = arg.share();
auto p = register_on_gpu(arg_shared.data(), arg_shared.get_shape().bytes());
return {arg_shared.get_shape(),
[p, a = std::move(arg_shared)]() mutable { return get_device_ptr(p.get()); }};
auto s = arg_shared.get_shape();
return {s, [p, a = std::move(arg_shared)]() mutable { return get_device_ptr(p.get()); }};
}

argument to_gpu(const argument& arg, bool host)
Expand Down
2 changes: 1 addition & 1 deletion test/gpu/literal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ void gpu_literal_test()
}
}

int main() { gpu_literal_test(); }
int main() { gpu_literal_test(); } // NOLINT (bugprone-exception-escape)
1 change: 0 additions & 1 deletion test/gpu/quantization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <migraphx/ref/target.hpp>
#include <migraphx/gpu/target.hpp>
#include <migraphx/verify.hpp>
#include <migraphx/quantization.hpp>
#include <migraphx/dead_code_elimination.hpp>
#include <migraphx/propagate_constant.hpp>
#include <migraphx/pass_manager.hpp>
Expand Down
1 change: 0 additions & 1 deletion test/onnx/onnx_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
#include <migraphx/op/lrn.hpp>
#include <migraphx/op/reshape.hpp>
#include <migraphx/op/unknown.hpp>
#include <random>

#include <migraphx/serialize.hpp>

Expand Down
1 change: 0 additions & 1 deletion test/operators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <migraphx/module.hpp>
#include <sstream>
#include <string>
#include <migraphx/make_op.hpp>

#include <migraphx/serialize.hpp>

Expand Down
1 change: 0 additions & 1 deletion test/ref_ops_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <migraphx/instruction.hpp>
#include <migraphx/quantization.hpp>
#include <migraphx/ref/target.hpp>
#include <migraphx/quantization.hpp>
#include <migraphx/verify.hpp>
#include <migraphx/onnx.hpp>
#include <migraphx/make_op.hpp>
Expand Down
1 change: 0 additions & 1 deletion test/simplify_qdq_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <migraphx/matcher.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/verify.hpp>
#include <migraphx/ref/target.hpp>
#include <migraphx/apply_alpha_beta.hpp>

bool is_convolution(const migraphx::instruction& ins) { return ins.name() == "convolution"; }
Expand Down

0 comments on commit 4b1c1c4

Please sign in to comment.