Skip to content

Commit

Permalink
Merge branch 'develop' into 3485-reduce-compile-time-for-migraphx
Browse files Browse the repository at this point in the history
  • Loading branch information
aarushjain29 authored Jan 15, 2025
2 parents a3a5fcc + 22e323c commit 70dbed0
Show file tree
Hide file tree
Showing 546 changed files with 22,313 additions and 2,146 deletions.
2 changes: 2 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,5 @@ CheckOptions:
value: UPPER_CASE
- key: readability-identifier-naming.MacroDefinitionPrefix
value: MIGRAPHX_
- key: readability-identifier-naming.ConstexprMethodIgnoredRegexp
value: 'quiet_NaN|signaling_NaN'
18 changes: 16 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,14 @@ jobs:
docker-images: true

- uses: actions/[email protected]
with:
fetch-depth: 0 # Fetch the entire repository history and all branches
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: run License Check
run: python3 tools/check_stamped.py ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
- name: Run License Check
run: python3 tools/check_stamped.py origin/${{ github.event_name == 'pull_request' && github.base_ref || 'develop' }}

linux:

Expand Down Expand Up @@ -595,4 +597,16 @@ jobs:
# chmod +x codecov
# ./codecov -t ${CODECOV_TOKEN}
# echo "Uploaded"
misspell:
name: misspell
runs-on: ubuntu-20.04
steps:
- name: Check out code.
uses: actions/checkout@v4
- name: misspell
uses: reviewdog/action-misspell@v1
with:
locale: "US"
reporter: github-pr-check
level: warning

6 changes: 3 additions & 3 deletions .github/workflows/config.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#=====ROCM INFO=====
ROCM_VERSION : '6.0.2'
ROCM_VERSION : '6.3.1'
#default ROCm version to be used
ROCM_BASE_IMAGE : 'rocm/dev-ubuntu-20.04'
ROCM_BASE_IMAGE : 'rocm/dev-ubuntu-22.04'
#base image from dockerhub to be used
ROCM_BUILT_IMAGE : 'rocm-migraphx'
#name of the docker image built upon ROCm base
Expand All @@ -26,4 +26,4 @@ PERFORMANCE_TEST_TIMEOUT : '30m'

#===== W A R N I N G =====
#VARIABLE NAMES NOT TO BE CHANGED, VALUES ONLY!
#VALUES MUST BE ENGLOSED IN SINGLE QUOTES!
#VALUES MUST BE ENGLOSED IN SINGLE QUOTES!
4 changes: 2 additions & 2 deletions .github/workflows/performance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
rocm_release:
description: ROCm Version
required: true
default: '6.0.2'
default: '6.3.1'
performance_reports_repo:
description: Repository where performance reports are stored
required: true
Expand Down Expand Up @@ -96,4 +96,4 @@ jobs:
secrets:
gh_token: ${{ secrets.MIGRAPHX_BOT_TOKEN }}
mail_user: ${{ secrets.MAIL_USERNAME }}
mail_pass: ${{ secrets.MAIL_PASSWORD }}
mail_pass: ${{ secrets.MAIL_PASSWORD }}
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,83 @@
Full documentation for MIGraphX is available at
[https://rocmdocs.amd.com/projects/AMDMIGraphX/en/latest/](https://rocmdocs.amd.com/projects/AMDMIGraphX/en/latest/).

## MIGraphX 2.11 for ROCm 6.3.0

### Added

* Initial code to run on Windows
* Support for gfx120x GPU
* Support for FP8, and INT4
* Support for the Log2 internal operator
* Support for the GCC 14 compiler
* The BitwiseAnd, Scan, SoftmaxCrossEntropyLoss, GridSample, and NegativeLogLikelihoodLoss ONNX operators
* The MatMulNBits, QuantizeLinear/DequantizeLinear, GroupQueryAttention, SkipSimplifiedLayerNormalization, and SimpliedLayerNormalization Microsoft Contrib operators
* Dymamic batch parameter support to OneHot operator
* Split-K as an optional performance improvement
* Scripts to validate ONNX models from the ONNX Model Zoo
* GPU Pooling Kernel
* --mlir flag to the migraphx-driver program to offload entire module to mlir
* Fusing split-reduce with MLIR
* Multiple outputs for the MLIR + Pointwise fusions
* Pointwise fusions with MLIR across reshape operations
* MIGRAPHX_MLIR_DUMP environment variable to dump MLIR modules to MXRs
* The 3 option to MIGRAPHX_TRACE_BENCHMARKING to print the MLIR program for improved debug output
* MIGRAPHX_ENABLE_HIPBLASLT_GEMM environment variable to call hipBlasLt libaries
* MIGRAPHX_VERIFY_DUMP_DIFF to improve the debugging of accuracy issues
* reduce_any and reduce_all options to the Reduce operation via Torch MIGraphX
* Examples for RNNT, and ControlNet


### Changed

* Switched to MLIR's 3D Convolution operator.
* MLIR is now used for Attention operations by default on gfx942 and newer ASICs.
* Names and locations for VRM specific libraries have changed.
* Use random mode for benchmarking GEMMs and convolutions.
* Python version is now printed with an actual version number.


### Removed

* Disabled requirements for MIOpen and rocBlas when running on Windows.
* Removed inaccuracte warning messages when using exhaustive-tune.
* Remove the hard coded path in MIGRAPHX_CXX_COMPILER allowing the compiler to be installed in different locations.


### Optimized

* Improved:
* Infrastructure code to enable better Kernel fusions with all supported data types
* Subsequent model compile time by creating a cache for already performant kernels
* Use of Attention fusion with models
* Performance of the Softmax JIT kernel and of the Pooling opterator
* Tuning operations through a new 50ms delay before running the next kernel
* Performance of several convolution based models through an optimized NHWC layout
* Performance for the FP8 datatype
* GPU utilization
* Verification tools
* Debug prints
* Documentation, including gpu-driver utility documentation
* Summary section of the migrahx-driver perf command
* Reduced model compilation time
* Reordered some compiler passes to allow for more fusions
* Preloaded tiles into LDS to improve performance of pointwise transposes
* Exposed the external_data_path property in onnx_options to set the path from onnxruntime


### Resolved Issues

* Fixed a bug with gfx1030 that overwrote dpp_reduce.
* Fixed a bug in 1arg dynamic reshape that created a failure.
* Fixed a bug with dot_broadcast and inner_broadcast that caused compile failures.
* Fixed a bug where some configs were failing when using exhaustive-tune.
* Fixed the ROCM Install Guide URL.
* Fixed an issue while building a whl package due to an apostrophe.
* Fixed the BERT Squad example requirements file to support different versions of Python.
* Fixed a bug that stopped the Vicuna model from compiling.
* Fixed failures with the verify option of migraphx-driver that would cause the application to exit early.


## MIGraphX 2.10 for ROCm 6.2.0

### Additions
Expand Down
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ include(ROCMSetupVersion)

option(BUILD_DEV "Build for development purpose only" OFF)

rocm_setup_version(VERSION 2.11.0)
rocm_setup_version(VERSION 2.12.0)
math(EXPR MIGRAPHX_SO_MAJOR_VERSION "(${PROJECT_VERSION_MAJOR} * 1000 * 1000) + (${PROJECT_VERSION_MINOR} * 1000) + ${PROJECT_VERSION_PATCH}")
set(MIGRAPHX_SO_VERSION ${MIGRAPHX_SO_MAJOR_VERSION}.0)

Expand Down Expand Up @@ -178,10 +178,8 @@ 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
Expand Down Expand Up @@ -210,7 +208,6 @@ rocm_enable_clang_tidy(
-clang-diagnostic-disabled-macro-expansion
-clang-diagnostic-extern-c-compat
-clang-diagnostic-unused-command-line-argument
-cppcoreguidelines-avoid-capture-default-when-capturing-this
-cppcoreguidelines-avoid-const-or-ref-data-members
-cppcoreguidelines-avoid-do-while
-cppcoreguidelines-explicit-virtual-functions
Expand All @@ -224,7 +221,6 @@ rocm_enable_clang_tidy(
-cppcoreguidelines-pro-type-reinterpret-cast
-cppcoreguidelines-pro-type-union-access
-cppcoreguidelines-pro-type-vararg
-cppcoreguidelines-rvalue-reference-param-not-moved
-cppcoreguidelines-special-member-functions
-cppcoreguidelines-use-default-member-init
-cppcoreguidelines-virtual-class-destructor
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.2/ 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.3/ 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"
Expand Down
66 changes: 54 additions & 12 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils

DOCKER_IMAGE = 'rocm/migraphx-ci-jenkins-ubuntu'

def getgputargets() {
targets="gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101;gfx1102"
return targets
Expand Down Expand Up @@ -60,19 +64,16 @@ def rocmtestnode(Map conf) {
sh 'printenv'
checkout scm
}
gitStatusWrapper(credentialsId: "${env.migraphx_ci_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') {
pre()
stage("image ${variant}") {
try {
docker.build("${image}", "${docker_build_args} .")
} catch(Exception ex) {
docker.build("${image}", "${docker_build_args} --no-cache .")

}
}
withDockerContainer(image: image, args: "--device=/dev/kfd --device=/dev/dri --group-add video --cap-add SYS_PTRACE -v=/home/jenkins:/home/jenkins ${docker_args}") {
timeout(time: 2, unit: 'HOURS') {
body(cmake_build)
gitStatusWrapper(credentialsId: "${env.migraphx_ci_creds}", gitHubContext: "Jenkins - ${variant}", account: 'ROCmSoftwarePlatform', repo: 'AMDMIGraphX') {
withCredentials([usernamePassword(credentialsId: 'docker_test_cred', passwordVariable: 'DOCKERHUB_PASS', usernameVariable: 'DOCKERHUB_USER')]) {
sh "echo $DOCKERHUB_PASS | docker login --username $DOCKERHUB_USER --password-stdin"
pre()
sh "docker pull ${DOCKER_IMAGE}:${env.IMAGE_TAG}"
withDockerContainer(image: "${DOCKER_IMAGE}:${env.IMAGE_TAG}", args: "--device=/dev/kfd --device=/dev/dri --group-add video --cap-add SYS_PTRACE -v=/home/jenkins/:/home/jenkins ${docker_args}") {
timeout(time: 4, unit: 'HOURS') {
body(cmake_build)
}
}
}
}
Expand Down Expand Up @@ -118,6 +119,47 @@ def rocmnode(name, body) {
}
}

properties([
parameters([
booleanParam(name: 'FORCE_DOCKER_IMAGE_BUILD', defaultValue: false)
])
])

node("(rocmtest || migraphx)") {
Boolean imageExists = false
withCredentials([usernamePassword(credentialsId: 'docker_test_cred', passwordVariable: 'DOCKERHUB_PASS', usernameVariable: 'DOCKERHUB_USER')]) {
sh "echo $DOCKERHUB_PASS | docker login --username $DOCKERHUB_USER --password-stdin"
stage('Check image') {
sh 'printenv'
checkout scm
def calculateImageTagScript = """
shopt -s globstar
sha256sum **/Dockerfile **/*requirements.txt **/install_prereqs.sh **/rbuild.ini | sha256sum | cut -d " " -f 1
"""
env.IMAGE_TAG = sh(script: "bash -c '${calculateImageTagScript}'", returnStdout: true).trim()
imageExists = sh(script: "docker manifest inspect ${DOCKER_IMAGE}:${IMAGE_TAG}", returnStatus: true) == 0
}
stage('Build image') {
if(!imageExists || params.FORCE_DOCKER_IMAGE_BUILD) {
def builtImage

try {
sh "docker pull ${DOCKER_IMAGE}:latest"
builtImage = docker.build("${DOCKER_IMAGE}:${IMAGE_TAG}", "--cache-from ${DOCKER_IMAGE}:latest .")
} catch(Exception ex) {
builtImage = docker.build("${DOCKER_IMAGE}:${IMAGE_TAG}", " --no-cache .")
}
builtImage.push("${IMAGE_TAG}")
builtImage.push("latest")
} else {
echo "Image already exists, skip building available"
// Skip stage so it remains in the visualization
Utils.markStageSkippedForConditional(STAGE_NAME)
}
}
}
}

rocmtest clang_debug: rocmnode('mi100+') { cmake_build ->
stage('hipRTC Debug') {
// Disable MLIR since it doesnt work with all ub sanitizers
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015-2024 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2015-2025 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
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ ignore:
- "test/"
- "src/driver"
- "build/"
- "src/netron_output.cpp"
4 changes: 4 additions & 0 deletions docs/dev/data.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. meta::
:description: MIGraphX internal data types
:keywords: MIGraphX, code base, contribution, developing, data types

Data types
==========

Expand Down
5 changes: 5 additions & 0 deletions docs/dev/dev_intro.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.. meta::
:description: MIGraphX introduction to developing for the code base
:keywords: MIGraphX, code base, contribution, developing, introduction, developers


Developer Introduction
======================

Expand Down
37 changes: 34 additions & 3 deletions docs/dev/env_vars.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. meta::
:description: MIGraphX internal environment variables
:keywords: MIGraphX, code base, contribution, developing, env vars, environment variables

Environment Variables
=====================

Expand Down Expand Up @@ -82,6 +86,11 @@ Prints debug statements for the ``schedule`` pass.
Set to "1", "enable", "enabled", "yes", or "true" to use.
Traces instructions replaced with a constant.

.. envvar:: MIGRAPHX_TRACE_QUANTIZATION

Set to "1", "enable", "enabled", "yes", or "true" to use.
Prints traces for any passes run during quantization.

.. envvar:: MIGRAPHX_8BITS_QUANTIZATION_PARAMS

Set to "1", "enable", "enabled", "yes", or "true" to use.
Expand All @@ -107,9 +116,9 @@ Disables the ``schedule`` pass.
Set to "1", "enable", "enabled", "yes", or "true" to use.
Disables the ``fuse_reduce`` pass.

.. envvar:: MIGRAPHX_ENABLE_SPLIT_REDUCE
Set to "1", "enable", "enabled", "yes", or "true" to use.
Enable split_reduce.
.. envvar:: MIGRAPHX_SPLIT_REDUCE_SIZE
Set to the minimum size of a reduction to do a split reduce. Overrides what
is set in the backend. Set to -1 to disable split reduce completely.

.. envvar:: MIGRAPHX_ENABLE_NHWC

Expand All @@ -126,6 +135,10 @@ Use it in conjunction with ``MIGRAPHX_DISABLE_MLIR=1``.
Set to "1", "enable", "enabled", "yes", or "true" to use.
Disables use of the rocMLIR library.

.. envvar:: MIGRAPHX_ENABLE_HIPBLASLT_GEMM
Set to "1", "enable", "enabled", "yes", or "true" to use.
Enables use of hipBLASLt.

.. envvar:: MIGRAPHX_COPY_LITERALS

Set to "1", "enable", "enabled", "yes", or "true" to use.
Expand Down Expand Up @@ -299,6 +312,16 @@ Enable reduction fusions in MLIR.
Set to "1", "enable", "enabled", "yes", or "true" to use.
Enable Split-k perf configs when tuning with MLIR.

.. envvar:: MIGRAPHX_MLIR_DUMP_TO_MXR

Set to path where MXRs will be saved.
Dumps MLIRs module to mxr files.

.. envvar:: MIGRAPHX_MLIR_DUMP

Set to path where MLIRs will be saved.
Dumps MLIRs module to .mlir files.

CK vars
-----------

Expand All @@ -317,6 +340,14 @@ Mandatorily adds ``-DMIGRAPHX_CK_CHECK=1`` for compiling composable kernel opera
Set to "1", "enable", "enabled", "yes", or "true" to use.
Performs tuning for composable kernels.

hipBLASLt vars
--------------

.. envvar:: MIGRAPHX_ENABLE_HIP_GEMM_TUNING

Set to "1", "enable", "enabled", "yes", or "true" to use.
Performs exhaustive tuning for hipBLASLt.

Testing
------------

Expand Down
Loading

0 comments on commit 70dbed0

Please sign in to comment.