diff --git a/CMakeLists.txt b/CMakeLists.txt index 80354a13c2f..01105426633 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,8 +172,10 @@ rocm_enable_clang_tidy( -bugprone-easily-swappable-parameters -bugprone-implicit-widening-of-multiplication-result -bugprone-macro-parentheses + -bugprone-multi-level-implicit-pointer-conversion -bugprone-signed-char-misuse -bugprone-unchecked-optional-access + -bugprone-unused-local-non-trivial-variable # Disable the aliased reserved identifiers -cert-dcl37-c -cert-dcl51-cpp @@ -196,6 +198,7 @@ rocm_enable_clang_tidy( clang-analyzer-alpha.cplusplus.MismatchedIterator clang-analyzer-alpha.cplusplus.MisusedMovedObject -bugprone-switch-missing-default-case + -bugprone-empty-catch -clang-analyzer-optin.performance.Padding -clang-diagnostic-deprecated-declarations -clang-diagnostic-disabled-macro-expansion @@ -235,12 +238,15 @@ rocm_enable_clang_tidy( -modernize-use-transparent-functors -performance-avoid-endl -performance-type-promotion-in-math-fn + -performance-enum-size -readability-braces-around-statements + -readability-avoid-nested-conditional-operator -readability-convert-member-functions-to-static -readability-else-after-return -readability-function-cognitive-complexity -readability-identifier-length -readability-named-parameter + -readability-redundant-member-init -readability-redundant-string-init -readability-suspicious-call-argument -readability-uppercase-literal-suffix diff --git a/Dockerfile b/Dockerfile index bac45aa796e..53cf679bba7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y software-properties-common gnupg2 --no- 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/6.1.3/ jammy main > /etc/apt/sources.list.d/rocm.list' +RUN sh -c 'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/6.2/ 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: *\nPin: release o=repo.radeon.com\nPin-priority: 600' > /etc/apt/preferences.d/rocm-pin-600" diff --git a/hip-clang.docker b/hip-clang.docker index ef2fb6fdc51..dfc9a2d7af0 100755 --- a/hip-clang.docker +++ b/hip-clang.docker @@ -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/6.1.3/ focal main > /etc/apt/sources.list.d/rocm.list' +RUN sh -c 'echo deb [arch=amd64 trusted=yes] http://repo.radeon.com/rocm/apt/6.2/ 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: *\nPin: release o=repo.radeon.com\nPin-priority: 600' > /etc/apt/preferences.d/rocm-pin-600" @@ -28,6 +28,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow- wget \ rocm-device-libs \ hip-dev \ + hipcc \ libnuma-dev \ miopen-hip \ rocblas \ @@ -44,6 +45,9 @@ RUN ldconfig # Workaround broken miopen cmake files RUN sed -i 's,;/usr/lib/x86_64-linux-gnu/librt.so,,g' /opt/rocm/lib/cmake/miopen/miopen-targets.cmake +# Workaround for broken hip-clang +# RUN sed -i -e '/if(WIN32)/, /endif()/d' /opt/rocm/lib/cmake/hip/hip-config.cmake && sed -i -n 5p /opt/rocm/lib/cmake/hip/hip-config.cmake + ENV LC_ALL=C.UTF-8 ENV LANG=C.UTF-8 diff --git a/src/include/migraphx/layout_nhwc.hpp b/src/include/migraphx/layout_nhwc.hpp index 206e28e97c6..faf097a4d9d 100644 --- a/src/include/migraphx/layout_nhwc.hpp +++ b/src/include/migraphx/layout_nhwc.hpp @@ -1,7 +1,7 @@ /* * The MIT License (MIT) * - * Copyright (c) 2015-2023 Advanced Micro Devices, Inc. All rights reserved. + * Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/include/migraphx/operation.hpp b/src/include/migraphx/operation.hpp index f102320f8dd..af7c4d5ee04 100644 --- a/src/include/migraphx/operation.hpp +++ b/src/include/migraphx/operation.hpp @@ -130,8 +130,9 @@ auto operator==(const T& x, const U& y) -> decltype(x.name() == y.name()) } // namespace operation_operators template -auto compute_shape_op(rank<3>, const T& x, const std::vector& inputs) - -> decltype(x.compute_shape(inputs)) +auto compute_shape_op(rank<3>, + const T& x, + const std::vector& inputs) -> decltype(x.compute_shape(inputs)) { return x.compute_shape(inputs); } @@ -148,8 +149,9 @@ auto compute_shape_op(rank<2>, const T& x, const std::vector& inputs) } template -auto compute_shape_op(rank<1>, const T& x, const std::vector& inputs) - -> decltype(x.compute_shape(inputs, {})) +auto compute_shape_op(rank<1>, + const T& x, + const std::vector& inputs) -> decltype(x.compute_shape(inputs, {})) { return x.compute_shape(inputs, {}); } @@ -325,8 +327,8 @@ auto compute_op(rank<2>, const shape& output, const std::vector& inputs, const std::vector&, - F) - -> decltype(x.compute(make_compute_output_shape(pack(x, output, inputs)), inputs)) + F) -> decltype(x.compute(make_compute_output_shape(pack(x, output, inputs)), + inputs)) { return x.compute(make_compute_output_shape(pack(x, output, inputs)), inputs); } @@ -383,8 +385,9 @@ auto is_context_free_op(rank<0>, const T&, const shape&, const std::vector std::false_type; template -auto is_context_free_op(const T& x) -> decltype(is_context_free_op( - rank<1>{}, x, std::declval(), std::declval>())) +auto is_context_free_op(const T& x) + -> decltype(is_context_free_op( + rank<1>{}, x, std::declval(), std::declval>())) { return {}; } @@ -1425,8 +1428,8 @@ inline shape compute_shape(const operation& op, const std::vector& inputs } template -inline auto compute_shape(const T& op, const std::vector& inputs) - -> decltype(op.compute_shape(inputs)) +inline auto compute_shape(const T& op, + const std::vector& inputs) -> decltype(op.compute_shape(inputs)) { return op.compute_shape(inputs); } diff --git a/src/include/migraphx/pass.hpp b/src/include/migraphx/pass.hpp index c6f83e32e57..696cc199a53 100644 --- a/src/include/migraphx/pass.hpp +++ b/src/include/migraphx/pass.hpp @@ -62,8 +62,9 @@ MIGRAPHX_EXPORT module& get_module(module_pass_manager& mpm); namespace detail { template -auto module_pass_manager_apply(rank<1>, const T& x, module_pass_manager& mpm) - -> decltype(x.apply(get_module(mpm))) +auto module_pass_manager_apply(rank<1>, + const T& x, + module_pass_manager& mpm) -> decltype(x.apply(get_module(mpm))) { return x.apply(get_module(mpm)); } diff --git a/test/bit_signal.cpp b/test/bit_signal.cpp index a7701e0b9d9..7612fa95386 100644 --- a/test/bit_signal.cpp +++ b/test/bit_signal.cpp @@ -24,7 +24,7 @@ TEST_CASE(copy_slot) migraphx::bit_signal<64> signals; EXPECT(signals.nslots() == 0); auto slot1 = signals.subscribe(); - auto slot2 = slot1; + auto slot2 = slot1; // NOLINT EXPECT(signals.nslots() == 2); EXPECT(slot1.i != slot2.i); EXPECT(slot1.valid()); diff --git a/tools/docker/migraphx_with_onnxruntime_pytorch.docker b/tools/docker/migraphx_with_onnxruntime_pytorch.docker index b42cca1287b..9acfd37d27a 100644 --- a/tools/docker/migraphx_with_onnxruntime_pytorch.docker +++ b/tools/docker/migraphx_with_onnxruntime_pytorch.docker @@ -6,21 +6,21 @@ ARG PREFIX=/usr/local RUN apt update && apt install -y wget #Aquire and install ROCm -RUN wget https://repo.radeon.com/amdgpu-install/6.1.3/ubuntu/jammy/amdgpu-install_6.1.60103-1_all.deb -RUN apt install -y ./amdgpu-install_6.1.60103-1_all.deb -RUN amdgpu-install --usecase=rocm -y && rm amdgpu-install_6.1.60103-1_all.deb +RUN wget https://repo.radeon.com/amdgpu-install/6.2/ubuntu/jammy/amdgpu-install_6.2.60200-1_all.deb +RUN apt install -y ./amdgpu-install_6.2.60200-1_all.deb +RUN amdgpu-install --usecase=rocm -y && rm amdgpu-install_6.2.60200-1_all.deb #Install MIGraphX from package manager RUN apt install -y migraphx #Pieces for Onnxruntime for ROCm and MIGraphX Execution Provider Support - RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1.3/onnxruntime_rocm-1.17.0-cp310-cp310-linux_x86_64.whl + RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-6.2/onnxruntime_rocm-1.18.0-cp310-cp310-linux_x86_64.whl #Pieces for pytorch -RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1.3/pytorch_triton_rocm-2.1.0%2Brocm6.1.3.4d510c3a44-cp310-cp310-linux_x86_64.whl -RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1.3/torch-2.1.2+rocm6.1.3-cp310-cp310-linux_x86_64.whl -RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-6.1.3/torchvision-0.16.1+rocm6.1.3-cp310-cp310-linux_x86_64.whl +RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-6.2/pytorch_triton_rocm-2.2.0%2Brocm6.2.0.1d36d63aa0-cp310-cp310-linux_x86_64.whl +RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-6.2/torch-2.2.1+rocm6.2.0-cp310-cp310-linux_x86_64.whl +RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-6.2/torchvision-0.17.1+rocm6.2.0-cp310-cp310-linux_x86_64.whl #Adjust final path for ability to use rocm components ENV PATH=$PATH:/opt/rocm/bin/ diff --git a/tools/docker/sles.docker b/tools/docker/sles.docker index 0d85fd2f30f..631be1301d5 100644 --- a/tools/docker/sles.docker +++ b/tools/docker/sles.docker @@ -31,6 +31,9 @@ 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 +# Workaround for broken hip-clang +RUN sed -i '/if(WIN32)/, /endif()/d' /opt/rocm/lib/cmake/hip/hip-config.cmake || true + ENV LC_ALL=C.UTF-8 ENV LANG=C.UTF-8 diff --git a/tools/docker/ubuntu_2204.dockerfile b/tools/docker/ubuntu_2204.dockerfile index f16e7bb69f9..5e241a2b2ff 100644 --- a/tools/docker/ubuntu_2204.dockerfile +++ b/tools/docker/ubuntu_2204.dockerfile @@ -10,7 +10,7 @@ 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.7 jammy main' > /etc/apt/sources.list.d/rocm.list" +RUN sh -c "echo 'deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] http://repo.radeon.com/rocm/apt/6.2 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: *\nPin: release o=repo.radeon.com\nPin-priority: 600' > /etc/apt/preferences.d/rocm-pin-600"