Skip to content

Commit fadef65

Browse files
committed
Merge branch 'develop' into bdevorem/geg_heuristics
2 parents bc9d3f9 + a45f521 commit fadef65

24 files changed

+957
-89
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,25 @@ Full documentation for MIGraphX is available at
55

66
## Develop Branch
77

8+
9+
### Added
10+
11+
12+
### Changed
13+
14+
* Updated README `rbuild` installation instructions to use python venv to avoid warning (#4405)
15+
816
### Fixed
917

1018
* Fixed `pointwise: Wrong number of arguments` error when quantizing certain models to `int8` [(#4398)](https://github.com/ROCm/AMDMIGraphX/pull/4398).
1119

20+
### Optimized
21+
22+
23+
### Removed
24+
25+
26+
1227
## MIGraphX 2.14 for ROCm 7.1.0
1328

1429
### Added

README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ version.
2424

2525
You have three options for building from source:
2626

27-
* [ROCm build tool](#use-the-rocm-build-tool-rbuild): Uses
27+
* [ROCm build tool](#compile-using-the-rocm-build-tool-rbuild): Uses
2828
[rbuild](https://github.com/RadeonOpenCompute/rbuild) to install prerequisites, then you can build
2929
the libraries with a single command.
3030

@@ -50,26 +50,41 @@ The following is a list of prerequisites for building MIGraphX.
5050
* [MessagePack](https://msgpack.org/index.html) for model serialization to binary format
5151
* [SQLite3](https://www.sqlite.org/index.html) to create database of kernels' tuning information or run queries on existing database
5252

53-
### Use the ROCm build tool [rbuild](https://github.com/RadeonOpenCompute/rbuild).
53+
### Installing the ROCm build tool [rbuild](https://github.com/RadeonOpenCompute/rbuild).
5454

5555
1. Install `rocm-cmake`, `pip3`, `rocblas`, and `miopen-hip`:
5656

5757
```bash
5858
sudo apt install -y rocm-cmake python3-pip rocblas miopen-hip
5959
```
6060

61-
2. Install [rbuild](https://github.com/RadeonOpenCompute/rbuild) (sudo may be required):
61+
2. Set up and activate python venv for rbuild:
62+
```bash
63+
python3 -m venv venv_rbuild
64+
source venv_rbuild/bin/activate
65+
```
66+
67+
3. Install [rbuild](https://github.com/RadeonOpenCompute/rbuild) in the python venv:
6268

6369
```bash
64-
pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
70+
pip install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
6571
```
6672

67-
3. Build MIGraphX source code:
73+
> [!NOTE]
74+
> You can deactivate the python virtual environment with `deactivate`.
75+
76+
77+
### Compile using the ROCm build tool [rbuild](https://github.com/RadeonOpenCompute/rbuild).
78+
79+
1. Follow instructions in [installing rbuild](#installing-the-rocm-build-tool-rbuild)
80+
81+
2. Build MIGraphX source code:
6882

6983
```bash
7084
rbuild build -d depend -B build -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
7185
```
7286

87+
7388
Once completed, all prerequisites are in the `depend` folder and MIGraphX is in the `build` directory.
7489

7590
> [!NOTE]
@@ -79,7 +94,9 @@ Once completed, all prerequisites are in the `depend` folder and MIGraphX is in
7994
8095
### Use CMake to build MIGraphX
8196
82-
1. Install the prerequisites:
97+
1. Follow instructions in [installing rbuild](#installing-the-rocm-build-tool)
98+
99+
2. Install the prerequisites:
83100
84101
```bash
85102
rbuild prepare -d depend
@@ -95,22 +112,22 @@ Once completed, all prerequisites are in the `depend` folder and MIGraphX is in
95112
users. For the default location, `sudo` is required to run the script. You can also specify a different
96113
location using `./tools/install_prereqs.sh $custom_location`.
97114
98-
2. Go to the project folder and create a `build` directory:
115+
3. Go to the project folder and create a `build` directory:
99116
100117
```bash
101118
mkdir build
102119
cd build
103120
```
104121
105-
3. Configure CMake. If the prerequisites are installed at the default location `/usr/local`, use:
122+
4. Configure CMake. If the prerequisites are installed at the default location `/usr/local`, use:
106123
107124
```bash
108125
CXX=/opt/rocm/llvm/bin/clang++ cmake .. -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
109126
```
110127
111128
Otherwise, you need to set `-DCMAKE_PREFIX_PATH=$your_loc` to configure CMake.
112129
113-
4. Build MIGraphX source code:
130+
5. Build MIGraphX source code:
114131
115132
```cpp
116133
make -j$(nproc)
@@ -122,7 +139,7 @@ Once completed, all prerequisites are in the `depend` folder and MIGraphX is in
122139
make -j$(nproc) check
123140
```
124141
125-
5. Install MIGraphX libraries:
142+
6. Install MIGraphX libraries:
126143
127144
```cpp
128145
make install
@@ -210,7 +227,7 @@ This will build a local searchable web site inside the docs/html folder.
210227
211228
Documentation is built using [Doxygen](http://www.stack.nl/~dimitri/doxygen/download.html) and [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core)
212229
213-
Run the steps below to build documentation locally.
230+
Run the steps below to build documentation locally. You can reuse the same venv from [installing rbuild](#installing-the-rocm-build-tool-rbuild).
214231
215232
```bash
216233
cd docs
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.. meta::
2+
:description: Deep learning compilation with MIGraphX
3+
:keywords: MIGraphX, ROCm, library, API
4+
5+
.. _deep-learning-compilation:
6+
7+
********************************************************************
8+
Deep learning compilation with MIGraphX
9+
********************************************************************
10+
11+
The MIGraphX deep learning (DL) compiler improves inference by analyzing
12+
a model’s compute graph and applying program transformations. After
13+
optimization, the compiler lowers graph operations to device kernels (from
14+
libraries or via code generation) for efficient execution.
15+
16+
A common transformation is kernel fusion; where compatible operations are
17+
merged into a single kernel launch. Fusion reduces launch overhead and
18+
avoids extra reads or writes between host and device, which typically
19+
improves latency and throughput. By applying graph-level optimizations
20+
and choosing or generating efficient device kernels, MIGraphX delivers
21+
high-performance over uncompiled models and less optimized compiled solutions.
22+
23+
An overview of the compilation process for MIGraphX is shown below in
24+
:numref:`compilation-label`. One type of optimization that MIGraphX
25+
performs are kernel fusions such as the Attention fusion seen in
26+
:numref:`attention-label`.
27+
28+
.. image:: ../data/migraphx_compilation_flow.png
29+
:scale: 50%
30+
:alt: Simplified overview of the MIGraphX compilation process
31+
:name: compilation-label
32+
33+
.. image:: ../data/attention_fusion.png
34+
:scale: 50%
35+
:alt: Attention operations fused into a single kernel
36+
:name: attention-label
37+
38+
What MIGraphX provides
39+
====================================================================
40+
41+
* **End-to-end:** compilation and execution of DL models on AMD GPUs
42+
* **C++ implementation:** with Python and C++ APIs
43+
* **Model inputs:**
44+
* ONNX and TensorFlow
45+
* PyTorch through `https://github.com/ROCm/torch_migraphx <https://github.com/ROCm/torch_migraphx>`__
46+
* ONNX Runtime execution provider
47+
* **Hardware targets:** AMD Navi (consumer) and MI (server) GPUs
48+
* **Supported data types:** FP16, BF16, OCP FP8, INT8, INT4
49+

docs/data/attention_fusion.png

110 KB
Loading

docs/data/attention_fusion.svg

Lines changed: 333 additions & 0 deletions
Loading
262 KB
Loading

docs/data/migraphx_compilation_flow.svg

Lines changed: 363 additions & 0 deletions
Loading

docs/index.rst

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@
88
MIGraphX documentation
99
===========================
1010

11-
MIGraphX is a graph inference engine and graph compiler. MIGraphX accelerates machine-learning models by leveraging several graph-level transformations and optimizations. These optimizations include:
12-
13-
* Operator fusion
14-
* Arithmetic simplifications
15-
* Dead-code elimination
16-
* Common subexpression elimination (CSE)
17-
* Constant propagation
18-
19-
After optimization, MIGraphX generates code for AMD GPUs by calling various ROCm libraries to create the fastest combinations of HIP kernels.
11+
MIGraphX is a graph compiler and inference engine for high performance machine learning model inference.
12+
It compiles trained models from end-to-end to optimize for inference performance on AMD hardware.
2013

2114
The MIGraphX public repository is located at `https://github.com/ROCm/AMDMIGraphX/ <https://github.com/ROCm/AMDMIGraphX/>`_
2215

@@ -25,8 +18,11 @@ The MIGraphX public repository is located at `https://github.com/ROCm/AMDMIGraph
2518

2619
.. grid-item-card:: Install
2720

28-
* :doc:`Installing MIGraphX with the package installer <./install/installing_with_package>`
29-
* :doc:`Building and installing MIGraphX from source code <./install/building_migraphx>`
21+
* :doc:`MIGraphX on ROCm installation <./install/install-migraphx>`
22+
23+
.. grid-item-card:: Conceptual
24+
25+
* :doc:`Deep learning compilation with MIGraphX <./conceptual/deep-learning-compilation>`
3026

3127
.. grid-item-card:: Reference
3228

@@ -51,3 +47,4 @@ To contribute to the documentation refer to
5147

5248
Licensing information can be found on the
5349
`Licensing <https://rocm.docs.amd.com/en/latest/about/license.html>`_ page.
50+

docs/install/building_migraphx.rst

Lines changed: 0 additions & 32 deletions
This file was deleted.

docs/install/install-migraphx.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
.. meta::
2+
:description: Installing MIGraphX for ROCm
3+
:keywords: install, build, MIGraphX, AMD, ROCm, package installer, development, contributing
4+
5+
********************************************************************
6+
MIGraphX on ROCm installation
7+
********************************************************************
8+
9+
ROCm must be installed before installing MIGraphX. See `ROCm installation
10+
for Linux <https://rocm.docs.amd.com/projects/install-on-linux/en/latest/>`__
11+
for instructions.
12+
13+
Installing MIGraphX using a package installer is sufficient for most users
14+
who want to use the MIGraphX API. If you plan to develop for MIGraphX or
15+
contribute to the source code, see `Developing for MIGraphX <../dev/contributing-to-migraphx.html>`_
16+
17+
Install MIGraphX with a package installer
18+
====================================================================
19+
20+
The package installer will install all the prerequisites you need for MIGraphX.
21+
22+
Use the following command to install MIGraphX:
23+
24+
.. code:: shell
25+
26+
sudo apt update && sudo apt install -y migraphx
27+
28+
Build MIGraphX from source
29+
====================================================================
30+
31+
.. note::
32+
33+
This method for building MIGraphX requires using ``sudo``.
34+
35+
1. Install `rocm-cmake`, `pip3`, `rocblas`, and `miopen-hip`:
36+
37+
.. code:: shell
38+
39+
sudo apt install -y rocm-cmake python3-pip rocblas miopen-hip
40+
41+
2. Install `rbuild <https://github.com/RadeonOpenCompute/rbuild>`_:
42+
43+
.. code:: shell
44+
45+
pip3 install --prefix /usr/local https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
46+
47+
3. Build MIGraphX source code:
48+
49+
.. code:: shell
50+
51+
sudo rbuild build -d depend -B build -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')

0 commit comments

Comments
 (0)