pax_global_header 0000666 0000000 0000000 00000000064 15104657024 0014516 g ustar 00root root 0000000 0000000 52 comment=89196378a4a729ac0077c048214d5fc07d6c90c7
ROCm-AMDMIGraphX-46524e8/ 0000775 0000000 0000000 00000000000 15104657024 0014540 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/.azuredevops/ 0000775 0000000 0000000 00000000000 15104657024 0017165 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/.azuredevops/rocm-ci.yml 0000664 0000000 0000000 00000001263 15104657024 0021243 0 ustar 00root root 0000000 0000000 resources:
repositories:
- repository: pipelines_repo
type: github
endpoint: ROCm
name: ROCm/ROCm
variables:
- group: common
- template: /.azuredevops/variables-global.yml@pipelines_repo
trigger:
batch: true
branches:
include:
- develop
- master
paths:
exclude:
- .githooks
- .github
- docs
- '.*.y*ml'
- '*.md'
- Jenkinsfile
- LICENSE
pr:
autoCancel: true
branches:
include:
- develop
- master
paths:
exclude:
- .github
- docs
- '.*.y*ml'
- '*.md'
- Jenkinsfile
- LICENSE
drafts: false
jobs:
- template: ${{ variables.CI_COMPONENT_PATH }}/AMDMIGraphX.yml@pipelines_repo
ROCm-AMDMIGraphX-46524e8/.clang-format 0000664 0000000 0000000 00000005104 15104657024 0017113 0 ustar 00root root 0000000 0000000 ---
Language: Cpp
AccessModifierOffset: 0
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
# SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
ROCm-AMDMIGraphX-46524e8/.clang-tidy 0000664 0000000 0000000 00000015735 15104657024 0016607 0 ustar 00root root 0000000 0000000 CheckOptions:
- key: bugprone-reserved-identifier.AllowedIdentifiers
value: '__HIP_PLATFORM_AMD__;__HIP_ROCclr__'
- key: bugprone-unused-return-value.CheckedFunctions
value: '::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty;::std::find;::std::find_if;::std::find_if_not;::std::all_of;::std::any_of;::std::none_of;::std::count;::std::count_if;::std::mismatch;::std::find_end;::std::find_first_of;::std::adjacent_find;::std::search;::std::search_n;::std::nth_element;::std::lower_bound;::std::upper_bound;::std::binary_search;::std::equal_range;::std::max;::std::max_element;::std::min;::std::min_element;::std::minmax;::std::minmax_element;::std::equal;::std::lexicographical_compare;::std::accumulate;::std::inner_product'
- key: bugprone-unused-return-value.AllowCastToVoid
value: true
- key: cppcoreguidelines-macro-usage.AllowedRegexp
value: 'DEBUG|ASSERT|ASSUME|UNREACHABLE|FALLTHROUGH|DEPRECATED|STRINGIZE|_HAS_|_THROW|_REQUIRES|_DECLARE_|_VISIT_|_REGISTER_|_GENERATE_|_DETAIL_|_TIDY_|_MANAGE_PTR|_MATCHER|DEVICE_SHARED|_WORKAROUND_|_PP_'
- key: modernize-loop-convert.MinConfidence
value: risky
- key: modernize-loop-convert.NamingStyle
value: lower_case
- key: misc-const-correctness.AnalyzeValues
value: 'false'
- key: performance-unnecessary-copy-initialization.AllowedTypes
value: 'shape;operation;iterator;literal;tensor_view;match'
- key: performance-unnecessary-value-param.AllowedTypes
value: 'shape;operation;iterator;literal;tensor_view;match'
- key: readability-function-size.BranchThreshold
value: '15'
- key: readability-function-size.LineThreshold
value: '350'
- key: readability-function-size.NestingThreshold
value: '5'
- key: readability-function-size.ParameterThreshold
value: '10'
- key: readability-function-size.StatementThreshold
value: '150'
- key: readability-identifier-naming.NamespaceCase
value: lower_case
- key: readability-identifier-naming.InlineNamespaceCase
value: UPPER_CASE
- key: readability-identifier-naming.EnumConstantCase
value: lower_case
- key: readability-identifier-naming.ConstexprVariableCase
value: lower_case
- key: readability-identifier-naming.ConstantMemberCase
value: lower_case
- key: readability-identifier-naming.PrivateMemberCase
value: lower_case
- key: readability-identifier-naming.ProtectedMemberCase
value: lower_case
- key: readability-identifier-naming.PublicMemberCase
value: lower_case
- key: readability-identifier-naming.MemberCase
value: lower_case
- key: readability-identifier-naming.ClassConstantCase
value: lower_case
- key: readability-identifier-naming.ClassMemberCase
value: lower_case
- key: readability-identifier-naming.GlobalConstantCase
value: lower_case
- key: readability-identifier-naming.GlobalVariableCase
value: lower_case
- key: readability-identifier-naming.LocalConstantCase
value: lower_case
- key: readability-identifier-naming.LocalVariableCase
value: lower_case
- key: readability-identifier-naming.StaticConstantCase
value: lower_case
- key: readability-identifier-naming.StaticVariableCase
value: lower_case
- key: readability-identifier-naming.ConstantCase
value: lower_case
- key: readability-identifier-naming.VariableCase
value: lower_case
- key: readability-identifier-naming.ConstantParameterCase
value: lower_case
- key: readability-identifier-naming.ParameterPackCase
value: lower_case
- key: readability-identifier-naming.ParameterCase
value: lower_case
- key: readability-identifier-naming.AbstractClassCase
value: lower_case
- key: readability-identifier-naming.StructCase
value: lower_case
- key: readability-identifier-naming.ClassCase
value: lower_case
- key: readability-identifier-naming.UnionCase
value: lower_case
- key: readability-identifier-naming.EnumCase
value: lower_case
- key: readability-identifier-naming.GlobalFunctionCase
value: lower_case
- key: readability-identifier-naming.ConstexprFunctionCase
value: lower_case
- key: readability-identifier-naming.FunctionCase
value: lower_case
- key: readability-identifier-naming.ConstexprMethodCase
value: lower_case
- key: readability-identifier-naming.VirtualMethodCase
value: lower_case
- key: readability-identifier-naming.ClassMethodCase
value: lower_case
- key: readability-identifier-naming.PrivateMethodCase
value: lower_case
- key: readability-identifier-naming.ProtectedMethodCase
value: lower_case
- key: readability-identifier-naming.PublicMethodCase
value: lower_case
- key: readability-identifier-naming.MethodCase
value: lower_case
- key: readability-identifier-naming.TypedefCase
value: lower_case
- key: readability-identifier-naming.TypeTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.ValueTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TemplateTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TypeAliasCase
value: lower_case
- key: readability-identifier-naming.MacroDefinitionCase
value: UPPER_CASE
- key: readability-identifier-naming.MacroDefinitionPrefix
value: MIGRAPHX_
- key: readability-identifier-naming.ConstexprMethodIgnoredRegexp
value: 'quiet_NaN|signaling_NaN'
- key: readability-operators-representation.BinaryOperators
value: 'and;or;not'
- key: readability-operators-representation.OverloadedOperators
value: 'and;or;not'
ROCm-AMDMIGraphX-46524e8/.dockerignore 0000664 0000000 0000000 00000000216 15104657024 0017213 0 ustar 00root root 0000000 0000000 # Ignore everything
**
# Allow files and directories
!*.txt
!*.ini
!/tools/*.txt
!/tools/*.sh
!/test/onnx/.onnxrt-commit
!/docs/sphinx/*.txt
ROCm-AMDMIGraphX-46524e8/.githooks/ 0000775 0000000 0000000 00000000000 15104657024 0016445 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/.githooks/install 0000775 0000000 0000000 00000000236 15104657024 0020042 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
cd $(git rev-parse --git-dir)
echo "Installing hooks..."
mkdir -p hooks
ln -s ../../.githooks/pre-commit hooks/pre-commit
echo "Done!"
ROCm-AMDMIGraphX-46524e8/.githooks/pre-commit 0000775 0000000 0000000 00000000413 15104657024 0020445 0 ustar 00root root 0000000 0000000 #!/bin/sh
#
# This pre-commit hook checks if any versions of clang-format
# are installed, and if so, uses the installed version to format
# the staged changes.
# Do everything from top - level
cd $(git rev-parse --show-toplevel)
python3 tools/format.py -q -i HEAD
ROCm-AMDMIGraphX-46524e8/.github/ 0000775 0000000 0000000 00000000000 15104657024 0016100 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/.github/CODEOWNERS 0000664 0000000 0000000 00000000176 15104657024 0017477 0 ustar 00root root 0000000 0000000 * @causten
# Documentation files
docs/* @ROCm/rocm-documentation
*.md @ROCm/rocm-documentation
*.rst @ROCm/rocm-documentation
ROCm-AMDMIGraphX-46524e8/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 15104657024 0020263 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/.github/ISSUE_TEMPLATE/bug-dev-template.yaml 0000664 0000000 0000000 00000001477 15104657024 0024322 0 ustar 00root root 0000000 0000000 name: Feature Development Template
description: Use this template to report MIGraphX related bugs/features
body:
- type: textarea
id: DOR
attributes:
label: "DOR (Definition of Ready)"
placeholder: The minimum set of criteria that must be fulfilled before a story is ready to be included and worked on in an upcoming sprint.
validations:
required: true
- type: textarea
id: Description
attributes:
label: Description
placeholder: As a [role], I want to [do something] so that [reason/benefit].
validations:
required: true
- type: textarea
id: DOD
attributes:
label: "DOD (Definition of Done)"
placeholder: The conditions that must be satisfied before deliverables can be considered fit for release / done.
validations:
required: true
ROCm-AMDMIGraphX-46524e8/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000000033 15104657024 0022247 0 ustar 00root root 0000000 0000000 blank_issues_enabled: true
ROCm-AMDMIGraphX-46524e8/.github/ISSUE_TEMPLATE/issue_report.yml 0000664 0000000 0000000 00000007072 15104657024 0023537 0 ustar 00root root 0000000 0000000 name: Issue Report
description: File a report for ROCm related issues on Linux and Windows. For issues pertaining to documentation or non-bug related, please open a blank issue located below.
title: "[Issue]: "
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to fill out this report!
You can acquire your OS, CPU, GPU (for filling out this report) with the following commands:
Linux:
echo "OS:" && cat /etc/os-release | grep -E "^(NAME=|VERSION=)";
echo "CPU: " && cat /proc/cpuinfo | grep "model name" | sort --unique;
echo "GPU:" && /opt/rocm/bin/rocminfo | grep -E "^\s*(Name|Marketing Name)";
Windows:
(Get-WmiObject Win32_OperatingSystem).Version
(Get-WmiObject win32_Processor).Name
(Get-WmiObject win32_VideoController).Name
- type: textarea
attributes:
label: Problem Description
description: Describe the issue you encountered.
validations:
required: true
- type: input
attributes:
label: Operating System
description: What is the name and version number of the OS?
placeholder: "e.g. Ubuntu 22.04.3 LTS (Jammy Jellyfish)"
validations:
required: true
- type: input
attributes:
label: CPU
description: What CPU did you encounter the issue on?
placeholder: "e.g. AMD Ryzen 9 5900HX with Radeon Graphics"
validations:
required: true
- type: dropdown
attributes:
label: GPU
description: What GPU(s) did you encounter the issue on (you can select multiple GPUs from the list)
multiple: true
options:
- AMD Instinct MI300
- AMD Instinct MI300A
- AMD Instinct MI300X
- AMD Instinct MI250X
- AMD Instinct MI250
- AMD Instinct MI210
- AMD Instinct MI100
- AMD Instinct MI50
- AMD Instinct MI25
- AMD Radeon Pro V620
- AMD Radeon Pro VII
- AMD Radeon RX 7900 XTX
- AMD Radeon VII
- AMD Radeon Pro W7900
- AMD Radeon Pro W7800
- AMD Radeon Pro W6800
- AMD Radeon Pro W6600
- AMD Radeon Pro W5500
- AMD Radeon RX 7900 XT
- AMD Radeon RX 7600
- AMD Radeon RX 6950 XT
- AMD Radeon RX 6900 XT
- AMD Radeon RX 6800 XT
- AMD Radeon RX 6800
- AMD Radeon RX 6750
- AMD Radeon RX 6700 XT
- AMD Radeon RX 6700
- AMD Radeon RX 6650 XT
- AMD Radeon RX 6600 XT
- AMD Radeon RX 6600
- Other
validations:
required: true
- type: input
attributes:
label: Other
description: If you selected Other, please specify
- type: dropdown
attributes:
label: ROCm Version
description: What version(s) of ROCm did you encounter the issue on?
multiple: true
options:
- ROCm 6.0.0
- ROCm 5.7.1
- ROCm 5.7.0
- ROCm 5.6.0
- ROCm 5.5.1
- ROCm 5.5.0
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: (Optional) Detailed steps to reproduce the issue.
validations:
required: false
- type: textarea
attributes:
label: (Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
description: The output of rocminfo --support could help to better address the problem.
validations:
required: false
- type: textarea
attributes:
label: Additional Information
description: (Optional) Any additional information that is relevant, e.g. relevant environment variables, dockerfiles, log files, dmesg output (on Linux), etc.
validations:
required: false
ROCm-AMDMIGraphX-46524e8/.github/dependabot.yml 0000664 0000000 0000000 00000001714 15104657024 0020733 0 ustar 00root root 0000000 0000000 # To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/docs/sphinx" # Location of package manifests
schedule:
interval: "daily"
labels:
- "documentation"
- package-ecosystem: "pip"
directory: "/tools/accuracy"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/examples/vision/python_unet"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/examples/vision/python_super_resolution"
schedule:
interval: "daily"
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
ROCm-AMDMIGraphX-46524e8/.github/pull_request_template.md 0000664 0000000 0000000 00000001254 15104657024 0023043 0 ustar 00root root 0000000 0000000 ## Motivation
## Technical Details
## Changelog Category
- - [ ] Added: New functionality.
- - [ ] Changed: Changes to existing functionality.
- - [ ] Removed: Functionality or support that has been removed. (Compared to a previous release)
- - [ ] Optimized: Component performance that has been optimized or improved.
- - [ ] Resolved Issues: Known issues from a previous version that have been resolved.
- - [ ] Not Applicable: This PR is not to be included in the changelog.
ROCm-AMDMIGraphX-46524e8/.github/workflows/ 0000775 0000000 0000000 00000000000 15104657024 0020135 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/.github/workflows/README.md 0000664 0000000 0000000 00000023555 15104657024 0021426 0 ustar 00root root 0000000 0000000 # Workflows
## `add-to-project.yaml`
This workflow adds pull requests and issues to a specific GitHub project board when they are opened.
- ## Trigger
The workflow is triggered by the following events:
- A pull request being opened.
- An issue being opened.
- ## Jobs
The workflow has a single job named `add-to-project`. The following step is executed in this job:
- The `add-to-project` job uses the `actions/add-to-project@v0.4.0` action to add pull requests and issues to a specific project board. The `with` parameters are `project-url` and `github-token`, which specify the URL of the project board and the GitHub token used to authenticate the action.
For more details, please refer to the [add-to-project.yaml](https://github.com/ROCm/AMDMIGraphX/blob/develop/.github/workflows/add-to-project.yaml) file in the repository.
---
## `benchmark.yaml`
This workflow runs the `MiGraphX performance benchmarks` and generates reports by comparing the results with the reference data.
- ## Trigger
TODO: Update [benchmarks.yml (archived)](https://github.com/ROCmSoftwarePlatform/actions/blob/main/.github/workflows/benchmarks.yml) link after workflow is updated
- The workflow is triggered manually through the "Run workflow" button in the Actions tab of the repository and it will run reusable workflow [benchmarks.yml (archived)](https://github.com/ROCmSoftwarePlatform/actions/blob/main/.github/workflows/benchmarks.yml)
- ## Input Parameters
The workflow uses the following input parameters:
- `rocm_version`: the version of ROCm to use for running the benchmarks.
- `script_repo`: repository that contains the benchmark scripts.
- `result_path`: the path where benchmark results will be stored.
- `result_repo`: the repository where the benchmark results will be pushed for comparison.
For more details, please refer to the [benchmark.yaml](https://github.com/ROCm/AMDMIGraphX/blob/develop/.github/workflows/benchmark.yaml) file in the repository.
---
## `ci.yaml`
Overall, this workflow automates the process of building and testing the AMDMIGraphX project across multiple platforms and versions.
- ## Trigger
The workflow is triggered by the following events:
- A pull request being opened, synchronized or closed.
- On push to the `develop`, `master`, and `release/**` branches.
- ## Jobs
The following jobs are executed in the workflow:
- `cancel`: This job is responsible for canceling any previous runs of the workflow that may still be running. It runs on an `ubuntu-latest` runner and uses the `styfle/cancel-workflow-action` action to cancel any previous runs of the workflow.
- `tidy`: It runs on an `ubuntu-20.04` runner and runs `clang-tidy` for the codebase in a Docker container with the MIGraphX build environment.
- `cppcheck`: It runs on an `ubuntu-20.04` runner and performs static analysis on code in a Docker container, and caches the results for faster subsequent runs.
- `format`: It runs on an `ubuntu-20.04` runner and includes steps for freeing up disk space, caching Docker layers, and checking code formatting.
- `pyflakes`: It runs on an `ubuntu-20.04` runner and runs the Pyflakes static analysis tool to detect and report Python code issues.
- `licensing`: It runs on an `ubuntu-20.04` runner and includes steps to free up space, checkout the code, set up Python and run a license check using a Python script.
We have 2 jobs with multiple matrix configurations, both of them are running on `ubuntu-20.04` runner but right now only `linux` works on all 3 configurations (debug, release, codecov) ,`linux-fpga` works just on (debug).
- `linux`: this job runs continuous integration tests for AMDMIGraphX on a Linux operating system. It tests a variety of build configurations to ensure code quality and compatibility.
- `linux-fpga`: this job builds and tests AMDMIGraphX on a Linux operating system with support for FPGA acceleration. It includes additional steps to verify FPGA functionality and performance.
For more details, please refer to the [ci.yaml](https://github.com/ROCm/AMDMIGraphX/blob/develop/.github/workflows/ci.yaml) file in the repository.
---
## `clean-closed-pr-caches.yaml`
This workflow has purpose to clean up any cached data related to the pull request.
- ## Trigger
The workflow is triggered by the following events:
- A pull request being closed.
- ## Jobs
The workflow has a single job named `cleanup`. The following steps are executed in this job:
- `Check out code`: step checks out the codebase from the repository.
- `Cleanup`: step performs the actual cache cleanup using a series of commands.
For more details, please refer to the [clean-closed-pr-caches.yaml](https://github.com/ROCm/AMDMIGraphX/blob/develop/.github/workflows/clean-closed-pr-caches.yaml) file in the repository.
---
## `history.yaml`
This workflow generates a report of the MiGraphX benchmark results between two dates and sends it to a specified email address. The report is also uploaded to a specified repository.
- ## Trigger
- The workflow is triggered manually through the "Run workflow" button in the Actions tab of the repository and it will run reusable workflow [history.yml](https://github.com/ROCm/migraphx-benchmark/blob/main/.github/workflows/history.yml)
- ## Input Parameters
The workflow requires the following inputs:
- `start_date`: Start date for results analysis.
- `end_date`: End date for results analysis.
- `history_repo`: Repository for history results between dates.
- `benchmark_utils_repo`: Repository where benchmark utils are stored.
- `organization`: Organization based on which location of files will be different.
For more details, please refer to the [history.yaml](https://github.com/ROCm/AMDMIGraphX/blob/develop/.github/workflows/history.yaml) file in the repository.
---
## `performance.yaml`
This workflow runs performance tests on the MIGraphX repository and generates a report of the results.
- ## Trigger
The workflow will run reusable workflow [perf-test.yml](https://github.com/ROCm/migraphx-benchmark/blob/main/.github/workflows/perf-test.yml) by the following events:
- Pull requests opened, synchronized or closed on the `develop` branch.
- Schedule: Runs every day of the week from Monday to Saturday at 6:00 AM.
- Manual trigger through the "Run workflow" button in the Actions tab of the repository.
- ## Input Parameters
The workflow requires the following inputs:
- `rocm_release`: ROCm version to use for the performance tests.
- `performance_reports_repo`: Repository where the performance reports are stored.
- `benchmark_utils_repo`: Repository where the benchmark utilities are stored.
- `organization`: Organization based on which location of files will be different.
- `result_number`: Last N results.
- `model_timeout`: If a model in the performance test script passes this threshold, it will be skipped.
- `flags`: Command line arguments to be passed to the performance test script. Default is `-r`.
For more details, please refer to the [performance.yaml](https://github.com/ROCm/AMDMIGraphX/blob/develop/.github/workflows/performance.yaml) file in the repository.
---
## `rocm-image-release.yaml`
This workflow builds a Docker image for a specified ROCm release version and pushes it to the specified repository. If image already exists nothing will happen, and there is also option to overwrite existing image.
- ## Trigger
- The workflow is triggered manually through the "Run workflow" button in the Actions tab of the repository and it will run reusable workflow [rocm-release.yml](https://github.com/ROCm/migraphx-benchmark/blob/main/.github/workflows/rocm-release.yml)
- ## Input Parameters
The workflow requires the following inputs:
- `rocm_release`: ROCm release version to build Docker image for.
- `benchmark_utils_repo`: Repository where benchmark utils are stored.
- `base_image`: Base image for ROCm Docker build.
- `docker_image`: Docker image name for ROCm Docker build.
- `build_navi`: Build number for the Navi architecture.
- `organization`: The organization name used to determine the location of files.
- `overwrite`: Specify whether to overwrite the Docker image if it already exists.
For more details, please refer to the [rocm-image-release.yaml](https://github.com/ROCm/AMDMIGraphX/blob/develop/.github/workflows/rocm-image-release.yaml) file in the repository.
---
## `sync-onnxrt-main.yaml`
This workflow updates a file with the latest commit hash then creates a pull request using the updated commit hash and adds labels, assignees, reviewers, and a title and body to describe the changes.
- ## Trigger
The workflow is triggered by the following events:
- Schedule: Runs every week on Friday at 05:07 PM.
- ## Jobs
The workflow has a single job named `Update and create pull request`. The following steps are executed in this job:
- `get_date`: step sets an environment variable to the current date in the format 'YYYY-MM-DD'.
- `extract_sha1`: step fetches the latest SHA1 commit hash of the HEAD branch of the `microsoft/onnxruntime` repository and sets it as an environment variable.
- `echo_sha1`: step prints the SHA1 commit hash set in step `extract_sha1`.
- `actions/checkout@v4.1.1`: step checks out the codebase from the repository.
- `update_file`: step updates a file in the repository with the SHA1 commit hash fetched in step `extract_sha1`.
- `Make changes to pull request`: step uses the `peter-evans/create-pull-request` action to create a pull request.
For more details, please refer to the [sync-onnxrt-main.yaml](https://github.com/ROCm/AMDMIGraphX/blob/develop/.github/workflows/sync-onnxrt-main.yaml) file in the repository.
---
ROCm-AMDMIGraphX-46524e8/.github/workflows/add-to-project.yaml 0000664 0000000 0000000 00000000616 15104657024 0023640 0 ustar 00root root 0000000 0000000 name: Add items to GH project
on:
pull_request:
types:
- opened
issues:
types:
- opened
jobs:
add-to-project:
name: Add PRs and issues to MIGX project
runs-on: ubuntu-latest
steps:
- uses: actions/add-to-project@v0.4.0
with:
project-url: https://github.com/orgs/ROCm/projects/3
github-token: ${{ secrets.TEST_PR_WORKFLOW }}
ROCm-AMDMIGraphX-46524e8/.github/workflows/benchmark.yaml 0000664 0000000 0000000 00000000612 15104657024 0022752 0 ustar 00root root 0000000 0000000 name: MiGraphX Benchmark
on:
workflow_dispatch:
jobs:
benchmark:
uses: ROCmSoftwarePlatform/actions/.github/workflows/benchmarks.yml@main
with:
rocm_version: 7.1
script_repo: migraphx-benchmark/benchmark-utils
result_path: /usr/share/migraphx/test-results
result_repo: ROCm/comparison-results
secrets:
gh_token: ${{ secrets.MIGRAPHX_BOT_TOKEN }}
ROCm-AMDMIGraphX-46524e8/.github/workflows/ci.yaml 0000664 0000000 0000000 00000052524 15104657024 0021424 0 ustar 00root root 0000000 0000000 name: migraphx
on:
pull_request:
push:
branches:
- develop
- master
- 'release/**'
env:
DOCKER_USER: ${{secrets.DOCKERHUB_USERID}}
DOCKER_TOKEN: ${{secrets.DOCKERHUB_TOKEN}}
DOCKER_IMAGE_UBUNTU: "rocm/migraphx-ci-ubuntu"
DOCKER_IMAGE_SLES: "rocm/migraphx-ci-sles"
jobs:
cancel:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
check_image:
name: Check if image exists in registry
runs-on: ubuntu-latest
outputs:
imageexists: ${{ steps.check_image.outputs.imageexists }}
imagetag: ${{ steps.image_hash.outputs.imagetag }}
imageexists_sles: ${{ steps.check_image.outputs.imageexists_sles }}
imagetag_sles: ${{ steps.image_hash.outputs.imagetag_sles }}
steps:
- name: Checkout Code
uses: actions/checkout@v4.2.2
- name: Create Image Tag
id: image_hash
run: |
echo "imagetag=hip-clang-${{hashFiles('**/hip-clang.docker', '**/*requirements.txt', '**/requirements-py.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT
echo "imagetag_sles=hip-clang-${{hashFiles('**/tools/docker/sles.docker', '**/*requirements.txt','**/requirements-py.txt', '**/install_prereqs.sh', '**/rbuild.ini')}}" >> $GITHUB_OUTPUT
- name: Check if image is built already
id: check_image
env:
DOCKER_TAG_UBUNTU: ${{ steps.image_hash.outputs.imagetag }}
DOCKER_TAG_SLES: ${{ steps.image_hash.outputs.imagetag_sles }}
run: |
if [[ "$(docker manifest inspect $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU 2> /dev/null)" != "" ]]; then
echo "imageexists=true" >> $GITHUB_OUTPUT
echo "Image already exists, skip building available"
else
echo "imageexists=false" >> $GITHUB_OUTPUT
echo "Tag does not exist, build and publishing required"
fi
if [[ "$(docker manifest inspect $DOCKER_IMAGE_SLES:$DOCKER_TAG_SLES 2> /dev/null)" != "" ]]; then
echo "imageexists_sles=true" >> $GITHUB_OUTPUT
echo "SLES Image already exists, skip building available"
else
echo "imageexists_sles=false" >> $GITHUB_OUTPUT
echo "SLES Tag does not exist, build and publishing required"
fi
build_image:
name: Build image
runs-on: ROCM-Ubuntu
needs: check_image
if: ${{ needs.check_image.outputs.imageexists != 'true' }}
steps:
- uses: actions/checkout@v4.2.2
- name: Build and publish
env:
DOCKER_TAG_UBUNTU: ${{ needs.check_image.outputs.imagetag }}
run: |
# The TOKEN and USERID are github secrets, Action failures at this step
# can come from a PR from a fork changing a file which forces a rebuild
# Resolve by making an internal PR of the Forked PR
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
docker pull $DOCKER_IMAGE_UBUNTU:latest || true
docker build . --file hip-clang.docker --cache-from $DOCKER_IMAGE_UBUNTU:latest --tag $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU --tag $DOCKER_IMAGE_UBUNTU:latest;
docker push $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU;
docker push $DOCKER_IMAGE_UBUNTU:latest;
build_SLES_image:
name: Build SLES image
runs-on: ROCM-Ubuntu
needs: check_image
if: ${{ needs.check_image.outputs.imageexists_sles != 'true' }}
steps:
- uses: actions/checkout@v4.2.2
- name: Build and publish SLES
env:
DOCKER_TAG_SLES: ${{ needs.check_image.outputs.imagetag_sles }}
run: |
# The TOKEN and USERID are github secrets, Action failures at this step
# can come from a PR from a fork changing a file wichi forces a rebuild
# Resolve by making an internal PR of the Forked PR
echo $DOCKER_TOKEN | docker login -u $DOCKER_USER --password-stdin
docker pull $DOCKER_IMAGE_SLES:latest || true
docker build . --file ./tools/docker/sles.docker --cache-from $DOCKER_IMAGE_SLES:latest --tag $DOCKER_IMAGE_SLES:$DOCKER_TAG_SLES --tag $DOCKER_IMAGE_SLES:latest;
docker push $DOCKER_IMAGE_SLES:$DOCKER_TAG_SLES;
docker push $DOCKER_IMAGE_SLES:latest;
tidy:
runs-on: ROCM-Ubuntu
needs: [ build_image, check_image ]
env:
DOCKER_TAG_UBUNTU: ${{ needs.check_image.outputs.imagetag }}
if: ${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
steps:
- uses: actions/checkout@v4.2.2
- name: Restore cache files for tidy
uses: actions/cache/restore@v4.2.0
id: tidy_restore
with:
path: tidy-cache
key: tidy-cache-${{ github.ref }}
restore-keys: tidy-cache-
- name: Clang Tidy
shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU bash < {0}"
run: |
mkdir build
cd build
CXX=/opt/rocm/llvm/bin/clang++ CC=/opt/rocm/llvm/bin/clang cmake \
-DMIGRAPHX_ENABLE_GPU=On \
-DMIGRAPHX_ENABLE_CPU=On \
-DMIGRAPHX_ENABLE_FPGA=On \
-DBUILD_DEV=On \
-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
# GH actions can not update existing cache, as a workaround clear cache and then save it
- name: Clear tidy cache before saving
continue-on-error: true
if: ${{ steps.tidy_restore.outputs.cache-hit }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install actions/gh-actions-cache --pin v1.0.1
gh actions-cache delete ${{ steps.tidy_restore.outputs.cache-matched-key }} --confirm
- name: Save cache files for tidy
uses: actions/cache/save@v4.2.0
if: always()
with:
path: tidy-cache
key: tidy-cache-${{ github.ref }}
cppcheck:
runs-on: ROCM-Ubuntu
needs: [ build_image, check_image ]
env:
DOCKER_TAG_UBUNTU: ${{ needs.check_image.outputs.imagetag }}
if: ${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
steps:
- uses: actions/checkout@v4.2.2
- name: Restore cache files for cppcheck
id: cppcheck_restore
uses: actions/cache/restore@v4.2.0
with:
path: cppcheck-cache
key: cppcheck-cache-1-${{ hashFiles('tools/cppcheck/rules.xml', 'tools/cppcheck/migraphx.py', 'CMakeLists.txt') }}-${{ github.ref }}
restore-keys: cppcheck-cache-1-${{ hashFiles('tools/cppcheck/rules.xml', 'tools/cppcheck/migraphx.py', 'CMakeLists.txt') }}-
- name: Cppcheck
shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU bash < {0}"
run: |
mkdir build
cd build
CXX=/opt/rocm/llvm/bin/clang++ CC=/opt/rocm/llvm/bin/clang cmake \
-DCPPCHECK_BUILD_DIR=/data/cppcheck-cache \
-DBUILD_DEV=On \
-DROCM_ENABLE_GH_ANNOTATIONS=On \
-DGPU_TARGETS=gfx908 \
..
make -j$(nproc) cppcheck
# GH actions can not update existing cache, as a workaround clear cache and then save it
- name: Clear cppcheck cache before saving
continue-on-error: true
if: ${{ steps.cppcheck_restore.outputs.cache-hit }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install actions/gh-actions-cache --pin v1.0.1
gh actions-cache delete ${{ steps.cppcheck_restore.outputs.cache-matched-key }} --confirm
- name: Save cache files for cppcheck
uses: actions/cache/save@v4.2.0
if: always()
with:
path: cppcheck-cache
key: cppcheck-cache-${{ hashFiles('cppcheck.rules', 'CMakeLists.txt') }}-${{ github.ref }}
format:
runs-on: ubuntu-latest
needs: [ build_image, check_image ]
env:
DOCKER_TAG_UBUNTU: ${{ needs.check_image.outputs.imagetag }}
if: ${{ !cancelled() && (needs.build_image.result == 'success' || needs.build_image.result == 'skipped') }}
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Free space
uses: jlumbroso/free-disk-space@main
continue-on-error: true
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
docker-images: true
- name: Check formatting
shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER_IMAGE_UBUNTU:$DOCKER_TAG_UBUNTU bash < {0}"
run: |
set -e
git config --global --add safe.directory /data
python3 tools/format.py origin/${{ github.event_name == 'pull_request' && github.base_ref || 'develop' }}
sles:
runs-on: ROCM-Ubuntu
needs: [ build_SLES_image, check_image ]
env:
DOCKER_TAG_SLES: ${{ needs.check_image.outputs.imagetag_sles }}
if: ${{ !cancelled() && (needs.build_SLES_image.result == 'success' || needs.build_SLES_image.result == 'skipped') }}
steps:
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Restore cache files for ccache
uses: actions/cache/restore@v4.2.0
id: ccache_restore
with:
path: ${{ github.workspace }}/ccache
key: ccache-sles-${{ github.ref }}
restore-keys: ccache-sles-
- name: Build migraphx
shell: bash -c "docker run -i -v=$GITHUB_WORKSPACE:/data -w /data $DOCKER_IMAGE_SLES:$DOCKER_TAG_SLES bash < {0}"
run: |
set -e
export CCACHE_COMPRESSLEVEL=10
export CCACHE_DIR=/data/ccache
export CCACHE_NOHASHDIR=true
export CCACHE_BASEDIR=/data
export CCACHE_MAXSIZE=1
mkdir build
cd build
CXX=/opt/rocm/llvm/bin/clang++ CC=/opt/rocm/llvm/bin/clang cmake \
-DMIGRAPHX_DISABLE_LARGE_BUFFER_TESTS=On \
-DBUILD_DEV=On \
-DCMAKE_CXX_COMPILER_LAUNCHER=/usr/local/bin/ccache \
-DCMAKE_C_COMPILER_LAUNCHER=/usr/local/bin/ccache \
-DCMAKE_CXX_FLAGS="-Werror" \
-DGPU_TARGETS=gfx908 \
..
make -j$(nproc) tests driver
- name: Clear ccache cache before saving
continue-on-error: true
if: ${{ steps.ccache_restore.outputs.cache-hit }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install actions/gh-actions-cache --pin v1.0.1
gh actions-cache delete ${{ steps.ccache_restore.outputs.cache-matched-key }} --confirm
- name: Save cache files for ccache
uses: actions/cache/save@v4.2.0
if: always()
with:
path: ${{ github.workspace }}/ccache
key: ccache-sles-${{ github.ref }}
pyflakes:
runs-on: ubuntu-24.04
steps:
- name: Free space
uses: jlumbroso/free-disk-space@main
continue-on-error: true
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
docker-images: true
- uses: actions/checkout@v4.2.2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install pyflakes
run: pip install pyflakes==2.4.0 mypy==0.931
- name: Run pyflakes
run: |
pyflakes --version
pyflakes examples/ tools/ src/ test/ docs/
mypy --version
mypy tools/api.py
licensing:
runs-on: ubuntu-24.04
steps:
- name: Free space
uses: jlumbroso/free-disk-space@main
continue-on-error: true
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
docker-images: true
- uses: actions/checkout@v4.2.2
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.12
- name: Run License Check
run: python3 tools/check_stamped.py origin/${{ github.event_name == 'pull_request' && github.base_ref || 'develop' }}
linux:
runs-on: ${{ matrix.os }}
env:
CCACHE_COMPRESSLEVEL: 10
CCACHE_DIR: ${{github.workspace}}/ccache
CCACHE_NOHASHDIR: true
CCACHE_BASEDIR: ${{github.workspace}}
CCACHE_MAXSIZE: 1
strategy:
matrix:
os:
- ubuntu-24.04
configuration:
- debug
- release
- codecov
steps:
- name: Free space
uses: jlumbroso/free-disk-space@main
continue-on-error: true
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
docker-images: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.9
with:
cmake-version: 3.20.0
- name : Install rbuild and lld
run: |
sudo apt-get install -y lld
python -m pip install --upgrade pip
pip install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
- uses: actions/checkout@v4.2.2
- name: Cache dependencies
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
uses: actions/cache@v4.2.0
id: deps_cache
with:
# This path is specific to Ubuntu
path: ${{ github.workspace }}/cget
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ matrix.os }}-cget-4-${{ hashFiles('requirements.txt', 'dev-requirements.txt', 'rbuild.ini') }}
restore-keys: ${{ matrix.os }}-cget-4-
- name: Install dependencies
run: rbuild prepare -d cget -s gh
- name: Restore cache files for ccache
uses: actions/cache/restore@v4.2.0
id: ccache_restore
with:
path: ${{ github.workspace }}/ccache
key: ${{ matrix.os }}-${{ matrix.configuration }}-ccache-${{ github.ref }}
restore-keys: ${{ matrix.os }}-${{ matrix.configuration }}-ccache-
- name: Build and test
env:
CMAKE_PREFIX_PATH: ${{ github.workspace }}/cget
CCACHE_LOGFILE: /tmp/ccache.log
CXXFLAGS: -Werror -pthread -fdebug-prefix-map=$PWD=. -fdebug-types-section -DMIGRAPHX_USE_TYPE_ERASED_MATCHERS=1 --param ggc-min-expand=5 --param ggc-min-heapsize=8192
run: |
echo "leak:dnnl::impl::malloc" > suppressions.txt
export LSAN_OPTIONS="suppressions=$(pwd)/suppressions.txt"
rbuild build -d cget -s gh -T check \
-DCMAKE_BUILD_TYPE=${{matrix.configuration}} \
-DMIGRAPHX_ENABLE_PYTHON=${{matrix.configuration == 'release' && 'On' || 'Off'}} \
-DMIGRAPHX_DISABLE_LARGE_BUFFER_TESTS=On \
-DBUILD_DEV=On \
-DCMAKE_CXX_FLAGS_DEBUG="-g1 -Os -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined" \
-DCMAKE_CXX_FLAGS_CODECOV="-g1 -Og -fprofile-arcs -ftest-coverage -fno-omit-frame-pointer" \
-DCMAKE_EXE_LINKER_FLAGS='-fuse-ld=lld' \
-DCMAKE_SHARED_LINKER_FLAGS='-fuse-ld=lld'
${{ github.workspace }}/cget/bin/ccache -s
# GH actions can not update existing cache, as a workaround clear cache and then save it
- name: Clear ccache cache before saving
continue-on-error: true
if: ${{ steps.ccache_restore.outputs.cache-hit }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install actions/gh-actions-cache --pin v1.0.1
gh actions-cache delete ${{ steps.ccache_restore.outputs.cache-matched-key }} --confirm
- name: Save cache files for ccache
uses: actions/cache/save@v4.2.0
if: always()
with:
path: ${{ github.workspace }}/ccache
key: ${{ matrix.os }}-${{ matrix.configuration }}-ccache-${{ github.ref }}
- name: Upload code coverage
if: "matrix.configuration == 'codecov'"
env:
CODECOV_TOKEN: "f5d5a10b-3177-4c76-b25f-9b1c2f165e8b"
run: |
sudo apt-get install -y lcov
cd build
lcov --directory . --capture --output-file $(pwd)/coverage.info --ignore-errors mismatch
lcov --remove $(pwd)/coverage.info '/usr/*' --output-file $(pwd)/coverage.info
lcov --list $(pwd)/coverage.info
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}
echo "Uploaded"
linux-fpga:
continue-on-error: true
runs-on: ${{ matrix.os }}
env:
CCACHE_COMPRESSLEVEL: 10
CCACHE_DIR: ${{github.workspace}}/ccache
CCACHE_NOHASHDIR: true
CCACHE_BASEDIR: ${{github.workspace}}
CCACHE_MAXSIZE: 1
strategy:
matrix:
os:
- ubuntu-24.04
configuration:
- debug
#- release Uncomment when ready to test release builds
#- codecov Uncomment when ready for codecov
steps:
- name: Free space
uses: jlumbroso/free-disk-space@main
continue-on-error: true
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
docker-images: true
- uses: actions/checkout@v4.2.2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Cache dependencies
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
uses: actions/cache@v4.2.0
with:
# This path is specific to Ubuntu
path: ${{ github.workspace }}/cget
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ matrix.os }}-cget-4-${{ hashFiles('requirements.txt', 'dev-requirements.txt') }}
restore-keys: ${{ matrix.os }}-cget-4-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
rbuild prepare -d cget -s gh
sudo apt-get install -y lld
- name: Restore cache files for ccache
id: ccache_restore_fpga
uses: actions/cache/restore@v4.2.0
with:
path: ${{ github.workspace }}/ccache
key: ${{ matrix.os }}-${{ matrix.configuration }}-ccache-${{ github.ref }}
restore-keys: ${{ matrix.os }}-${{ matrix.configuration }}-ccache-
- name: Build and test
env:
CMAKE_PREFIX_PATH: ${{ github.workspace }}/cget
CCACHE_LOGFILE: /tmp/ccache.log
CXXFLAGS: -Werror -pthread -DMIGRAPHX_USE_TYPE_ERASED_MATCHERS=1 --param ggc-min-expand=5 --param ggc-min-heapsize=8192
run: |
echo "leak:dnnl::impl::malloc" > suppressions.txt
export LSAN_OPTIONS="suppressions=$(pwd)/suppressions.txt"
rbuild build -d cget -s gh -T check \
-DCMAKE_BUILD_TYPE=${{matrix.configuration}} \
-DMIGRAPHX_ENABLE_PYTHON=${{matrix.configuration == 'release' && 'On' || 'Off'}} \
-DMIGRAPHX_DISABLE_LARGE_BUFFER_TESTS=On \
-DBUILD_DEV=On \
-DCMAKE_CXX_FLAGS_DEBUG="-g1 -Os -fdebug-prefix-map=$PWD=. -fdebug-types-section -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined" \
-DCMAKE_CXX_FLAGS_CODECOV="-g1 -Og -fdebug-prefix-map=$PWD=. -fdebug-types-section -fprofile-arcs -ftest-coverage -fno-omit-frame-pointer" \
-DCMAKE_EXE_LINKER_FLAGS='-fuse-ld=lld' \
-DCMAKE_SHARED_LINKER_FLAGS='-fuse-ld=lld' \
-DMIGRAPHX_ENABLE_FPGA=On
${{ github.workspace }}/cget/bin/ccache -s
# this is a workaround, with GH actions can not update existing cache
- name: Clear ccache cache before saving
continue-on-error: true
if: ${{ steps.ccache_restore_fpga.outputs.cache-hit }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh extension install actions/gh-actions-cache
gh actions-cache delete ${{ steps.ccache_restore_fpga.outputs.cache-matched-key }} --confirm
- name: Save cache files for ccache
uses: actions/cache/save@v4.2.0
if: always()
with:
path: ${{ github.workspace }}/ccache
key: ${{ matrix.os }}-${{ matrix.configuration }}-ccache-${{ github.ref }}
#- name: Upload code coverage
# if: "matrix.configuration == 'codecov'"
# env:
# CODECOV_TOKEN: "8545af1c-f90b-4345-92a5-0d075503ca56"
# run: |
# sudo apt-get install -y lcov
# cd build
# lcov --directory . --capture --output-file $(pwd)/coverage.info
# lcov --remove $(pwd)/coverage.info '/usr/*' --output-file $(pwd)/coverage.info
# lcov --list $(pwd)/coverage.info
# curl -Os https://uploader.codecov.io/latest/linux/codecov
# chmod +x codecov
# ./codecov -t ${CODECOV_TOKEN}
# echo "Uploaded"
misspell:
name: misspell
runs-on: ubuntu-24.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
ROCm-AMDMIGraphX-46524e8/.github/workflows/clean-closed-pr-caches.yaml 0000664 0000000 0000000 00000001663 15104657024 0025223 0 ustar 00root root 0000000 0000000 name: Cleanup caches of closed PR
on:
pull_request:
types:
- closed
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4.2.2
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache --pin v1.0.1
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 | tail -n +3)
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ROCm-AMDMIGraphX-46524e8/.github/workflows/config.md 0000664 0000000 0000000 00000002035 15104657024 0021724 0 ustar 00root root 0000000 0000000 #=====ROCM INFO=====
ROCM_VERSION : '7.1'
#default ROCm version to be used
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
USE_NAVI : '0'
#disable NAVI in image build
OVERWRITE_EXISTING : 'true'
#building new ROCm image overwrites old with same version
#=====REPOS INFO=====
ORGANIZATION_REPO : 'AMD'
BENCHMARK_UTILS_REPO : 'ROCm/migraphx-benchmark-utils'
PERFORMANCE_REPORTS_REPO : 'ROCm/migraphx-reports'
PERFORMANCE_BACKUP_REPO : 'migraphx-benchmark/performance-backup'
#=====PERFORMANCE SCRIPT PARAMETERS=====
RESULTS_TO_COMPARE : '10'
#number of previous performance results to be used in calculations
CALCULATION_METHOD_FLAG : '-r'
#calculation method used in reporting, -m for Max value; -s for Std dev; -r for Threshold file
PERFORMANCE_TEST_TIMEOUT : '30m'
#timeout for each model after which test is aborted
#===== W A R N I N G =====
#VARIABLE NAMES NOT TO BE CHANGED, VALUES ONLY!
#VALUES MUST BE ENGLOSED IN SINGLE QUOTES!
ROCm-AMDMIGraphX-46524e8/.github/workflows/history.yaml 0000664 0000000 0000000 00000002616 15104657024 0022527 0 ustar 00root root 0000000 0000000 name: History
on:
workflow_dispatch:
inputs:
start_date:
description: Start date for results analysis
required: true
default: 'yyyy-mm-dd'
end_date:
description: End date for results analysis
required: true
default: 'yyyy-mm-dd'
history_repo:
description: Repository for history results between dates
required: true
default: 'ROCm/migraphx-reports'
benchmark_utils_repo:
description: Repository where benchmark utils are stored
required: true
default: "ROCm/migraphx-benchmark-utils"
organization:
description: Organization based on which location of files will be different
required: true
default: "AMD"
jobs:
release:
uses: ROCm/migraphx-benchmark/.github/workflows/history.yml@main
with:
start_date: ${{ github.event.inputs.start_date || 'yyyy-mm-dd' }}
end_date: ${{ github.event.inputs.end_date || 'yyyy-mm-dd' }}
history_repo: ${{ github.event.inputs.history_repo || 'ROCm/migraphx-reports' }}
benchmark_utils_repo: ${{ github.event.inputs.benchmark_utils_repo || 'ROCm/migraphx-benchmark-utils' }}
organization: ${{ github.event.inputs.organization || 'AMD' }}
secrets:
gh_token: ${{ secrets.MIGRAPHX_BOT_TOKEN }}
mail_user: ${{ secrets.MAIL_USERNAME }}
mail_pass: ${{ secrets.MAIL_PASSWORD }}
ROCm-AMDMIGraphX-46524e8/.github/workflows/performance.yaml 0000664 0000000 0000000 00000011130 15104657024 0023316 0 ustar 00root root 0000000 0000000 name: MIGraphX Performance Tests
on:
pull_request_target:
branches: [develop]
types: [opened, synchronize, closed]
schedule:
- cron: "0 7 * * 1-6"
workflow_dispatch:
inputs:
rocm_release:
description: ROCm Version
required: true
default: '7.1'
performance_reports_repo:
description: Repository where performance reports are stored
required: true
default: 'ROCm/migraphx-reports'
benchmark_utils_repo:
description: Repository where benchmark utils are stored
required: true
default: "ROCm/migraphx-benchmark-utils"
organization:
description: Organization based on which location of files will be different
required: true
default: "AMD"
result_number:
description: Last N results
required: true
default: '10'
model_timeout:
description: If model in performance test script passes this threshold, it will be skipped
required: true
default: '30m'
performance_backup_repo:
description: Repository for backup
required: true
default: migraphx-benchmark/performance-backup
flags:
description: -m for Max value; -s for Std dev; -r for Threshold file
required: true
default: '-r'
concurrency:
group: "perftest-${{ github.head_ref || github.base_ref || 'schedule' }}"
cancel-in-progress: true
jobs:
get_config:
runs-on: ubuntu-latest
outputs:
rocm_version: ${{ steps.read_config.outputs.rocm_version }}
utils_repo: ${{ steps.read_config.outputs.utils_repo }}
reports_repo: ${{ steps.read_config.outputs.reports_repo }}
backup_repo: ${{ steps.read_config.outputs.backup_repo }}
repo_org: ${{ steps.read_config.outputs.repo_org }}
perf_number: ${{ steps.read_config.outputs.perf_number }}
perf_flag: ${{ steps.read_config.outputs.perf_flag }}
perf_timeout: ${{ steps.read_config.outputs.perf_timeout }}
steps:
- name: checkout
uses: actions/checkout@v4.2.2
- name: read_config
id: read_config
run: |
ROCM_VERSION=$(grep 'ROCM_VERSION' .github/workflows/config.md | cut -d "'" -f2)
BENCHMARK_UTILS_REPO=$(grep 'BENCHMARK_UTILS_REPO' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_REPORTS_REPO=$(grep 'PERFORMANCE_REPORTS_REPO' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_BACKUP_REPO=$(grep 'PERFORMANCE_BACKUP_REPO' .github/workflows/config.md | cut -d "'" -f2)
ORGANIZATION_REPO=$(grep 'ORGANIZATION_REPO' .github/workflows/config.md | cut -d "'" -f2)
RESULTS_TO_COMPARE=$(grep 'RESULTS_TO_COMPARE' .github/workflows/config.md | cut -d "'" -f2)
CALCULATION_METHOD_FLAG=$(grep 'CALCULATION_METHOD_FLAG' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_TEST_TIMEOUT=$(grep 'PERFORMANCE_TEST_TIMEOUT' .github/workflows/config.md | cut -d "'" -f2)
echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT
echo "utils_repo=$BENCHMARK_UTILS_REPO" >> $GITHUB_OUTPUT
echo "reports_repo=$PERFORMANCE_REPORTS_REPO" >> $GITHUB_OUTPUT
echo "backup_repo=$PERFORMANCE_BACKUP_REPO" >> $GITHUB_OUTPUT
echo "repo_org=$ORGANIZATION_REPO" >> $GITHUB_OUTPUT
echo "perf_number=$RESULTS_TO_COMPARE" >> $GITHUB_OUTPUT
echo "perf_flag=$CALCULATION_METHOD_FLAG" >> $GITHUB_OUTPUT
echo "perf_timeout=$PERFORMANCE_TEST_TIMEOUT" >> $GITHUB_OUTPUT
call_reusable:
needs: get_config
uses: ROCm/migraphx-benchmark/.github/workflows/perf-test.yml@main
with:
rocm_release: ${{ github.event.inputs.rocm_release || needs.get_config.outputs.rocm_version }}
benchmark_utils_repo: ${{ github.event.inputs.benchmark_utils_repo || needs.get_config.outputs.utils_repo }}
performance_reports_repo: ${{ github.event.inputs.performance_reports_repo || needs.get_config.outputs.reports_repo }}
performance_backup_repo: ${{ github.event.inputs.performance_backup_repo || needs.get_config.outputs.backup_repo }}
organization: ${{ github.event.inputs.organization || needs.get_config.outputs.repo_org }}
result_number: ${{ github.event.inputs.result_number || needs.get_config.outputs.perf_number }}
flags: ${{ github.event.inputs.flags || needs.get_config.outputs.perf_flag }}
model_timeout: ${{ github.event.inputs.model_timeout || needs.get_config.outputs.perf_timeout }}
secrets:
gh_token: ${{ secrets.MIGRAPHX_BOT_TOKEN }}
mail_user: ${{ secrets.MAIL_USERNAME }}
mail_pass: ${{ secrets.MAIL_PASSWORD }}
ROCm-AMDMIGraphX-46524e8/.github/workflows/rocm-image-release.yaml 0000664 0000000 0000000 00000003145 15104657024 0024462 0 ustar 00root root 0000000 0000000 name: ROCM Docker image build
on:
workflow_dispatch:
inputs:
rocm_release:
description: ROCm release version
required: true
benchmark-utils_repo:
description: Repository for benchmark utils
required: true
default: 'ROCm/migraphx-benchmark-utils'
base_image:
description: Base image for rocm Docker build
required: true
default: "rocm/dev-ubuntu-22.04"
docker_image:
description: Docker image name for rocm Docker build
required: true
default: "rocm-migraphx"
branch_name:
description: branch to use for building base ROCm image
required: true
default: "develop"
build_navi:
description: Build navi number
required: true
default: "0"
overwrite:
type: boolean
description: Overwrite image if it already exists
required: true
jobs:
release:
uses: ROCm/migraphx-benchmark/.github/workflows/rocm-release.yml@main
with:
rocm_release: ${{ github.event.inputs.rocm_release || '7.1' }}
benchmark-utils_repo: ${{ github.event.inputs.benchmark-utils_repo || 'ROCm/migraphx-benchmark-utils' }}
base_image: ${{ github.event.inputs.base_image || 'rocm/dev-ubuntu-22.04' }}
docker_image: ${{ github.event.inputs.docker_image || 'rocm-migraphx' }}
branch_name: ${{ github.event.inputs.branch_name || 'develop' }}
build_navi: ${{ github.event.inputs.build_navi || '0' }}
overwrite: ${{ github.event.inputs.overwrite == 'true' }}
secrets:
gh_token: ${{ secrets.MIGRAPHX_BOT_TOKEN }}
ROCm-AMDMIGraphX-46524e8/.github/workflows/sync-onnxrt-main.yaml 0000664 0000000 0000000 00000003420 15104657024 0024244 0 ustar 00root root 0000000 0000000 name: Onnxruntime main weekly sync
on:
schedule:
- cron: '07 17 * * 5'
jobs:
createPullRequest:
name: Update and create pull request
runs-on: ubuntu-latest
steps:
- name: get_date
run: echo todays_date="$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: extract_sha1
run: echo onnxsha="$(git ls-remote https://github.com/microsoft/onnxruntime.git HEAD | awk '{print $1}')" >> $GITHUB_ENV
- name: echo_sha1
run: echo ${{ env.onnxsha }}
- uses: actions/checkout@v4.2.2
with:
ref: develop
- name: update_file
run: echo ${{ env.onnxsha }} > test/onnx/.onnxrt-commit
- name: Make changes to pull request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update onnxruntime main ${{ env.onnxsha }}
committer: Github
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: onnxruntime-sync-${{ env.todays_date }}
delete-branch: true
title: 'Onnxruntime Weekly Sync ${{ env.todays_date }}'
body: |
Update CI point for Onnxruntime builds
- Updated with changes from ${{ env.todays_date }}
- Auto-generated by [create-pull-request][1]
- Update .onnxrt-commit to ${{ env.onnxsha }}
[1]: https://github.com/peter-evans/create-pull-request
labels: |
onnxruntime
dependencies
automated
skip bot checks
assignees: |
TedThemistokleous
reviewers: |
TedThemistokleous
causten
draft: false
base: develop
ROCm-AMDMIGraphX-46524e8/.github/workflows/sync_rocMLIR.yaml 0000664 0000000 0000000 00000007704 15104657024 0023334 0 ustar 00root root 0000000 0000000 name: rocMLIR sync with extended accuracy
on:
schedule:
- cron: '0 7 * * sun'
pull_request:
branches: [rocMLIR-sync-*]
types: [synchronize, closed]
workflow_dispatch:
inputs:
rocm_release:
type: string
description: ROCm release version
required: true
default: '6.4.2'
base_image:
type: string
description: Base image for ROCm Docker build
required: true
default: 'rocm/dev-ubuntu-22.04'
docker_image:
type: string
description: Docker image name for rocm Docker build
required: true
default: 'rocm-migraphx'
build_navi:
type: string
description: Build navi number
required: true
default: '0'
benchmark_utils_repo:
type: string
description: Repository where benchmark utils are stored
required: true
default: 'ROCm/migraphx-benchmark-utils'
performance_reports_repo:
description: Repository where performance reports are stored
required: true
default: 'ROCm/migraphx-reports'
organization:
type: string
description: Organization based on which location of files will be different
required: true
default: 'AMD'
jobs:
get_config:
runs-on: ubuntu-latest
outputs:
rocm_version: ${{ steps.read_config.outputs.rocm_version }}
rocm_base_image: ${{ steps.read_config.outputs.rocm_base_image }}
rocm_built_image: ${{ steps.read_config.outputs.rocm_built_image }}
use_navi: ${{ steps.read_config.outputs.use_navi }}
utils_repo: ${{ steps.read_config.outputs.utils_repo }}
reports_repo: ${{ steps.read_config.outputs.reports_repo }}
repo_org: ${{ steps.read_config.outputs.repo_org }}
steps:
- name: checkout
uses: actions/checkout@v4.2.2
- name: read_config
id: read_config
run: |
ROCM_VERSION=$(grep 'ROCM_VERSION' .github/workflows/config.md | cut -d "'" -f2)
ROCM_BASE_IMAGE=$(grep 'ROCM_BASE_IMAGE' .github/workflows/config.md | cut -d "'" -f2)
ROCM_BUILT_IMAGE=$(grep 'ROCM_BUILT_IMAGE' .github/workflows/config.md | cut -d "'" -f2)
BENCHMARK_UTILS_REPO=$(grep 'BENCHMARK_UTILS_REPO' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_REPORTS_REPO=$(grep 'PERFORMANCE_REPORTS_REPO' .github/workflows/config.md | cut -d "'" -f2)
ORGANIZATION_REPO=$(grep 'ORGANIZATION_REPO' .github/workflows/config.md | cut -d "'" -f2)
USE_NAVI=$(grep 'USE_NAVI' .github/workflows/config.ymd | cut -d "'" -f2)
echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT
echo "rocm_base_image=$ROCM_BASE_IMAGE" >> $GITHUB_OUTPUT
echo "rocm_built_image=$ROCM_BUILT_IMAGE" >> $GITHUB_OUTPUT
echo "use_navi=$USE_NAVI" >> $GITHUB_OUTPUT
echo "utils_repo=$BENCHMARK_UTILS_REPO" >> $GITHUB_OUTPUT
echo "reports_repo=$PERFORMANCE_REPORTS_REPO" >> $GITHUB_OUTPUT
echo "repo_org=$ORGANIZATION_REPO" >> $GITHUB_OUTPUT
call_reusable:
needs: get_config
uses: ROCm/migraphx-benchmark/.github/workflows/rocMLIR_sync.yml@main
with:
rocm_release: ${{ github.event.inputs.rocm_release || needs.get_config.outputs.rocm_version }}
base_image: ${{ github.event.inputs.base_image || needs.get_config.outputs.rocm_base_image }}
docker_image: ${{ github.event.inputs.docker_image || needs.get_config.outputs.rocm_built_image }}
build_navi: ${{ github.event.inputs.build_navi || needs.get_config.outputs.use_navi }}
benchmark_utils_repo: ${{ github.event.inputs.benchmark_utils_repo || needs.get_config.outputs.utils_repo }}
performance_reports_repo: ${{ github.event.inputs.performance_reports_repo || needs.get_config.outputs.reports_repo }}
organization: ${{ github.event.inputs.organization || needs.get_config.outputs.repo_org }}
secrets:
gh_token: ${{ secrets.MIGRAPHX_BOT_TOKEN }}
ROCm-AMDMIGraphX-46524e8/.github/workflows/unreleased_rocm.yaml 0000664 0000000 0000000 00000010574 15104657024 0024177 0 ustar 00root root 0000000 0000000 name: Specifed Release ROCm MIGraphX Performance Test
on:
workflow_dispatch:
inputs:
unreleased_rocm:
description: Specifed Release ROCm version
required: true
branch_name:
description: Branch to use for building base ROCm image
required: true
default: 'develop'
rocm_release:
description: Use tuned MIOpen database for ROCm release
required: true
default: '7.1'
performance_reports_repo:
description: Repository where performance reports are stored
required: true
default: 'ROCm/migraphx-reports'
benchmark_utils_repo:
description: Repository where benchmark utils are stored
required: true
default: "ROCm/migraphx-benchmark-utils"
organization:
description: Organization based on which location of files will be different
required: true
default: "AMD"
result_number:
description: Last N results
required: true
default: '10'
model_timeout:
description: If model in performance test script passes this threshold, it will be skipped
required: true
default: '30m'
flags:
description: -m for Max value; -s for Std dev; -r for Threshold file
required: true
default: '-r'
concurrency:
group: "perftest-${{ github.head_ref || github.base_ref || 'schedule' }}"
cancel-in-progress: true
jobs:
get_config:
runs-on: ubuntu-latest
outputs:
rocm_version: ${{ steps.read_config.outputs.rocm_version }}
utils_repo: ${{ steps.read_config.outputs.utils_repo }}
reports_repo: ${{ steps.read_config.outputs.reports_repo }}
repo_org: ${{ steps.read_config.outputs.repo_org }}
perf_number: ${{ steps.read_config.outputs.perf_number }}
perf_flag: ${{ steps.read_config.outputs.perf_flag }}
perf_timeout: ${{ steps.read_config.outputs.perf_timeout }}
steps:
- name: checkout
uses: actions/checkout@v4.2.2
- name: read_config
id: read_config
run: |
ROCM_VERSION=$(grep 'ROCM_VERSION' .github/workflows/config.md | cut -d "'" -f2)
BENCHMARK_UTILS_REPO=$(grep 'BENCHMARK_UTILS_REPO' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_REPORTS_REPO=$(grep 'PERFORMANCE_REPORTS_REPO' .github/workflows/config.md | cut -d "'" -f2)
ORGANIZATION_REPO=$(grep 'ORGANIZATION_REPO' .github/workflows/config.md | cut -d "'" -f2)
RESULTS_TO_COMPARE=$(grep 'RESULTS_TO_COMPARE' .github/workflows/config.md | cut -d "'" -f2)
CALCULATION_METHOD_FLAG=$(grep 'CALCULATION_METHOD_FLAG' .github/workflows/config.md | cut -d "'" -f2)
PERFORMANCE_TEST_TIMEOUT=$(grep 'PERFORMANCE_TEST_TIMEOUT' .github/workflows/config.md | cut -d "'" -f2)
echo "rocm_version=$ROCM_VERSION" >> $GITHUB_OUTPUT
echo "utils_repo=$BENCHMARK_UTILS_REPO" >> $GITHUB_OUTPUT
echo "reports_repo=$PERFORMANCE_REPORTS_REPO" >> $GITHUB_OUTPUT
echo "repo_org=$ORGANIZATION_REPO" >> $GITHUB_OUTPUT
echo "perf_number=$RESULTS_TO_COMPARE" >> $GITHUB_OUTPUT
echo "perf_flag=$CALCULATION_METHOD_FLAG" >> $GITHUB_OUTPUT
echo "perf_timeout=$PERFORMANCE_TEST_TIMEOUT" >> $GITHUB_OUTPUT
call_reusable:
needs: get_config
uses: ROCm/migraphx-benchmark/.github/workflows/unreleased_rocm.yml@main
with:
unreleased_rocm: ${{ github.event.inputs.unreleased_rocm || '' }}
branch_name: ${{ github.event.inputs.branch_name || 'develop' }}
rocm_release: ${{ github.event.inputs.rocm_release || needs.get_config.outputs.rocm_version }}
benchmark_utils_repo: ${{ github.event.inputs.benchmark_utils_repo || needs.get_config.outputs.utils_repo }}
performance_reports_repo: ${{ github.event.inputs.performance_reports_repo || needs.get_config.outputs.reports_repo }}
organization: ${{ github.event.inputs.organization || needs.get_config.outputs.repo_org }}
result_number: ${{ github.event.inputs.result_number || needs.get_config.outputs.perf_number }}
flags: ${{ github.event.inputs.flags || needs.get_config.outputs.perf_flag }}
model_timeout: ${{ github.event.inputs.model_timeout || needs.get_config.outputs.perf_timeout }}
secrets:
gh_token: ${{ secrets.MIGRAPHX_BOT_TOKEN }}
mail_user: ${{ secrets.MAIL_USERNAME }}
mail_pass: ${{ secrets.MAIL_PASSWORD }}
ROCm-AMDMIGraphX-46524e8/.github/workflows/weekly_master_sync.yaml 0000664 0000000 0000000 00000001026 15104657024 0024727 0 ustar 00root root 0000000 0000000 name: Master weekly sync
on:
schedule:
- cron: '0 15 * * sun'
workflow_dispatch:
jobs:
SyncAndMerge:
name: Sync master and merge develop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
ref: develop
fetch-depth: '0'
- name: Merge Fast Forward Only
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout master
git merge origin/develop --ff-only
git push origin HEAD
ROCm-AMDMIGraphX-46524e8/.gitignore 0000664 0000000 0000000 00000003172 15104657024 0016533 0 ustar 00root root 0000000 0000000 #==============================================================================#
# File extensions to be ignored anywhere in the tree.
#==============================================================================#
# Temp files created by most text editors
*~
# Merge files created by git
*.orig
# Byte compiled python modules
*.pyc
*.pyd
# Vim swap files
.*.sw?
.sw?
# Visual Studio
.vs
/.vscode/*
# Sublime Text settings
*.sublime-workspace
*.sublime-project
# Eclipse Project settings
*.*project
.settings
# OS X specific files
.DS_store
#==============================================================================#
# Explicit files to ignore (only matches one).
#==============================================================================#
# Various tags
/tags
/TAGS
/GPATH
/GRTAGS
/GSYMS
/GTAGS
/ID
.gitusers
/compile_commands.json
/CMakeSettings.json
# documentation artifacts
_toc.yml
#==============================================================================#
# Directories to ignore (do not add trailing '/'s, they skip symlinks).
#==============================================================================#
# Nested build directory
/build*
# Downloaded models
test/onnx/models
# VS2017 and VSCode config files.
.vscode
.vs
# documentation artifacts
docs/_build
docs/_images
docs/_static
docs/_templates
docs/doxygen/DoxygenWarningLog.txt
docs/doxygen/html/
docs/doxygen/xml/
docs/_doxygen
docs/html
/_readthedocs
# JetBrains config directories (ignoring symlinks)
.idea/
cmake-build*/
build*/
# Recommended location to install rbuild dependencies from README.md
depend*/
# local Python virtual environment
.venv/
ROCm-AMDMIGraphX-46524e8/.readthedocs.yaml 0000664 0000000 0000000 00000000572 15104657024 0017773 0 ustar 00root root 0000000 0000000 # Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2
sphinx:
configuration: docs/conf.py
formats: [htmlzip, pdf, epub]
python:
install:
- requirements: docs/sphinx/requirements.txt
build:
os: ubuntu-22.04
tools:
python: "mambaforge-22.9"
conda:
environment: docs/environment.yml
ROCm-AMDMIGraphX-46524e8/CHANGELOG.md 0000664 0000000 0000000 00000061666 15104657024 0016370 0 ustar 00root root 0000000 0000000 # Changelog for MIGraphX
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.14 for ROCm 7.1.1
### Added
### Changed
### Fixed
* Fixed error when running `make check` on systems running with a gfx1201 GPU (#4397)
### Optimized
### Removed
## MIGraphX 2.14 for ROCm 7.1.0
### Added
* Added Python 3.13 support.
* Added PyTorch wheels to the Dockerfile.
* Added Python API for returning serialized bytes.
* Added `fixed_pad` operator for padding dynamic shapes to the maximum static shape.
* Added matcher to upcast base `Softmax` operations.
* Added support for the `convolution_backwards` operator through rocMLIR.
* Added `LSE` output to attention fusion.
* Added flags to `EnableControlFlowGuard` due to BinSkim errors.
* Added new environment variable documentation and reorganized structure.
* Added `stash_type` attribute for `LayerNorm` and expanded test coverage.
* Added operator builders (phase 2).
* Added `MIGRAPHX_GPU_HIP_FLAGS` to allow extra HIP compile flags.
### Changed
* Updated C API to include `current()` caller information in error reporting.
* Updated documentation dependencies:
* **rocm-docs-core** bumped from 1.21.1 → 1.25.0 across releases.
* **Doxygen** updated to 1.14.0.
* **urllib3** updated from 2.2.2 → 2.5.0.
* Updated `src/CMakeLists.txt` to support `msgpack` 6.x (`msgpack-cxx`).
* Updated model zoo test generator to fix test issues and add summary logging.
* Updated `rocMLIR` and `ONNXRuntime` mainline references across commits.
* Updated module sorting algorithm for improved reliability.
* Restricted FP8 quantization to `dot` and `convolution` operators.
* Moved ONNX Runtime launcher script into MIGraphX and updated build scripts.
* Simplified ONNX `Resize` operator parser for correctness and maintainability.
* Updated `any_ptr` assertion to avoid failure on default HIP stream.
* Print kernel and module information on compile failure.
### Fixed
* Fixed error in `MIGRAPHX_GPU_COMPILE_PARALLEL` documentation (#4337).
* Fixed rocMLIR `rewrite_reduce` issue (#4218).
* Fixed bug with `invert_permutation` on GPU (#4194).
* Fixed compile error when `MIOPEN` is disabled (missing `std` includes) (#4281).
* Fixed ONNX `Resize` parsing when input and output shapes are identical (#4133, #4161).
* Fixed issue with MHA in attention refactor (#4152).
* Fixed synchronization issue from upstream ONNX Runtime (#4189).
* Fixed spelling error in “Contiguous†(#4287).
* Fixed tidy complaint about duplicate header (#4245).
* Fixed `reshape`, `transpose`, and `broadcast` rewrites between pointwise and reduce operators (#3978).
* Fixed extraneous include file in HIPRTC-based compilation (#4130).
* Fixed CI Perl dependency issue for SLES builds (#4254).
* Fixed compiler warnings for ROCm 7.0 of ``error: unknown warning option '-Wnrvo'`` (#4192).
### Optimized
* Reduced nested visits in reference operators to improve compile time.
* Avoided dynamic memory allocation during kernel launches.
* Removed redundant NOP instructions for GFX11/12 platforms.
* Improved `Graphviz` output (node color and layout updates).
* Optimized interdependency checking during compilation.
* Skip hipBLASLt solutions requiring workspace size larger than 128 MB for efficient memory utilization.
### Removed
* Removed Perl dependency from SLES builds.
* Removed redundant includes and unused internal dependencies.
## MIGraphX 2.13 for ROCm 7.0.0
### Added
* Support for OCP `FP8` on AMD Instinct MI350X accelerators.
* Support for PyTorch 2.7 via Torch-MIGraphX.
* Support for the Microsoft ONNX Contrib Operators (Self) Attention, RotaryEmbedding, QuickGelu, BiasAdd, BiasSplitGelu, SkipLayerNorm.
* Support for Sigmoid and AddN TensorFlow operators.
* Added GroupQuery Attention support for LLMs.
* Added support for edge mode in the ONNX Pad operator.
* Added ONNX runtime Python driver.
* Added FLUX e2e example.
* Added C++ and Python APIs to save arguments to a graph as a msgpack file, and then read the file back.
* Added rocMLIR fusion for kv-cache attention.
* Introduced a check for file-write errors.
### Changed
* `quantize_bf16` for quantizing the model to `BF16` has been made visible in the MIGraphX user API.
* Print additional kernel/module information in the event of compile failure.
* Use hipBLASLt instead of rocBLAS on newer GPUs.
* 1x1 convolutions are now rewritten to GEMMs.
* `BF16::max` is now represented by its encoding rather than its expected value.
* Direct warnings now go to `cout` rather `cerr`.
* `FP8` uses hipBLASLt rather than rocBLAS.
* ONNX models are now topologically sorted when nodes are unordered.
* Improved layout of Graphviz output.
* Enhanced debugging for migraphx-driver: consumed environment variables are printed, timestamps and duration are added to the summary.
* Add a trim size flag to the verify option for migraphx-driver.
* Node names are printed to track parsing within the ONNX graph when using the `MIGRAPHX_TRACE_ONNX_PARSER` flag.
* Update accuracy checker to output test data with the `--show-test-data` flag.
* The `MIGRAPHX_TRACE_BENCHMARKING` option now allows the problem cache file to be updated after finding the best solution.
### Removed
* `ROCM_USE_FLOAT8` macro.
* The BF16 GEMM test was removed for Navi21, as it is unsupported by rocBLAS and hipBLASLt on that platform.
### Optimized
* Use common average in `compile_ops` to reduce run-to-run variations when tuning.
* Improved the performance of the TopK operator.
* Conform to a single layout (NHWC or NCHW) during compilation rather than combining two.
* Slice Channels Conv Optimization (slice output fusion)
* Horizontal fusion optimization after pointwise operations.
* Reduced the number of literals used in `GridSample` linear sampler.
* Fuse multiple outputs for pointwise operations.
* Fuse reshapes on pointwise inputs for MLIR output fusion.
* MUL operation not folded into the GEMM when the GEMM is used more than once.
* Broadcast not fused after convolution or GEMM MLIR kernels.
* Avoid reduction fusion when operator data-types mismatch.
### Resolved issues
* Compilation workaround ICE in clang 20 when using `views::transform`.
* Fix bug with `reshape_lazy` in MLIR.
* Quantizelinear fixed for Nearbyint operation.
* Check for empty strings in ONNX node inputs for operations like Resize.
* Parse Resize fix: only check `keep_aspect_ratio_policy` attribute for sizes input.
* Nonmaxsuppression: fixed issue where identical boxes/scores not ordered correctly.
* Fixed a bug where events were created on the wrong device in a multi-gpu scenario.
* Fixed out of order keys in value for comparisons and hashes when caching best kernels.
* Fixed Controlnet MUL types do not match error.
* Fixed check for scales if ROI input is present in Resize operation.
* Einsum: Fixed a crash on empty squeeze operations.
## MIGraphX 2.12 for ROCm 6.4.0
### Added
* Support for gfx1200 and gfx1201
* hipBLASLt support for contiguous transpose GEMM fusion and GEMM pointwise fusions for improved performance
* Support for hardware specific FP8 datatypes (FP8 OCP and FP8 FNUZ)
* Add support for the BF16 datatype
* ONNX Operator Support for `com.microsoft.MultiHeadAttention`, `com.microsoft.NhwcConv`, and `com.microsoft.MatMulIntgerFloat`
* migraphx-driver can now produce output for use with Netron
* migraphx-driver now includes a `time` parameter (similar to `perf`) that is more accurate for very fast kernels
* An end-to-end Stable Diffusion 3 example with option to disable T5 encoder on VRAM-limited GPUs has been added
* Added support to track broadcast axes in `shape_transform_descriptor`
* Added support for unsigned types with `rocMLIR`
* Added a script to convert mxr files to ONNX models
* Added the `MIGRAPHX_SET_GEMM_PROVIDER` environment variable to choose between rocBLAS and hipBLASLt. Set `MIGRAPHX_SET_GEMM_PROVIDER` to `rocblas` to use rocBLAS, or to `hipblaslt` to use hipBLASLt.
### Changed
* With the exception of gfx90a, switched to using hipBLASLt instead of rocBLAS
* Included the min/max/median of the `perf` run as part of the summary report
* Enable non-packed inputs for `rocMLIR`
* Always output a packed type for q/dq after determining non-packed tensors were inefficient
* Even if using NHWC, MIGraphX will always convert group convolutions to NCHW for best performance
* Renamed the `layout_nhwc` to `layout_convolution` and ensured that either the weights are the same layout as the inputs or set the input and weights to NHWC
* Minimum version of Cmake is now 3.27
### Removed
* Removed `fp8e5m2fnuz` rocBLAS support
* `__AMDGCN_WAVEFRONT_SIZE` has been deprecated.
* Removed a warning that printed to stdout when using FP8 types
* Remove zero point parameter for dequantizelinear when its zero
### Optimized
* Prefill buffers when MLIR produces a multioutput buffer
* Improved the resize operator performance which should improve overall performance of models that use it
* Allow the `reduce` operator to be split across an axis to improve fusion performance. The `MIGRAPHX_SPLIT_REDUCE_SIZE` environment variable has been added to allow the minimum size of the reduction to be adjusted for a possible model specific performance improvement
* Added `MIGRAPHX_DISABLE_PASSES` environment variable for debugging
* Added `MIGRAPHX_MLIR_DUMP` environment variable to be set to a folder where individual final rocMLIR modules can be saved for investigation
* Improved the C++ API to allow onnxruntime access to fp8 quantization
### Resolved Issues
* Fixed multistream execution with larger models (#3757)
* Peephole LSTM Error (#3768)
* Fixed BertSquad example that could include a broken tokenizers package (#3556)
* Fixed Attention fusion ito not error with a shape mismatch when a trailing pointwise contains a literal (#3758)
* Fixed instruction::replace() logic to handle more complex cases (#3574)
* MatMulNBits could fail with a shape error (#3698)
* Fixed a bug were some models could fail to compile with an error `flatten: Shapes are not in standard layout` (#3579)
## 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 rocMLIR
* 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
* Added support for ONNX Runtime MIGraphX EP on Windows
* Added FP8 Python API
* Added examples for SD 2.1 and SDXL
* Improved Dynamic Batch to support BERT
* Added a `--test` flag in migraphx-driver to validate the installation
* Added support for ONNX Operator: Einsum
* Added uint8 support in ONNX Operators
* Added fusion for group convolutions
* Added rocMLIR conv3d support
* Added rocgdb to the Dockerfile
### Optimizations
* Improved ONNX Model Zoo coverage
* Reorganized memcpys with ONNX Runtime to improve performance
* Replaced scaler multibroadcast + unsqueeze with just a multibroadcast
* Improved MLIR kernel selection for multibroadcasted GEMMs
* Improved details of the perf report
* Enable mlir by default for GEMMs with small K
* Allow specifying dot or convolution fusion for mlir with environmental flag
* Improve performance on small reductions by doing multiple reduction per wavefront
* Add additional algebraic simplifications for mul-add-dot sequence of operations involving constants
* Use MLIR attention kernels in more cases
* Enables MIOpen and CK fusions for MI300 gfx arches
* Support for QDQ quantization patterns from Brevitas which have explicit cast/convert nodes before and after QDQ pairs
* Added Fusion of "contiguous + pointwise" and "layout + pointwise" operations which may result in performance gains in certain cases
* Added Fusion for "pointwise + layout" and "pointwise + contiguous" operations which may result in performance gains when using NHWC layout
* Added Fusion for "Pointwise + concat" operation which may help in performance in certain cases
* Fixes a bug in "concat + pointwise" fusion where output shape memory layout wasn't maintained
* Simplifies "slice + concat" pattern in SDXL UNet
* eliminates ZeroPoint/Shift in QuantizeLinear or DeQuantizeLinear ops if zero points values are zeros
* Improved inference performance by fusing Reduce to Broadcast
* Added additional information when printing the perf report
* Improve scalar fusions when not all strides are 0
* Added support for multi outputs in pointwise ops
* Improve reduction fusion with reshape operators
* Use the quantized output when an operator is used again
### Fixes
* Super Resolution model verification failed with FP16
* Suppressed confusing messages when compiling the model
* Mod operator failed to compile with int8 and int32 inputs
* Prevented spawning too many threads for constant propagation when parallel STL is not enabled
* Fixed a bug when running migraphx-driver with the --run 1 option
* Layernorm Accuracy fix: calculations in FP32
* Update Docker generator script to ROCm 6.1 to point at Jammy
* Floating Point exception fix for dim (-1) in reshape operator
* Fixed issue with int8 accuracy and models which were failing due to requiring a fourth bias input
* Fixed missing inputs not previously handled for quantized bias for the weights, and data values of the input matrix
* Fixed order of operations for int8 quantization which were causing inaccuracies and slowdowns
* Removed list initializer of prefix_scan_sum which was causing issues during compilation and resulting in the incorrect constructor to be used at compile
* Fixed the MIGRAPHX_GPU_COMPILE_PARALLEL flag to enable users to control number of threads used for parallel compilation
### Changes
* Changed default location of libraries with release specific ABI changes
* Reorganized documentation in GitHub
### Removals
* Removed the `--model` flag with migraphx-driver
## MIGraphX 2.9 for ROCm 6.1.0
### Additions
* Added beta version of FP8, functional, not performant
* Created a dockerfile with MIGraphX+ONNX Runtime EP+Torch
* Added support for the `Hardmax`, `DynamicQuantizeLinear`, `Qlinearconcat`, `Unique`, `QLinearAveragePool`, `QLinearSigmoid`, `QLinearLeakyRelu`, `QLinearMul`, `IsInf` operators
* Created web site examples for `Whisper`, `Llama-2`, and `Stable Diffusion 2.1`
* Created examples of using the ONNX Runtime MIGraphX Execution Provider with the `InceptionV3` and `Resnet50` models
* Updated operators to support ONNX Opset 19
* Enable fuse_pointwise and fuse_reduce in the driver
* Add support for dot-(mul)-softmax-dot offloads to MLIR
* Added Blas auto-tuning for GEMMs
* Added dynamic shape support for the multinomial operator
* Added fp16 to accuracy checker
* Added initial code for running on Windows OS
### Optimizations
* Improved the output of migraphx-driver command
* Documentation now shows all environment variables
* Updates needed for general stride support
* Enabled Asymmetric Quantization
* Added ScatterND unsupported reduction modes
* Rewrote softmax for better performance
* General improvement to how quantization is performed to support INT8
* Used problem_cache for gemm tuning
* Improved performance by always using rocMLIR for quantized convolution
* Improved group convolutions by using rocMLIR
* Improved accuracy of fp16 models
* ScatterElements unsupported reduction
* Added concat fusions
* Improved INT8 support to include UINT8
* Allow reshape ops between dq and quant_op
* Improve dpp reductions on navi
* Have the accuracy checker print the whole final buffer
* Added support for handling dynamic Slice and ConstantOfShape ONNX operators
* Add support for the dilations attribute to Pooling ops
* Add layout attribute support for LSTM operator
* Improved performance by removing contiguous for reshapes
* Handle all slice input variations
* Add scales attribute parse in upsample for older opset versions
* Added support for uneven Split operations
* Improved unit testing to run in python virtual environments
### Fixes
* Fixed outstanding issues in autogenerated documentation
* Update model zoo paths for examples
* Fixed promote_literals_test by using additional if condition
* Fixed export API symbols from dynamic library
* Fixed bug in pad operator from dimension reduction
* Fixed using the LD to embed files and enable by default when building shared libraries on linux
* fixed get_version()
* Fixed Round operator inaccuracy
* Fixed wrong size check when axes not present for slice
* Set the .SO version correctly
### Changes
* Cleanup LSTM and RNN activation functions
* Placed gemm_pointwise at a higher priority than layernorm_pointwise
* Updated README to mention the need to include GPU_TARGETS when building MIGraphX
### Removals
* Removed unused device kernels from Gather and Pad operators
* Removed int8x4 format
## MIGraphX 2.8 for ROCm 6.0.0
### Additions
* Support for MI300 GPUs
* Support for TorchMIGraphX via PyTorch
* Boosted overall performance by integrating rocMLIR
* INT8 support for ONNX Runtime
* Support for ONNX version 1.14.1
* Added new operators: `Qlinearadd`, `QlinearGlobalAveragePool`, `Qlinearconv`, `Shrink`, `CastLike`,
and `RandomUniform`
* Added an error message for when `gpu_targets` is not set during MIGraphX compilation
* Added parameter to set tolerances with `migraphx-driver` verify
* Added support for MXR files > 4 GB
* Added `MIGRAPHX_TRACE_MLIR` flag
* BETA added capability for using ROCm Composable Kernels via the `MIGRAPHX_ENABLE_CK=1`
environment variable
### Optimizations
* Improved performance support for INT8
* Improved time precision while benchmarking candidate kernels from CK or MLIR
* Removed contiguous from reshape parsing
* Updated the `ConstantOfShape` operator to support Dynamic Batch
* Simplified dynamic shapes-related operators to their static versions, where possible
* Improved debugging tools for accuracy issues
* Included a print warning about `miopen_fusion` while generating `mxr`
* General reduction in system memory usage during model compilation
* Created additional fusion opportunities during model compilation
* Improved debugging for matchers
* Improved general debug messages
### Fixes
* Fixed scatter operator for nonstandard shapes with some models from ONNX Model Zoo
* Provided a compile option to improve the accuracy of some models by disabling Fast-Math
* Improved layernorm + pointwise fusion matching to ignore argument order
* Fixed accuracy issue with `ROIAlign` operator
* Fixed computation logic for the `Trilu` operator
* Fixed support for the DETR model
### Changes
* Changed MIGraphX version to 2.8
* Extracted the test packages into a separate deb file when building MIGraphX from source
### Removals
* Removed building Python 2.7 bindings
## MIGraphX 2.7 for ROCm 5.7.0
### Additions
* hipRTC no longer requires dev packages for MIGraphX runtime and allows the ROCm install to be in a
different directory than build time
* Added support for multi-target execution
* Added Dynamic Batch support with C++/Python APIs
* Added `migraphx.create_argument` to Python API
* Added dockerfile example for Ubuntu 22.04
* Added TensorFlow supported ops in driver similar to exist onnx operator list
* Added a MIGRAPHX_TRACE_MATCHES_FOR env variable to filter the matcher trace
* Improved debugging by printing max,min,mean and stddev values for TRACE_EVAL = 2
* You can now use the ` fast_math` flag instead of `ENV` for GELU
* Print message from driver if offload copy is set for compiled program
### Optimizations
* Optimized for ONNX Runtime 1.14.0
* Improved compile times by only building for the GPU on the system
* Improved performance of pointwise/reduction kernels when using NHWC layouts
* Loaded specific version of the `migraphx_py` library
* Annotated functions with the block size so the compiler can do a better job of optimizing
* Enabled reshape on nonstandard shapes
* Used half HIP APIs to compute max and min
* Added support for broadcasted scalars to unsqueeze operator
* Improved multiplies with dot operator
* Handled broadcasts across dot and concat
* Added verify namespace for better symbol resolution
### Fixes
* Resolved accuracy issues with FP16 resnet50
* Updated cpp generator to handle inf from float
* Fixed assertion error during verify and made DCE work with tuples
* Fixed convert operation for NaNs
* Fixed shape typo in API test
* Fixed compile warnings for shadowing variable names
* Added missing specialization for the `nullptr` hash function
### Changees
* Bumped version of half library to 5.6.0
* Bumped CI to support ROCm 5.6
* Made building tests optional
* Replaced `np.bool` with `bool` per NumPy request
### Removals
* Removed int8x4 rocBlas calls due to deprecation
* Removed `std::reduce` usage because not all operating systems support it
## MIGraphX 2.5 for ROCm 5.5.0
### Additions
* Y-Model feature will store tuning information with the optimized model
* Added Python 3.10 bindings
* Accuracy checker tool based on ONNX runtime
* ONNX operators parse_split, and Trilu
* Build support for ROCm MLIR
* Added the `migraphx-driver` flag to print optimizations in Python (--python)
* Added JIT implementation of the Gather and Pad operators, which results in better handling for
larger tensor sizes
### Optimizations
* Improved performance of Transformer-based models
* Improved performance of the `Pad`, `Concat`, `Gather`, and `Pointwise` operators
* Improved ONNX/pb file loading speed
* Added a general optimize pass that runs several passes, such as `simplify_reshapes`, algebra, and DCE
in a loop
### Fixes
* Improved parsing for TensorFlow Protobuf files
* Resolved various accuracy issues with some ONNX models
* Resolved a gcc-12 issue with MIVisionX
* Improved support for larger sized models and batches
* Use `--offload-arch` instead of `--cuda-gpu-arch` for the HIP compiler
* Changes inside JIT to use float accumulator for large reduce ops of half type to avoid overflow
* Changes inside JIT to temporarily use cosine to compute sine function
### Changes
* Changed version and location of third-party build dependencies in order to pick up fixes
ROCm-AMDMIGraphX-46524e8/CMakeLists.txt 0000664 0000000 0000000 00000032477 15104657024 0017315 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "The binary and source directroy cannot be the same")
endif()
# Setup valid strings for build type
if (NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo;MinSizeRel" CACHE STRING "Configs")
endif()
get_property(MIGRAPHX_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
# This has to be initialized before the project() command appears
# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D. MSVC_IDE does not use CMAKE_BUILD_TYPE
if(NOT MIGRAPHX_GENERATOR_IS_MULTI_CONFIG)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel.")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
endif()
if(NOT WIN32)
set(CMAKE_INSTALL_PREFIX "/opt/rocm" CACHE PATH "")
set(CMAKE_BUILD_RPATH "${CMAKE_BINARY_DIR}/lib")
endif()
list(APPEND CMAKE_PREFIX_PATH /opt/rocm /opt/rocm/llvm $ENV{ROCM_PATH} $ENV{HIP_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
project(migraphx LANGUAGES C CXX)
include(CTest)
find_package(ROCmCMakeBuildTools REQUIRED)
find_package(Threads REQUIRED)
option(MIGRAPHX_ENABLE_PYTHON "Enable python bindings" ON)
if(WIN32)
option(MIGRAPHX_USE_MIOPEN "Enable MIGraphX to use MIOpen" OFF)
else()
option(MIGRAPHX_USE_MIOPEN "Enable MIGraphX to use MIOpen" ON)
endif()
option(MIGRAPHX_USE_ROCBLAS "Enable MIGraphX to use rocBLAS" ON)
option(MIGRAPHX_USE_HIPBLASLT "Enable MIGraphX to use hipBLASLt" ON)
if(MIGRAPHX_USE_HIPBLASLT AND NOT MIGRAPHX_USE_ROCBLAS)
message(FATAL_ERROR "hipBLASLt requires rocBLAS, but MIGRAPHX_USE_ROCBLAS is OFF")
endif()
# By default build shared libraries
option(BUILD_SHARED_LIBS "Create shared libraries" ON)
if(WIN32) # CK is not yet ported to Windows
option(MIGRAPHX_USE_COMPOSABLEKERNEL "Enable MIGraphX to use composable kernel JIT library" OFF)
else()
option(MIGRAPHX_USE_COMPOSABLEKERNEL "Enable MIGraphX to use composable kernel JIT library" ON)
endif()
find_path(HALF_INCLUDE_DIR half.hpp PATH_SUFFIXES half)
if (NOT HALF_INCLUDE_DIR)
message(FATAL_ERROR "Could not find half.hpp - Please check that the install path of half.hpp has been added to CMAKE_PREFIX_PATH")
else()
message(STATUS "half.hpp is at ${HALF_INCLUDE_DIR}")
endif()
include(CheckTypeSize)
set(CMAKE_REQUIRED_INCLUDES ${HALF_INCLUDE_DIR})
set(CMAKE_EXTRA_INCLUDE_FILES half.hpp)
check_type_size("half_float::detail::expr" HALF_EXPR LANGUAGE CXX)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_EXTRA_INCLUDE_FILES)
include(ROCMSetupVersion)
option(BUILD_DEV "Build for development purpose only" OFF)
rocm_setup_version(VERSION 2.14.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)
option( BUILD_SHARED_LIBS "Build as a shared library" ON )
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("--cuda-host-only -x hip" HAS_HIP)
if(HAS_HIP)
message(STATUS "Enable gpu backend")
set(MIGRAPHX_ENABLE_GPU On CACHE BOOL "")
else()
set(MIGRAPHX_ENABLE_GPU Off CACHE BOOL "")
endif()
# Disable cpu backend by default
set(MIGRAPHX_ENABLE_CPU Off CACHE BOOL "")
# Disable fpga backend by default
set(MIGRAPHX_ENABLE_FPGA Off CACHE BOOL "")
set(MIGRAPHX_HAS_EXECUTORS_DEFAULT Off)
find_package(ParallelSTL QUIET)
if(ParallelSTL_FOUND)
set(MIGRAPHX_HAS_EXECUTORS_DEFAULT On)
endif()
option(MIGRAPHX_HAS_EXECUTORS "C++ supports parallel executors" ${MIGRAPHX_HAS_EXECUTORS_DEFAULT})
if(MIGRAPHX_HAS_EXECUTORS AND ParallelSTL_USES_TBB)
list(APPEND PACKAGE_DEPENDS libtbb2)
endif()
if(WIN32)
add_compile_definitions("$<$:_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES>")
endif()
set(CMAKE_CXX_STANDARD_DEFAULT "")
if(MSVC)
add_compile_options($<$:/std:c++17>)
else()
add_compile_options($<$:-std=c++17>)
endif()
include(EnableCompilerWarnings)
include(ROCMClangTidy)
if(CMAKE_CXX_COMPILER MATCHES ".*clang\\+\\+.*")
set(MIGRAPHX_TIDY_ERRORS ERRORS * -readability-inconsistent-declaration-parameter-name)
# Enable tidy on hip
elseif(MIGRAPHX_ENABLE_GPU)
set(MIGRAPHX_TIDY_ERRORS ALL)
endif()
rocm_enable_clang_tidy(
CHECKS
bugprone-*
cert-*
clang-analyzer-*
clang-diagnostic-*
cppcoreguidelines-*
google-*
hicpp-multiway-paths-covered
hicpp-signed-bitwise
llvm-namespace-comment
misc-*
-misc-confusable-identifiers
-misc-use-anonymous-namespace
modernize-*
performance-*
readability-*
-bugprone-crtp-constructor-accessibility
-bugprone-easily-swappable-parameters
-bugprone-implicit-widening-of-multiplication-result
-bugprone-macro-parentheses
-bugprone-nondeterministic-pointer-iteration-order
-bugprone-return-const-ref-from-parameter
-bugprone-signed-char-misuse
-bugprone-unchecked-optional-access
# Disable the aliased reserved identifiers
-cert-dcl37-c
-cert-dcl51-cpp
-cert-err33-c
-cert-str34-c
# We seed random numbers with constants for reproducibility
-cert-msc32-c
-cert-msc51-cpp
# Disable all alpha checks by default
-clang-analyzer-alpha*
# Enable some alpha checks
clang-analyzer-alpha.core.CallAndMessageUnInitRefArg
clang-analyzer-alpha.core.Conversion
clang-analyzer-alpha.core.IdenticalExpr
clang-analyzer-alpha.core.PointerArithm
clang-analyzer-alpha.core.PointerSub
clang-analyzer-alpha.core.TestAfterDivZero
clang-analyzer-alpha.cplusplus.InvalidIterator
clang-analyzer-alpha.cplusplus.IteratorRange
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
-clang-diagnostic-extern-c-compat
-clang-diagnostic-unused-command-line-argument
-cppcoreguidelines-avoid-const-or-ref-data-members
-cppcoreguidelines-avoid-do-while
-cppcoreguidelines-explicit-virtual-functions
-cppcoreguidelines-init-variables
-cppcoreguidelines-misleading-capture-default-by-value
-cppcoreguidelines-missing-std-forward
-cppcoreguidelines-pro-bounds-array-to-pointer-decay
-cppcoreguidelines-pro-bounds-constant-array-index
-cppcoreguidelines-pro-bounds-pointer-arithmetic
-cppcoreguidelines-pro-type-member-init
-cppcoreguidelines-pro-type-reinterpret-cast
-cppcoreguidelines-pro-type-union-access
-cppcoreguidelines-pro-type-vararg
-cppcoreguidelines-special-member-functions
-cppcoreguidelines-use-default-member-init
-cppcoreguidelines-virtual-class-destructor
-google-readability-*
-google-runtime-int
-google-runtime-references
-misc-include-cleaner
-misc-macro-parentheses
-misc-no-recursion
-modernize-concat-nested-namespaces
-modernize-pass-by-value
-modernize-type-traits
-modernize-use-default-member-init
-modernize-use-nodiscard
-modernize-use-override
-modernize-use-trailing-return-type
-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-math-missing-parentheses
-readability-named-parameter
-readability-redundant-member-init
-readability-redundant-string-init
-readability-suspicious-call-argument
-readability-uppercase-literal-suffix
-*-avoid-c-arrays
-*-explicit-constructor
-*-magic-numbers
-*-narrowing-conversions
-*-non-private-member-variables-in-classes
-*-use-auto
-*-use-emplace
-*-use-equals-default
${MIGRAPHX_TIDY_ERRORS}
HEADER_FILTER
".*hpp"
EXTRA_ARGS
-UNDEBUG
-DMIGRAPHX_USE_CLANG_TIDY
CLANG_ARGS
-analyzer-max-loop 10
-analyzer-inline-max-stack-depth 10
-analyzer-config optin.cplusplus.UninitializedObject:Pedantic=true
-analyzer-config widen-loops=true
-analyzer-config unroll-loops=true
-analyzer-config cfg-lifetime=true
-analyzer-config cfg-scopes=true
)
include(ROCMCppCheck)
rocm_enable_cppcheck(
CHECKS
warning
style
performance
portability
SUPPRESS
ConfigurationNotChecked
unmatchedSuppression
unusedFunction
ctuPointerArith
noExplicitConstructor
passedByValue
unusedStructMember
functionStatic
functionConst
shadowFunction
shadowVar
shadowVariable
unsafeClassDivZero
# Disable because of too many FPs
arithOperationsOnVoidPointer
definePrefix:*test/include/test.hpp
ctuOneDefinitionRuleViolation:*test/*
useSmartPointer:*src/api/api.cpp
useSmartPointer:*make_shared_array.hpp
migraphx-RedundantLocalVariable:*src/api/api.cpp
migraphx-UseSmartPointer:*src/api/api.cpp
FORCE
INCONCLUSIVE
RULE_FILE
${CMAKE_CURRENT_SOURCE_DIR}/tools/cppcheck/rules.xml
ADDONS
${CMAKE_CURRENT_SOURCE_DIR}/tools/cppcheck/migraphx.py
SOURCES
examples/
src/
test/
INCLUDE
${CMAKE_CURRENT_SOURCE_DIR}/src/include
${CMAKE_CURRENT_SOURCE_DIR}/src/targets/cpu/include
${CMAKE_CURRENT_SOURCE_DIR}/src/targets/gpu/include
${CMAKE_CURRENT_SOURCE_DIR}/src/targets/gpu/device/include
${CMAKE_CURRENT_SOURCE_DIR}/src/targets/gpu/kernels/include
${CMAKE_CURRENT_SOURCE_DIR}/test/include
DEFINE
MIGRAPHX_MLIR=1
MIGRAPHX_HAS_EXECUTORS=0
CPPCHECK=1
MIGRAPHX_USE_MIOPEN=1
BUILD_DEV=
__device__=
__host__=
__global__=
UNDEFINE
MIGRAPHX_USE_CLANG_TIDY
DOXYGEN
HAS_HALF_V1
TYPE_ERASED_DECLARATION
NDEBUG
)
include(ROCMCreatePackage)
include(ROCMTest)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
add_subdirectory(src)
add_subdirectory(docs)
if(BUILD_TESTING)
rocm_enable_test_package(migraphx)
add_subdirectory(test)
endif()
add_subdirectory(tools)
set(DEST_DIR ${CMAKE_BINARY_DIR})
file(GLOB backend_files ${CMAKE_SOURCE_DIR}/src/py/backend/*.py)
file(MAKE_DIRECTORY ${DEST_DIR}/lib/onnx_migraphx)
foreach(py_file ${backend_files})
configure_file(${py_file} ${DEST_DIR}/lib/onnx_migraphx/. COPYONLY)
endforeach(py_file)
if(BUILD_ADDRESS_SANITIZER)
set(DEPENDS_HIP_RUNTIME "hip-runtime-amd-asan" )
else()
set(DEPENDS_HIP_RUNTIME "hip-runtime-amd" )
endif()
if(MIGRAPHX_USE_MIOPEN)
list(APPEND PACKAGE_DEPENDS miopen-hip)
endif()
if(MIGRAPHX_USE_ROCBLAS)
list(APPEND PACKAGE_DEPENDS rocblas)
endif()
if(MIGRAPHX_USE_HIPBLASLT)
list(APPEND PACKAGE_DEPENDS hipblaslt)
endif()
rocm_package_add_deb_dependencies(SHARED_DEPENDS "hip-dev")
rocm_package_add_rpm_dependencies(SHARED_DEPENDS "hip-devel")
rocm_create_package(
NAME MIGraphX
DESCRIPTION "AMD graph optimizer"
MAINTAINER "AMDMIGraphX Maintainer "
LDCONFIG
PTH
DEPENDS ${DEPENDS_HIP_RUNTIME} half ${PACKAGE_DEPENDS}
)
ROCm-AMDMIGraphX-46524e8/Dockerfile 0000664 0000000 0000000 00000011617 15104657024 0016540 0 ustar 00root root 0000000 0000000 FROM ubuntu:22.04
ARG PREFIX=/usr/local
# Support multiarch
RUN dpkg --add-architecture i386
# Install rocm key
RUN apt-get update && apt-get install -y software-properties-common 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/7.1/ 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"
# rocgdb doesn't work on 22.04, workaround by installing the older python packages that are in 20.04
RUN add-apt-repository -y ppa:deadsnakes/ppa
# Install dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
apt-utils \
bison \
build-essential \
clang-14 \
cmake \
curl \
flex \
g++ \
gdb \
git \
lcov \
locales \
pkg-config \
python3 \
python3-dev \
python3-pip \
python3-full \
libpython3.8 \
wget \
rocm-device-libs \
hip-dev \
libnuma-dev \
miopen-hip \
libomp-dev \
rocblas \
hipfft \
hipsolver \
rccl \
rocthrust \
rocrand \
hipsparse \
rocm-smi-lib \
rocm-dev \
roctracer-dev \
hipcub \
hipblas \
hipify-clang \
hiprand-dev \
half \
libssl-dev \
zlib1g-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install pytorch
RUN pip3 install https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1/torch-2.6.0%2Brocm7.1.0.lw.git78f6ff78-cp310-cp310-linux_x86_64.whl\
https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1/torchvision-0.21.0%2Brocm7.1.0.git4040d51f-cp310-cp310-linux_x86_64.whl\
https://repo.radeon.com/rocm/manylinux/rocm-rel-7.1/triton-3.2.0%2Brocm7.1.0.git20943800-cp310-cp310-linux_x86_64.whl
# add this for roctracer dependencies
RUN pip3 install CppHeaderParser
# Workaround broken rocm packages
RUN ln -s /opt/rocm-* /opt/rocm
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 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 distributions running cmake < 3.25
RUN sed -i -e 's/^block/if(COMMAND block)\nblock/g' -e 's/^endblock/endblock\(\)\nendif/g' /opt/rocm/lib/cmake/hipblaslt/hipblaslt-config.cmake
RUN locale-gen en_US.UTF-8
RUN update-locale LANG=en_US.UTF-8
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
# Install dependencies
ADD dev-requirements.txt /dev-requirements.txt
ADD requirements.txt /requirements.txt
ADD rbuild.ini /rbuild.ini
# Location where onnx unit tests models are cached
ENV ONNX_HOME=/.onnx
RUN mkdir -p $ONNX_HOME/models && chmod 777 $ONNX_HOME/models
COPY ./tools/install_prereqs.sh /
COPY ./tools/requirements-py.txt /requirements-py.txt
RUN /install_prereqs.sh /usr/local / && rm /install_prereqs.sh && rm /requirements-py.txt
RUN test -f /usr/local/hash || exit 1
# Install yapf
RUN pip3 install yapf==0.28.0
# Install doc requirements
ADD docs/sphinx/requirements.txt /doc-requirements.txt
RUN pip3 install -r /doc-requirements.txt
# Install latest ccache version
RUN cget -p $PREFIX install facebook/zstd@v1.4.5 -X subdir -DCMAKE_DIR=build/cmake
RUN cget -p $PREFIX install ccache@v4.1 -DENABLE_TESTING=OFF
RUN cget -p /opt/cmake install kitware/cmake@v3.28.0
# Install a newer version of doxygen because the one that comes with ubuntu is broken
RUN cget -p $PREFIX install doxygen@Release_1_14_0
COPY ./test/onnx/.onnxrt-commit /
ARG ONNXRUNTIME_REPO=https://github.com/Microsoft/onnxruntime
ARG ONNXRUNTIME_BRANCH=main
ARG ONNXRUNTIME_COMMIT
RUN git clone --single-branch --branch ${ONNXRUNTIME_BRANCH} --recursive ${ONNXRUNTIME_REPO} onnxruntime && \
cd onnxruntime && \
if [ -z "$ONNXRUNTIME_COMMIT" ] ; then git checkout $(cat /.onnxrt-commit) ; else git checkout ${ONNXRUNTIME_COMMIT} ; fi && \
/bin/sh /onnxruntime/dockerfiles/scripts/install_common_deps.sh
ADD tools/build_and_test_onnxrt.sh /onnxruntime/build_and_test_onnxrt.sh
ADD tools/pai_test_launcher.sh /onnxruntime/tools/ci_build/github/pai/pai_test_launcher.sh
ADD tools/pai_provider_test_launcher.sh /onnxruntime/tools/ci_build/github/pai/pai_provider_test_launcher.sh
ENV MIOPEN_FIND_DB_PATH=/tmp/miopen/find-db
ENV MIOPEN_USER_DB_PATH=/tmp/miopen/user-db
ENV LD_LIBRARY_PATH=$PREFIX/lib
# Setup ubsan environment to printstacktrace
ENV UBSAN_OPTIONS=print_stacktrace=1
# Disable odr detection since its broken with shared libraries
# See: https://github.com/google/sanitizers/issues/1017
ENV ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
RUN ln -s /opt/rocm/llvm/bin/llvm-symbolizer /usr/bin/llvm-symbolizer
ROCm-AMDMIGraphX-46524e8/Jenkinsfile 0000664 0000000 0000000 00000027316 15104657024 0016735 0 ustar 00root root 0000000 0000000 import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
DOCKER_IMAGE = 'rocm/migraphx-ci-jenkins-ubuntu'
def getgputargets() {
targets="gfx906;gfx908;gfx90a;gfx1030;gfx1100;gfx1101"
return targets
}
def getnavi3xtargets() {
targets="gfx1100;gfx1101"
return targets
}
// Test
// def rocmtestnode(variant, name, body, args, pre) {
def rocmtestnode(Map conf) {
def variant = conf.get("variant")
def name = conf.get("node")
def body = conf.get("body")
def docker_args = conf.get("docker_args", "")
def docker_build_args = conf.get("docker_build_args", "")
def pre = conf.get("pre", {})
def ccache = "/workspaces/.cache/ccache"
def image = 'migraphxlib'
env.CCACHE_COMPRESSLEVEL = 7
env.CCACHE_DIR = ccache
def cmake_build = { bconf ->
def compiler = bconf.get("compiler", "/opt/rocm/llvm/bin/clang++")
def flags = bconf.get("flags", "")
def gpu_debug = bconf.get("gpu_debug", "0")
def cmd = """
ulimit -c unlimited
echo "leak:dnnl::impl::malloc" > suppressions.txt
echo "leak:libtbb.so" >> suppressions.txt
cat suppressions.txt
export LSAN_OPTIONS="suppressions=\$(pwd)/suppressions.txt"
export ASAN_OPTIONS="detect_container_overflow=0"
export MIGRAPHX_GPU_DEBUG=${gpu_debug}
export CXX=${compiler}
export CXXFLAGS='-Werror'
rocminfo
env
rm -rf build
mkdir build
cd build
cmake -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_DEV=On -DCMAKE_EXECUTE_PROCESS_COMMAND_ECHO=STDOUT -DMIGRAPHX_DISABLE_VIRTUAL_ENV=ON ${flags} ..
git diff
git diff-index --quiet HEAD || (echo "Git repo is not clean after running cmake." && exit 1)
make -j\$(nproc) generate VERBOSE=1
git diff
git diff-index --quiet HEAD || (echo "Generated files are different. Please run make generate and commit the changes." && exit 1)
make -j\$(nproc) all package check VERBOSE=1
md5sum ./*.deb
"""
echo cmd
sh cmd
// Only archive from master or develop
if (env.BRANCH_NAME == "develop" || env.BRANCH_NAME == "master") {
archiveArtifacts artifacts: "build/*.deb", allowEmptyArchive: true, fingerprint: true
}
}
node(name) {
withEnv(['HSA_ENABLE_SDMA=0']) {
stage("checkout ${variant}") {
sh 'printenv'
checkout scm
}
def video_id = sh(returnStdout: true, script: 'getent group video | cut -d: -f3').trim()
def render_id = sh(returnStdout: true, script: 'getent group render | cut -d: -f3').trim()
def docker_opts = "--device=/dev/kfd --device=/dev/dri --cap-add SYS_PTRACE -v=${env.WORKSPACE}/../:/workspaces:rw,z"
docker_opts = docker_opts + " --group-add=${video_id} --group-add=${render_id} "
echo "Docker flags: ${docker_opts}"
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: docker_opts + docker_args) {
timeout(time: 4, unit: 'HOURS') {
body(cmake_build)
}
}
}
}
}
}
}
def rocmtest(m) {
def builders = [:]
m.each { e ->
def label = e.key;
def action = e.value;
builders[label] = {
action(label)
}
}
parallel builders
}
def rocmnodename(name) {
def rocmtest_name = "(rocmtest || migraphx)"
def node_name = "${rocmtest_name}"
if(name == "fiji") {
node_name = "${rocmtest_name} && fiji";
} else if(name == "vega") {
node_name = "${rocmtest_name} && vega";
} else if(name == "navi21") {
node_name = "${rocmtest_name} && navi21";
} else if(name == "mi100+") {
node_name = "${rocmtest_name} && (gfx908 || gfx90a) && !vm";
} else if(name == "mi200+") {
node_name = "${rocmtest_name} && (gfx90a || gfx942) && !vm";
} else if(name == "cdna") {
node_name = "${rocmtest_name} && (gfx908 || gfx90a || vega20) && !vm";
} else if(name == "navi32") {
node_name = "${rocmtest_name} && gfx1101 && !vm";
} else if(name == "nogpu") {
node_name = "${rocmtest_name} && nogpu";
} else if(name == "onnxrt") {
node_name = "${rocmtest_name} && onnxrt";
}
return node_name
}
def rocmnode(name, body) {
return { label ->
rocmtestnode(variant: label, node: rocmnodename(name), body: 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 **/test/onnx/.onnxrt-commit | 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('mi200+') { cmake_build ->
stage('hipRTC Debug') {
// Disable MLIR since it doesnt work with all ub sanitizers
withEnv(['MIGRAPHX_DISABLE_MLIR=1']) {
def sanitizers = "undefined"
def debug_flags = "-g -O2 -fsanitize=${sanitizers} -fno-sanitize=vptr,function -fno-sanitize-recover=${sanitizers}"
def gpu_targets = getgputargets()
cmake_build(flags: "-DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang -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='${gpu_targets}'", gpu_debug: true)
}
}
}, clang_release: rocmnode('mi100+') { cmake_build ->
stage('Hip Clang Release') {
def gpu_targets = getgputargets()
cmake_build(flags: "-DCMAKE_BUILD_TYPE=release -DGPU_TARGETS='${gpu_targets}'")
stash includes: 'build/*.deb', name: 'migraphx-package'
}
// }, hidden_symbols: rocmnode('cdna') { cmake_build ->
// stage('Hidden symbols') {
// cmake_build(flags: "-DMIGRAPHX_ENABLE_PYTHON=Off -DMIGRAPHX_ENABLE_GPU=On -DMIGRAPHX_ENABLE_CPU=On -DCMAKE_CXX_VISIBILITY_PRESET=hidden -DCMAKE_C_VISIBILITY_PRESET=hidden")
// }
}, all_targets_debug : rocmnode('mi100+') { cmake_build ->
stage('All targets Release') {
def gpu_targets = getgputargets()
cmake_build(flags: "-DCMAKE_BUILD_TYPE=release -DMIGRAPHX_ENABLE_GPU=On -DMIGRAPHX_ENABLE_CPU=On -DMIGRAPHX_ENABLE_FPGA=On -DGPU_TARGETS='${gpu_targets}'")
}
}, mlir_debug: rocmnode('mi100+') { cmake_build ->
stage('MLIR Debug') {
withEnv(['MIGRAPHX_ENABLE_EXTRA_MLIR=1', 'MIGRAPHX_MLIR_USE_SPECIFIC_OPS=fused,attention,convolution,dot,convolution_backwards', 'MIGRAPHX_ENABLE_MLIR_INPUT_FUSION=1', 'MIGRAPHX_MLIR_ENABLE_SPLITK=1', 'MIGRAPHX_ENABLE_MLIR_REDUCE_FUSION=1', 'MIGRAPHX_ENABLE_MLIR_GEG_FUSION=1', 'MIGRAPHX_ENABLE_SPLIT_REDUCE=1','MIGRAPHX_DISABLE_LAYERNORM_FUSION=1']) {
def sanitizers = "undefined"
// Note: the -fno-sanitize= is copied from upstream LLVM_UBSAN_FLAGS.
def debug_flags = "-g -O2 -fsanitize=${sanitizers} -fno-sanitize=vptr,function -fno-sanitize-recover=${sanitizers}"
def gpu_targets = getgputargets()
// Since the purpose of this run verify all things MLIR supports,
// enabling all possible types of offloads
cmake_build(flags: "-DCMAKE_C_COMPILER=/opt/rocm/llvm/bin/clang -DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_PYTHON=Off -DMIGRAPHX_ENABLE_MLIR=On -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags}' -DCMAKE_C_FLAGS_DEBUG='${debug_flags}' -DGPU_TARGETS='${gpu_targets}'")
}
}
//}, ck_hiprtc: rocmnode('mi100+') { cmake_build ->
// stage('CK hipRTC') {
// withEnv(['MIGRAPHX_ENABLE_CK=1', 'MIGRAPHX_TUNE_CK=1', 'MIGRAPHX_DISABLE_MLIR=1']) {
// def gpu_targets = getgputargets()
// cmake_build(flags: "-DCMAKE_BUILD_TYPE=release -DMIGRAPHX_USE_HIPRTC=On -DGPU_TARGETS='${gpu_targets}'")
// }
// }
}, clang_release_navi: rocmnode('navi32') { cmake_build ->
stage('HIP Clang Release Navi32') {
def gpu_targets = getnavi3xtargets()
cmake_build(flags: "-DCMAKE_BUILD_TYPE=release -DGPU_TARGETS='${gpu_targets}' -DMIGRAPHX_DISABLE_ONNX_TESTS=On")
}
}, clang_asan: rocmnode('nogpu') { cmake_build ->
stage('Clang ASAN') {
def sanitizers = "undefined,address"
def debug_flags = "-g -O2 -fno-omit-frame-pointer -fsanitize=${sanitizers} -fno-sanitize-recover=${sanitizers}"
cmake_build(flags: "-DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_C_API_TEST=Off -DMIGRAPHX_ENABLE_PYTHON=Off -DMIGRAPHX_ENABLE_GPU=Off -DMIGRAPHX_ENABLE_CPU=On -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags}'", compiler:'/usr/bin/clang++-14')
}
}, debub_libstdcxx: rocmnode('nogpu') { cmake_build ->
stage('Debug libstdc++') {
def sanitizers = "undefined"
def debug_flags = "-g -O2 -fno-omit-frame-pointer -fsanitize=${sanitizers} -fno-sanitize-recover=${sanitizers} -D_GLIBCXX_DEBUG"
cmake_build(flags: "-DCMAKE_BUILD_TYPE=debug -DMIGRAPHX_ENABLE_C_API_TEST=Off -DMIGRAPHX_ENABLE_PYTHON=Off -DMIGRAPHX_ENABLE_GPU=Off -DMIGRAPHX_ENABLE_CPU=Off -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags}'", compiler:'/usr/bin/clang++-14')
}
}
def onnxnode(name, body) {
return { label ->
rocmtestnode(variant: label, node: rocmnodename(name), docker_args: '-u root', body: body, pre: {
sh 'rm -rf ./build/*.deb'
unstash 'migraphx-package'
})
}
}
rocmtest onnx: onnxnode('onnxrt') { 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
'''
}
}
ROCm-AMDMIGraphX-46524e8/LICENSE 0000664 0000000 0000000 00000002135 15104657024 0015546 0 ustar 00root root 0000000 0000000 The MIT License (MIT)
Copyright (c) 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
ROCm-AMDMIGraphX-46524e8/README.md 0000664 0000000 0000000 00000017041 15104657024 0016022 0 ustar 00root root 0000000 0000000 # AMD MIGraphX
AMD MIGraphX is AMD's graph inference engine, which accelerates machine learning model inference.
>[!NOTE]
>The published documentation is available at [MIGraphX](https://rocm.docs.amd.com/projects/AMDMIGraphX/en/latest/) in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the `docs` folder of this repository. As with all ROCm projects, the documentation is open source. For more information on contributing to the documentation, see [Contribute to ROCm documentation](https://rocm.docs.amd.com/en/latest/contribute/contributing.html).
> [!NOTE]
> You must [install ROCm](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/index.html) before
> installing MIGraphX.
## Installing from binaries
Install binaries using:
```bash
sudo apt update && sudo apt install -y migraphx
```
Header files and libraries are installed under ``/opt/rocm-``, where ```` is the ROCm
version.
## Building from source
You have three options for building from source:
* [ROCm build tool](#use-the-rocm-build-tool-rbuild): Uses
[rbuild](https://github.com/RadeonOpenCompute/rbuild) to install prerequisites, then you can build
the libraries with a single command.
* [CMake](#use-cmake-to-build-migraphx): Uses a script to install prerequisites, then you can use
CMake to build the source.
* [Docker](#use-docker): Builds a Docker image with all prerequisites installed, then you can build the
MIGraphX sources inside a Docker container.
### Build prerequisites
The following is a list of prerequisites for building MIGraphX.
* [ROCm CMake modules](https://github.com/RadeonOpenCompute/rocm-cmake) **required**
* [MIOpen](https://github.com/ROCmSoftwarePlatform/MIOpen) for running on the GPU
* [rocBLAS](https://github.com/ROCmSoftwarePlatform/rocBLAS) for running on the GPU
* [HIP](https://github.com/ROCm-Developer-Tools/HIP) for running on the GPU
* [Protobuf](https://github.com/google/protobuf) for reading [onnx](https://github.com/onnx/onnx)
files
* [Half](http://half.sourceforge.net/), an IEEE 754-based half-precision floating point library
* [pybind11](https://pybind11.readthedocs.io/en/stable/) for python bindings
* [JSON](https://github.com/nlohmann/json) for model serialization to json string format
* [MessagePack](https://msgpack.org/index.html) for model serialization to binary format
* [SQLite3](https://www.sqlite.org/index.html) to create database of kernels' tuning information or run queries on existing database
### Use the ROCm build tool [rbuild](https://github.com/RadeonOpenCompute/rbuild).
1. Install `rocm-cmake`, `pip3`, `rocblas`, and `miopen-hip`:
```bash
sudo apt install -y rocm-cmake python3-pip rocblas miopen-hip
```
2. Install [rbuild](https://github.com/RadeonOpenCompute/rbuild) (sudo may be required):
```bash
pip3 install https://github.com/RadeonOpenCompute/rbuild/archive/master.tar.gz
```
3. Build MIGraphX source code:
```bash
rbuild build -d depend -B build -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
```
Once completed, all prerequisites are in the `depend` folder and MIGraphX is in the `build` directory.
> [!NOTE]
> If you get an `rbuild: command not found` error, it's because `rbuild` is installed in `$HOME/.local/bin`,
> which is not in `PATH`. You can either export PATH as `export PATH=$HOME/.local/bin:$PATH` to add
> the folder to `PATH`, or add the option `--prefix /usr/local` in the pip3 command when installing `rbuild`.
### Use CMake to build MIGraphX
1. Install the prerequisites:
```bash
rbuild prepare -d depend
```
This puts all the prerequisites are in `depend` the folder. They can be used in the `cmake`
configuration as `-DCMAKE_PREFIX_PATH=depend`.
If you have sudo access, as an alternative to the `rbuild` command, you can install the prerequisites
in the same way as a Dockerfile, by calling `./tools/install_prereqs.sh`.
By default, all prerequisites are installed at the default location (`/usr/local`) and are accessible by all
users. For the default location, `sudo` is required to run the script. You can also specify a different
location using `./tools/install_prereqs.sh $custom_location`.
2. Go to the project folder and create a `build` directory:
```bash
mkdir build
cd build
```
3. Configure CMake. If the prerequisites are installed at the default location `/usr/local`, use:
```bash
CXX=/opt/rocm/llvm/bin/clang++ cmake .. -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
```
Otherwise, you need to set `-DCMAKE_PREFIX_PATH=$your_loc` to configure CMake.
4. Build MIGraphX source code:
```cpp
make -j$(nproc)
```
You can verify this using:
```cpp
make -j$(nproc) check
```
5. Install MIGraphX libraries:
```cpp
make install
```
### Use Docker
The easiest way to set up the development environment is to use Docker.
1. With the Dockerfile, build a Docker image:
```bash
docker build -t migraphx .
```
2. Enter the development environment using `docker run`:
```bash
docker run --device='/dev/kfd' --device='/dev/dri' -v=`pwd`:/code/AMDMIGraphX -w /code/AMDMIGraphX --group-add video -it migraphx
```
3. In the Docker container, all required prerequisites are already installed, so you can go to the folder
`/code/AMDMIGraphX` and follow the steps (starting from 2) in the
[Use CMake to build MIGraphX](#use-cmake-to-build-migraphx).
## Using the MIGraphX Python module
To use MIGraphX's Python module, you can set `PYTHONPATH` or use the `.deb` package:
* Setting `PYTHONPATH`:
```bash
export PYTHONPATH=/opt/rocm/lib:$PYTHONPATH
```
* Creating the `deb` package:
```bash
make package
```
This provides the path for .deb package.
To install:
```bash
dpkg -i
```
## Calling MIGraphX APIs
To use MIGraphX's C/C++ API in your CMake project, you must set `CMAKE_PREFIX_PATH` to the
MIGraphX installation location and run:
```cmake
find_package(migraphx)
target_link_libraries(myApp migraphx::c)
```
Where `myApp` is the CMake target in your project.
## Building for development
Using `rbuild`, you can install the dependencies for development with:
```bash
rbuild develop -DGPU_TARGETS=$(/opt/rocm/bin/rocminfo | grep -o -m1 'gfx.*')
```
This installs development dependencies in the `deps` directory and configures `cmake` to use those
dependencies in the `build` directory. You can change these directories by passing the `--deps-dir` and
`--build-dir` flags to the `rbuild` command:
```bash
rbuild develop --build-dir build_rocm_55 --deps-dir /home/user/deps_dir
```
## Building the documentation
HTML and PDF documentation can be built using:
`cmake --build . --config Release --target doc` **OR** `make doc`
This will build a local searchable web site inside the docs/html folder.
Documentation is built using [Doxygen](http://www.stack.nl/~dimitri/doxygen/download.html) and [rocm-docs-core](https://github.com/RadeonOpenCompute/rocm-docs-core)
Run the steps below to build documentation locally.
```bash
cd docs
pip3 install -r sphinx/requirements.txt
python3 -m sphinx -T -E -b html -d _build/doctrees -D language=en . _build/html
```
Depending on your setup `sudo` may be required for the pip install.
## Formatting the code
All the code is formatted using clang-format. To format a file, use:
```clang
clang-format-10 -style=file -i
```
Also, githooks can be installed to format the code per-commit:
```bash
./.githooks/install
```
ROCm-AMDMIGraphX-46524e8/cmake/ 0000775 0000000 0000000 00000000000 15104657024 0015620 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/cmake/CheckCXXLinkerFlag.cmake 0000664 0000000 0000000 00000006350 15104657024 0022165 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
set(check_cxx_linker_flag_patterns
FAIL_REGEX "[Uu]nrecogni[sz]ed .*option" # GNU, NAG
FAIL_REGEX "switch .* is no longer supported" # GNU
FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "optimization flag .* not supported" # Clang
FAIL_REGEX "unknown argument ignored" # Clang (cl)
FAIL_REGEX "ignoring unknown option" # MSVC, Intel
FAIL_REGEX "warning D9002" # MSVC, any lang
FAIL_REGEX "option.*not supported" # Intel
FAIL_REGEX "invalid argument .*option" # Intel
FAIL_REGEX "ignoring option .*argument required" # Intel
FAIL_REGEX "ignoring option .*argument is of wrong type" # Intel
FAIL_REGEX "[Uu]nknown option" # HP
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL
FAIL_REGEX "command option .* contains an incorrect subargument" # XL
FAIL_REGEX "Option .* is not recognized. Option will be ignored." # XL
FAIL_REGEX "not supported in this configuration. ignored" # AIX
FAIL_REGEX "File with unknown suffix passed to linker" # PGI
FAIL_REGEX "[Uu]nknown switch" # PGI
FAIL_REGEX "WARNING: unknown flag:" # Open64
FAIL_REGEX "Incorrect command line option:" # Borland
FAIL_REGEX "Warning: illegal option" # SunStudio 12
FAIL_REGEX "[Ww]arning: Invalid suboption" # Fujitsu
FAIL_REGEX "An invalid option .* appears on the command line" # Cray
)
function(check_cxx_linker_flag _flag _var)
set (_source "int main() { return 0; }")
include (CheckCXXSourceCompiles)
check_cxx_source_compiles("${_source}" _result ${check_cxx_linker_flag_patterns})
set(${_var} "${_result}" PARENT_SCOPE)
endfunction()
ROCm-AMDMIGraphX-46524e8/cmake/Embed.cmake 0000664 0000000 0000000 00000024655 15104657024 0017652 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
include_guard(GLOBAL)
if(WIN32)
set(EMBED_USE RC CACHE STRING "Use RC or CArrays to embed data files")
set_property(CACHE EMBED_USE PROPERTY STRINGS "RC;CArrays")
else()
if(BUILD_SHARED_LIBS)
set(EMBED_USE LD CACHE STRING "Use LD or CArrays to embed data files")
else()
set(EMBED_USE CArrays CACHE STRING "Use LD or CArrays to embed data files")
endif()
set_property(CACHE EMBED_USE PROPERTY STRINGS "LD;CArrays")
endif()
if(EMBED_USE STREQUAL "LD")
find_program(EMBED_LD ld REQUIRED)
find_program(EMBED_OBJCOPY objcopy REQUIRED)
endif()
function(embed_wrap_string)
set(options)
set(oneValueArgs VARIABLE AT_COLUMN)
set(multiValueArgs)
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
string(LENGTH ${${PARSE_VARIABLE}} string_length)
math(EXPR offset "0")
while(string_length GREATER 0)
if(string_length GREATER ${PARSE_AT_COLUMN})
math(EXPR length "${PARSE_AT_COLUMN}")
else()
math(EXPR length "${string_length}")
endif()
string(SUBSTRING ${${PARSE_VARIABLE}} ${offset} ${length} line)
set(lines "${lines}\n${line}")
math(EXPR string_length "${string_length} - ${length}")
math(EXPR offset "${offset} + ${length}")
endwhile()
set(${PARSE_VARIABLE} "${lines}" PARENT_SCOPE)
endfunction()
set(RESOURCE_ID 100 CACHE INTERNAL "" FORCE)
function(reset_resource_id MULTIPLE)
if(RESOURCE_ID GREATER 0)
math(EXPR _remainder "${RESOURCE_ID} % ${MULTIPLE}")
if(_remainder GREATER 0)
math(EXPR RESOURCE_ID "${RESOURCE_ID} + ${MULTIPLE} - ${_remainder}")
endif()
endif()
set(RESOURCE_ID ${RESOURCE_ID} CACHE INTERNAL "" FORCE)
endfunction()
function(generate_embed_source EMBED_NAME EMBED_DIR BASE_DIRECTORY)
set(options)
set(oneValueArgs)
set(multiValueArgs SYMBOLS FILES)
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
list(LENGTH PARSE_SYMBOLS SYMBOLS_LEN)
list(LENGTH PARSE_FILES FILES_LEN)
if(NOT ${SYMBOLS_LEN} EQUAL ${FILES_LEN})
message(FATAL_ERROR "Symbols and objects dont match: ${SYMBOLS_LEN} != ${FILES_LEN}")
endif()
math(EXPR LEN "${SYMBOLS_LEN} - 1")
foreach(idx RANGE ${LEN})
list(GET PARSE_SYMBOLS ${idx} SYMBOL)
list(GET PARSE_FILES ${idx} FILE)
file(RELATIVE_PATH BASE_NAME "${BASE_DIRECTORY}" ${FILE})
if(EMBED_USE STREQUAL "RC")
string(TOUPPER "${SYMBOL}" SYMBOL)
string(APPEND FILE_IDS "#define IDR_${SYMBOL} ${RESOURCE_ID}\n")
file(TO_NATIVE_PATH "${FILE}" NATIVE_FILE)
string(REPLACE "\\" "\\\\" NATIVE_FILE "${NATIVE_FILE}")
string(APPEND RC_FILE_MAPPING "IDR_${SYMBOL} TEXTFILE \"${NATIVE_FILE}\"\n")
string(APPEND INIT_KERNELS "\n {\"${BASE_NAME}\", resource::read(IDR_${SYMBOL})},")
math(EXPR RESOURCE_ID "${RESOURCE_ID} + 1" OUTPUT_FORMAT DECIMAL)
else()
set(START_SYMBOL "_binary_${SYMBOL}_start")
set(LENGTH_SYMBOL "_binary_${SYMBOL}_length")
if(EMBED_USE STREQUAL "LD")
string(APPEND EXTERNS "
extern const char ${START_SYMBOL}[];
extern const size_t _binary_${SYMBOL}_size;
const auto ${LENGTH_SYMBOL} = reinterpret_cast(&_binary_${SYMBOL}_size);
")
else()
string(APPEND EXTERNS "
extern const char ${START_SYMBOL}[];
extern const size_t ${LENGTH_SYMBOL};
")
endif()
string(APPEND INIT_KERNELS "
{ \"${BASE_NAME}\", { ${START_SYMBOL}, ${LENGTH_SYMBOL}} },")
endif()
endforeach()
if(EMBED_USE STREQUAL "RC")
file(WRITE "${EMBED_DIR}/include/resource.h" "
#define TEXTFILE 256
${FILE_IDS}
")
file(WRITE "${EMBED_DIR}/resource.rc" "
#include \"resource.h\"
${RC_FILE_MAPPING}
")
set(EXTERNS "
#include
#include \"resource.h\"
namespace resource {
static std::string_view read(int id)
{
HMODULE handle;
if(GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
reinterpret_cast(${EMBED_NAME}),
&handle) != 0)
{
HRSRC rc = FindResource(handle, MAKEINTRESOURCE(id), MAKEINTRESOURCE(TEXTFILE));
if(rc != nullptr)
{
HGLOBAL data = LoadResource(handle, rc);
if(data != nullptr)
{
return {static_cast(LockResource(data)), SizeofResource(handle, rc)};
}
}
}
return std::string_view{};
}
}
")
set(EMBED_FILES ${EMBED_DIR}/include/resource.h ${EMBED_DIR}/resource.rc)
endif()
file(WRITE "${EMBED_DIR}/include/${EMBED_NAME}.hpp" "
#include
#include
#include
std::unordered_map ${EMBED_NAME}();
")
file(WRITE "${EMBED_DIR}/${EMBED_NAME}.cpp" "
#include <${EMBED_NAME}.hpp>
${EXTERNS}
std::unordered_map ${EMBED_NAME}()
{
static std::unordered_map result = {${INIT_KERNELS}
};
return result;
}
")
reset_resource_id(1000)
list(APPEND EMBED_FILES ${EMBED_DIR}/${EMBED_NAME}.cpp ${EMBED_DIR}/include/${EMBED_NAME}.hpp)
set(EMBED_FILES ${EMBED_FILES} PARENT_SCOPE)
endfunction()
function(embed_file FILE BASE_DIRECTORY)
message(STATUS " ${FILE}")
file(RELATIVE_PATH REL_FILE "${BASE_DIRECTORY}" ${FILE})
string(MAKE_C_IDENTIFIER "${REL_FILE}" OUTPUT_SYMBOL)
get_filename_component(OUTPUT_FILE_DIR "${REL_FILE}" DIRECTORY)
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_FILE_DIR}")
if(EMBED_USE STREQUAL "LD")
set(OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${REL_FILE}.o")
add_custom_command(
OUTPUT "${OUTPUT_FILE}"
COMMAND ${EMBED_LD} -r -o "${OUTPUT_FILE}" -z noexecstack --format=binary "${REL_FILE}"
COMMAND ${EMBED_OBJCOPY} --rename-section .data=.rodata,alloc,load,readonly,data,contents "${OUTPUT_FILE}"
WORKING_DIRECTORY "${BASE_DIRECTORY}"
DEPENDS "${FILE}"
VERBATIM)
set(OUTPUT_FILE ${OUTPUT_FILE} PARENT_SCOPE)
elseif(EMBED_USE STREQUAL "CArrays")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${FILE})
set(OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${REL_FILE}.cpp")
# reads source file contents as hex string
file(READ ${FILE} HEX_STRING HEX)
# wraps the hex string into multiple lines
embed_wrap_string(VARIABLE HEX_STRING AT_COLUMN 80)
# adds '0x' prefix and comma suffix before and after every byte respectively
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1, " ARRAY_VALUES ${HEX_STRING})
# removes trailing comma
string(REGEX REPLACE ", $" "" ARRAY_VALUES ${ARRAY_VALUES})
file(WRITE "${OUTPUT_FILE}" "
#include
extern const char _binary_${OUTPUT_SYMBOL}_start[] = { ${ARRAY_VALUES} };
extern const size_t _binary_${OUTPUT_SYMBOL}_length = sizeof(_binary_${OUTPUT_SYMBOL}_start);
")
set(OUTPUT_FILE ${OUTPUT_FILE} PARENT_SCOPE)
endif()
set(OUTPUT_SYMBOL ${OUTPUT_SYMBOL} PARENT_SCOPE)
endfunction()
function(add_embed_library EMBED_NAME)
set(options)
set(oneValueArgs RELATIVE)
set(multiValueArgs)
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(EMBED_DIR ${CMAKE_CURRENT_BINARY_DIR}/embed/${EMBED_NAME})
file(MAKE_DIRECTORY ${EMBED_DIR})
message(STATUS "Embedding kernel files:")
foreach(FILE ${PARSE_UNPARSED_ARGUMENTS})
embed_file(${FILE} ${PARSE_RELATIVE})
list(APPEND OUTPUT_FILES ${OUTPUT_FILE})
list(APPEND SYMBOLS ${OUTPUT_SYMBOL})
endforeach()
message(STATUS "Generating embedding library '${EMBED_NAME}'")
generate_embed_source(${EMBED_NAME} ${EMBED_DIR} "${PARSE_RELATIVE}" SYMBOLS ${SYMBOLS} FILES ${PARSE_UNPARSED_ARGUMENTS})
set(INTERNAL_EMBED_LIB embed_lib_${EMBED_NAME})
if(EMBED_USE STREQUAL "LD")
add_library(${INTERNAL_EMBED_LIB} STATIC ${EMBED_FILES} ${OUTPUT_FILES})
else()
add_library(${INTERNAL_EMBED_LIB} OBJECT ${EMBED_FILES})
endif()
if(EMBED_USE STREQUAL "CArrays")
target_sources(${INTERNAL_EMBED_LIB} PRIVATE ${OUTPUT_FILES})
endif()
target_include_directories(${INTERNAL_EMBED_LIB} PRIVATE "${EMBED_DIR}/include")
target_compile_options(${INTERNAL_EMBED_LIB} PRIVATE -Wno-reserved-identifier -Wno-extern-initializer -Wno-missing-variable-declarations)
set_target_properties(${INTERNAL_EMBED_LIB} PROPERTIES POSITION_INDEPENDENT_CODE On)
add_library(${EMBED_NAME} INTERFACE)
if(EMBED_USE STREQUAL "RC")
target_link_libraries(${EMBED_NAME} INTERFACE $)
elseif(EMBED_USE STREQUAL "LD")
target_link_libraries(${EMBED_NAME} INTERFACE ${INTERNAL_EMBED_LIB})
else()
target_sources(${EMBED_NAME} INTERFACE $)
endif()
target_include_directories(${EMBED_NAME} INTERFACE "${EMBED_DIR}/include")
endfunction()
ROCm-AMDMIGraphX-46524e8/cmake/EnableCompilerWarnings.cmake 0000664 0000000 0000000 00000012406 15104657024 0023217 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
# - Enable warning all for gcc/clang or use /W4 for visual studio
include(CheckCXXCompilerFlag)
## Strict warning level
if (MSVC)
# Use the highest warning level for visual studio.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
# set(CMAKE_CXX_WARNING_LEVEL 4)
# if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
# string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# else ()
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
# endif ()
# set(CMAKE_C_WARNING_LEVEL 4)
# if (CMAKE_C_FLAGS MATCHES "/W[0-4]")
# string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
# else ()
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
# endif ()
else()
foreach(COMPILER C CXX)
set(CMAKE_COMPILER_WARNINGS)
# use -Wall for gcc and clang
list(APPEND CMAKE_COMPILER_WARNINGS
-Wall
-Wextra
-Wcomment
-Wendif-labels
-Wformat
-Winit-self
-Wreturn-type
-Wsequence-point
# Shadow is broken on gcc when using lambdas
# -Wshadow
-Wswitch
-Wtrigraphs
-Wundef
-Wuninitialized
-Wunreachable-code
-Wunused
-Wno-sign-compare
)
# Flags for gcc 7
if(CMAKE_${COMPILER}_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.0")
list(APPEND CMAKE_COMPILER_WARNINGS
-Wduplicated-branches
-Wduplicated-cond
-Wno-noexcept-type
-Wodr
-Wshift-negative-value
-Wshift-overflow=2
-Wno-comment
)
endif()
endif()
if (CMAKE_${COMPILER}_COMPILER_ID MATCHES "Clang")
list(APPEND CMAKE_COMPILER_WARNINGS
-Weverything
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-conversion
-Wno-double-promotion
-Wno-exit-time-destructors
-Wno-extra-semi
-Wno-extra-semi-stmt
-Wno-float-conversion
-Wno-gnu-anonymous-struct
-Wno-gnu-zero-variadic-macro-arguments
-Wno-missing-prototypes
-Wno-nested-anon-types
-Wno-option-ignored
-Wno-padded
-Wno-shorten-64-to-32
-Wno-sign-conversion
-Wno-unused-command-line-argument
-Wno-weak-vtables
-Wno-c99-extensions
-Wno-unsafe-buffer-usage
# This is broken for now for moved values
-Wno-shadow-uncaptured-local
# -Wno-c++2a-designator
# -Weverything gives contradictory warnings, so disable the one that requires default in switch
-Wno-switch-default
)
if(WIN32 AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19")
list(APPEND CMAKE_COMPILER_WARNINGS
-Wno-missing-include-dirs
-Wno-switch-default
-Wno-deprecated-pragma
)
endif()
else()
list(APPEND CMAKE_COMPILER_WARNINGS
-Wno-missing-field-initializers
-Wno-maybe-uninitialized
# -Wno-deprecated-declarations
)
endif()
foreach(COMPILER_WARNING ${CMAKE_COMPILER_WARNINGS})
string(MAKE_C_IDENTIFIER "HAS_${COMPILER}_FLAG${COMPILER_WARNING}" HAS_COMPILER_WARNING)
check_cxx_compiler_flag(${COMPILER_WARNING} ${HAS_COMPILER_WARNING})
if(${HAS_COMPILER_WARNING})
add_compile_options($<$:${COMPILER_WARNING}>)
endif()
endforeach()
endforeach()
endif ()
ROCm-AMDMIGraphX-46524e8/cmake/ExportHeader.cmake 0000664 0000000 0000000 00000004207 15104657024 0021217 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2023 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
if(COMMAND migraphx_generate_export_header)
return()
endif()
include(GenerateExportHeader)
function(migraphx_generate_export_header TARGET)
set(options)
set(oneValueArgs DIRECTORY)
set(multiValueArgs)
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(PARSE_DIRECTORY)
set(__directory ${PARSE_DIRECTORY})
else()
string(REPLACE "_" "/" __directory ${TARGET})
string(TOLOWER ${__directory} __directory)
endif()
set(__file_name ${CMAKE_CURRENT_BINARY_DIR}/include/${__directory}/export.h)
generate_export_header(${TARGET} EXPORT_FILE_NAME ${__file_name})
target_include_directories(${TARGET} PUBLIC $)
rocm_install(FILES ${__file_name} DESTINATION include/${__directory})
endfunction()
ROCm-AMDMIGraphX-46524e8/cmake/FindParallelSTL.cmake 0000664 0000000 0000000 00000005251 15104657024 0021545 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
#####################################################################################
include(CheckCXXSourceCompiles)
function(find_parallel_stl_check RESULT)
set(CMAKE_REQUIRED_LIBRARIES ${ARGN})
set(CMAKE_REQUIRED_FLAGS)
if(NOT MSVC)
set(CMAKE_REQUIRED_FLAGS "-std=c++17")
endif()
string(MD5 _flags_hash "${CMAKE_REQUIRED_FLAGS} ${CMAKE_REQUIRED_LIBRARIES}")
set(_source "
#include
#ifdef _PSTL_PAR_BACKEND_SERIAL
#error \"Using serial backend\"
#endif
int main() {
int* i = nullptr;
std::sort(std::execution::par, i, i);
}
")
check_cxx_source_compiles("${_source}" _has_execution_${_flags_hash})
set(${RESULT} ${_has_execution_${_flags_hash}} PARENT_SCOPE)
endfunction()
set(ParallelSTL_FOUND Off)
set(ParallelSTL_LIBRARIES)
set(ParallelSTL_USES_TBB Off)
find_parallel_stl_check(ParallelSTL_HAS_EXECUTION_PAR)
if(ParallelSTL_HAS_EXECUTION_PAR)
set(ParallelSTL_FOUND On)
else()
find_package(TBB QUIET)
if(TARGET TBB::tbb)
find_parallel_stl_check(ParallelSTL_TBB_HAS_EXECUTION_PAR TBB::tbb)
if(ParallelSTL_TBB_HAS_EXECUTION_PAR)
set(ParallelSTL_USES_TBB On)
set(ParallelSTL_LIBRARIES TBB::tbb)
message(STATUS "Using TBB for parallel execution")
endif()
endif()
endif()
foreach(VAR ParallelSTL_FOUND ParallelSTL_LIBRARIES ParallelSTL_USES_TBB)
string(TOUPPER ${VAR} ParallelSTL_VAR)
set(${ParallelSTL_VAR} ${${VAR}})
endforeach()
ROCm-AMDMIGraphX-46524e8/cmake/PythonModules.cmake 0000664 0000000 0000000 00000017262 15104657024 0021444 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
if(COMMAND find_python)
return()
endif()
if(CMAKE_HOSTS_SYSTEM_NAME STREQUAL "Windows")
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
endif()
macro(py_exec)
execute_process(${ARGN} RESULT_VARIABLE RESULT)
if(NOT RESULT EQUAL 0)
message(FATAL_ERROR "Process failed: ${ARGN}")
endif()
endmacro()
set(PYBIND11_NOPYTHON On)
find_package(pybind11 REQUIRED)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
function(find_python version python_executable)
cmake_path(GET python_executable PARENT_PATH _python_path)
set(PYTHON_${version}_EXECUTABLE ${python_executable} CACHE INTERNAL "" FORCE)
string(REPLACE "." "" _python_version_stripped ${version})
add_library(python${version}::headers INTERFACE IMPORTED GLOBAL)
set_target_properties(python${version}::headers PROPERTIES
INTERFACE_LINK_DIRECTORIES "${_python_path}\\libs"
INTERFACE_INCLUDE_DIRECTORIES "${_python_path}\\include")
add_library(python${version}::runtime INTERFACE IMPORTED GLOBAL)
set_target_properties(python${version}::runtime PROPERTIES
INTERFACE_LINK_LIBRARIES "python${_python_version_stripped}.lib;python${version}::headers")
endfunction()
else()
macro(find_python version)
find_program(PYTHON_CONFIG_${version} python${version}-config)
if(EXISTS ${PYTHON_CONFIG_${version}})
py_exec(COMMAND ${PYTHON_CONFIG_${version}} --includes OUTPUT_VARIABLE _python_include_args)
execute_process(COMMAND ${PYTHON_CONFIG_${version}} --ldflags --embed OUTPUT_VARIABLE _python_ldflags_args RESULT_VARIABLE _python_ldflags_result)
if(NOT _python_ldflags_result EQUAL 0)
py_exec(COMMAND ${PYTHON_CONFIG_${version}} --ldflags OUTPUT_VARIABLE _python_ldflags_args)
endif()
separate_arguments(_python_includes UNIX_COMMAND "${_python_include_args}")
separate_arguments(_python_ldflags UNIX_COMMAND "${_python_ldflags_args}")
string(REPLACE "-I" "" _python_includes "${_python_includes}")
add_library(python${version}::headers INTERFACE IMPORTED GLOBAL)
set_target_properties(python${version}::headers PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${_python_includes}"
)
add_library(python${version}::runtime INTERFACE IMPORTED GLOBAL)
set_target_properties(python${version}::runtime PROPERTIES
INTERFACE_LINK_OPTIONS "${_python_ldflags}"
INTERFACE_LINK_LIBRARIES python${version}::headers
)
py_exec(COMMAND ${PYTHON_CONFIG_${version}} --prefix OUTPUT_VARIABLE _python_prefix)
string(STRIP "${_python_prefix}" _python_prefix)
set(PYTHON_${version}_EXECUTABLE "${_python_prefix}/bin/python${version}" CACHE PATH "")
endif()
endmacro()
function(py_extension name version)
set(_python_module_extension ".so")
if(version VERSION_GREATER_EQUAL 3.0)
py_exec(COMMAND ${PYTHON_CONFIG_${version}} --extension-suffix OUTPUT_VARIABLE _python_module_extension)
string(STRIP "${_python_module_extension}" _python_module_extension)
endif()
set_target_properties(${name} PROPERTIES PREFIX "" SUFFIX "${_python_module_extension}")
endfunction()
endif()
function(py_add_module NAME)
set(options)
set(oneValueArgs PYTHON_VERSION PYTHON_MODULE)
set(multiValueArgs)
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(PYTHON_VERSION ${PARSE_PYTHON_VERSION})
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
add_library(${NAME} SHARED ${PARSE_UNPARSED_ARGUMENTS})
else()
add_library(${NAME} MODULE ${PARSE_UNPARSED_ARGUMENTS})
endif()
pybind11_strip(${NAME})
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
py_extension(${NAME} ${PYTHON_VERSION})
endif()
target_link_libraries(${NAME} PRIVATE pybind11::module pybind11::lto python${PYTHON_VERSION}::headers)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
execute_process(COMMAND "${PYTHON_${PYTHON_VERSION}_EXECUTABLE}" -c "import sysconfig; print(sysconfig.get_config_var(\"EXT_SUFFIX\"))"
OUTPUT_VARIABLE _python_module_extension)
cmake_path(GET _python_module_extension STEM LAST_ONLY _module_name)
set_target_properties(${NAME} PROPERTIES OUTPUT_NAME ${PARSE_PYTHON_MODULE}${_module_name} SUFFIX ".pyd")
else()
set_target_properties(${NAME} PROPERTIES
OUTPUT_NAME ${PARSE_PYTHON_MODULE}
C_VISIBILITY_PRESET hidden
CXX_VISIBILITY_PRESET hidden
)
endif()
endfunction()
set(PYTHON_DISABLE_VERSIONS "" CACHE STRING "")
set(_PYTHON_VERSIONS)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
find_program(PY_EXECUTABLE py.exe PATHS ENV windir REQUIRED)
py_exec(COMMAND "${PY_EXECUTABLE}" -0p OUTPUT_VARIABLE _found_pythons)
string(REPLACE "\n" ";" _found_pythons ${_found_pythons})
foreach(_found_python ${_found_pythons})
string(STRIP "${_found_python}" _found_python)
# Ignore virtual environments
if(NOT _found_python MATCHES "^\\*[ \t]*")
string(REGEX REPLACE "^-V:([0-9]*\\.[0-9]*t?)[ \\t]*\\*?[ \\t]*" "\\1;" _tuple ${_found_python})
list(GET _tuple 0 _version)
# Ignore if the Python version is disabled
if(NOT _version IN_LIST PYTHON_DISABLE_VERSIONS)
list(GET _tuple 1 _python_executable)
find_python(${_version} "${_python_executable}")
message(STATUS "Python ${_version} found.")
list(APPEND _PYTHON_VERSIONS ${_version})
endif()
endif()
endforeach()
else()
set(PYTHON_SEARCH_VERSIONS 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13)
foreach(PYTHON_DISABLE_VERSION ${PYTHON_DISABLE_VERSIONS})
list(REMOVE_ITEM PYTHON_SEARCH_VERSIONS ${PYTHON_DISABLE_VERSION})
endforeach()
foreach(PYTHON_VERSION ${PYTHON_SEARCH_VERSIONS})
find_python(${PYTHON_VERSION})
if(TARGET python${PYTHON_VERSION}::headers)
message(STATUS "Python ${PYTHON_VERSION} found.")
list(APPEND _PYTHON_VERSIONS ${PYTHON_VERSION})
else()
message(STATUS "Python ${PYTHON_VERSION} not found.")
endif()
endforeach()
endif()
# Make the variable global
set(PYTHON_VERSIONS "${_PYTHON_VERSIONS}" CACHE INTERNAL "" FORCE)
ROCm-AMDMIGraphX-46524e8/cmake/RegisterOp.cmake 0000664 0000000 0000000 00000004515 15104657024 0020712 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
function(register_op TARGET_NAME)
set(options)
set(oneValueArgs HEADER)
set(multiValueArgs OPERATORS INCLUDES)
cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
string(MAKE_C_IDENTIFIER "${PARSE_HEADER}" BASE_NAME)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ops)
set(FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/ops/${BASE_NAME}.cpp)
file(WRITE "${FILE_NAME}" "")
foreach(INCLUDE ${PARSE_INCLUDES})
file(APPEND "${FILE_NAME}" "
#include <${INCLUDE}>
")
endforeach()
file(APPEND "${FILE_NAME}" "
#include
#include <${PARSE_HEADER}>
")
file(APPEND "${FILE_NAME}" "
namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
")
foreach(OPERATOR ${PARSE_OPERATORS})
file(APPEND "${FILE_NAME}" "
MIGRAPHX_REGISTER_OP(${OPERATOR})
")
endforeach()
file(APPEND "${FILE_NAME}" "
} // namespace MIGRAPHX_INLINE_NS
} // namespace migraphx
")
target_sources(${TARGET_NAME} PRIVATE ${FILE_NAME})
endfunction()
ROCm-AMDMIGraphX-46524e8/cmake/TargetFlags.cmake 0000664 0000000 0000000 00000010754 15104657024 0021034 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2022 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
function(eval_and_strip_genex OUTPUT_VAR INPUT)
string(REPLACE "$" "1" INPUT "${INPUT}")
string(REPLACE "$" "1" INPUT "${INPUT}")
string(REPLACE "SHELL:" "" INPUT "${INPUT}")
string(REPLACE "$" "0" INPUT "${INPUT}")
string(REGEX REPLACE "\\$" "0" INPUT "${INPUT}")
string(REGEX REPLACE "\\$]*-NOTFOUND>" "0" INPUT "${INPUT}")
string(REGEX REPLACE "\\$]*>" "1" INPUT "${INPUT}")
string(REPLACE "$" "1" INPUT "${INPUT}")
string(REPLACE "$" "0" INPUT "${INPUT}")
string(REGEX REPLACE "\\$<0:[^<>]*>" "" INPUT "${INPUT}")
string(REGEX REPLACE "\\$<1:([^<>]*)>" "\\1" INPUT "${INPUT}")
string(GENEX_STRIP "${INPUT}" INPUT)
set(${OUTPUT_VAR} "${INPUT}" PARENT_SCOPE)
endfunction()
function(get_target_property2 VAR TARGET PROPERTY)
get_target_property(_pflags ${TARGET} ${PROPERTY})
if(_pflags)
eval_and_strip_genex(_pflags "${_pflags}")
set(${VAR} ${_pflags} PARENT_SCOPE)
else()
set(${VAR} "" PARENT_SCOPE)
endif()
endfunction()
function(flags_requires_arg OUTPUT_VAR FLAG)
set(_args -x -isystem)
if(FLAG IN_LIST _args)
set(${OUTPUT_VAR} 1 PARENT_SCOPE)
else()
set(${OUTPUT_VAR} 0 PARENT_SCOPE)
endif()
endfunction()
macro(append_flags FLAGS TARGET PROPERTY PREFIX)
get_target_property2(_pflags ${TARGET} ${PROPERTY})
set(_requires_arg 0)
foreach(FLAG ${_pflags})
string(STRIP "${FLAG}" FLAG)
if(FLAG)
if(TARGET ${FLAG} AND NOT _requires_arg)
target_flags(_pflags2 ${FLAG})
string(APPEND ${FLAGS} " ${_pflags2}")
else()
string(APPEND ${FLAGS} " ${PREFIX}${FLAG}")
endif()
flags_requires_arg(_requires_arg "${FLAG}")
endif()
endforeach()
endmacro()
macro(append_link_flags FLAGS TARGET PROPERTY)
get_target_property2(_pflags ${TARGET} ${PROPERTY})
set(_requires_arg 0)
foreach(FLAG ${_pflags})
string(STRIP "${FLAG}" FLAG)
if(FLAG)
if(TARGET ${FLAG} AND NOT _requires_arg)
target_flags(_pflags2 ${FLAG})
string(APPEND ${FLAGS} " ${_pflags2}")
elseif(FLAG MATCHES "^-.*")
string(APPEND ${FLAGS} " ${FLAG}")
elseif(EXISTS ${FLAG})
string(APPEND ${FLAGS} " ${FLAG}")
else()
string(APPEND ${FLAGS} " -l${FLAG}")
endif()
flags_requires_arg(_requires_arg "${FLAG}")
endif()
endforeach()
endmacro()
function(target_flags FLAGS TARGET)
set(_flags)
append_flags(_flags ${TARGET} "INTERFACE_COMPILE_OPTIONS" "")
append_flags(_flags ${TARGET} "INTERFACE_COMPILE_DEFINITIONS" "-D")
append_flags(_flags ${TARGET} "INTERFACE_INCLUDE_DIRECTORIES" "-isystem ")
append_flags(_flags ${TARGET} "INTERFACE_LINK_DIRECTORIES" "-L ")
append_flags(_flags ${TARGET} "INTERFACE_LINK_OPTIONS" "")
append_link_flags(_flags ${TARGET} "INTERFACE_LINK_LIBRARIES" "")
# message("_flags: ${_flags}")
set(${FLAGS} ${_flags} PARENT_SCOPE)
endfunction()
ROCm-AMDMIGraphX-46524e8/codecov.yml 0000664 0000000 0000000 00000000117 15104657024 0016704 0 ustar 00root root 0000000 0000000 ignore:
- "test/"
- "src/driver"
- "build/"
- "src/netron_output.cpp"
ROCm-AMDMIGraphX-46524e8/dev-requirements.txt 0000664 0000000 0000000 00000003261 15104657024 0020602 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
ROCm/rocm-recipes
facebook/zstd@v1.5.7 -X subdir -DCMAKE_DIR=build/cmake
ccache@v4.1 -DENABLE_TESTING=OFF
pcre,pfultz2/pcre@8.45 -H sha256:d6f7182602a775a7d500a0cedca6449af0400c6493951513046d17615ed0bf11
danmar/cppcheck@bb2711c22a0be09efe7f1a8da3030876471026c8 -DHAVE_RULES=1 # 2.11
RadeonOpenCompute/rocm-cmake@dfaa4ddba4dbb2e1c6e9964ce610e2a12fd93f39 --build
-f requirements.txt
ROCm-AMDMIGraphX-46524e8/docs/ 0000775 0000000 0000000 00000000000 15104657024 0015470 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/docs/CMakeLists.txt 0000664 0000000 0000000 00000002701 15104657024 0020230 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# Copyright (c) 2015-2023 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
project(migraphx-doc)
find_package(ROCM REQUIRED)
include(ROCMSphinxDoc)
rocm_add_sphinx_doc(
.
BUILDER html
OUTPUT_DIR html
)
ROCm-AMDMIGraphX-46524e8/docs/conf.py 0000664 0000000 0000000 00000005113 15104657024 0016767 0 ustar 00root root 0000000 0000000 #####################################################################################
# The MIT License (MIT)
#
# 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
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#####################################################################################
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import re
html_theme = "rocm_docs_theme"
html_theme_options = {"flavor": "rocm-docs-home"}
templates_path = ["."] # Use the current folder for templates
setting_all_article_info = True
all_article_info_os = ["linux"]
with open('../CMakeLists.txt', encoding='utf-8') as f:
match = re.search(r'.*\brocm_setup_version\(VERSION\s+([0-9.]+)[^0-9.]+',
f.read())
if not match:
raise ValueError("VERSION not found!")
version_number = match[1]
# for PDF output on Read the Docs
project = "MIGraphX"
author = "Advanced Micro Devices, Inc."
copyright = "Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved."
version = version_number
release = version_number
extensions = ["rocm_docs", "rocm_docs.doxygen", "sphinx_collapse"]
external_toc_path = "./sphinx/_toc.yml"
doxygen_root = "doxygen"
doxysphinx_enabled = False
doxygen_project = {
"name": "doxygen",
"path": "doxygen/xml",
}
html_title = f"{project} {version_number} documentation"
external_projects_current_project = "amdmigraphx"
ROCm-AMDMIGraphX-46524e8/docs/cpp_user_guide.rst 0000664 0000000 0000000 00000000145 15104657024 0021217 0 ustar 00root root 0000000 0000000 C++ User Guide
==============
.. toctree::
:maxdepth: 2
:caption: Contents:
reference/cpp
ROCm-AMDMIGraphX-46524e8/docs/data/ 0000775 0000000 0000000 00000000000 15104657024 0016401 5 ustar 00root root 0000000 0000000 ROCm-AMDMIGraphX-46524e8/docs/data/roctx1.jpg 0000664 0000000 0000000 00001430265 15104657024 0020336 0 ustar 00root root 0000000 0000000 ‰PNG
IHDR † šý¿î
ÙiCCPICC Profile H‰•—TSi€ÿ÷Ò-)¡7餄ÐB¤ƒ(„$PbL͆ÈàŽPGtPDÁѱ ¬(6ì2((ë`(û€%ÌÌžÝ={ÏùßýrßýoùÏûϹ€Ä‹Óa% 2D™’0?/zLl×H Ê 0®TÌ
ˆÌè¿Êè}Ä‘;–“±þýý_Ê ŠG8‰'åf ܆¬a®X’ ê(b7ÈÎOò]„i¤@„&9ešÇ'9iŠÑJS>a,„
À“9I
dÄNÏ⦠qȡۈxBÂù»sÂH^0/#cÙ$!lŠø‹ Ðf$ý)fÊ_â'Éãs8)ržîkJðÞB©8“ûÍÿ–ŒtÙLcd‘ÿ0D«#ç÷ mY œEICfXÈ›òŸbÌ?r†¹RVÜó8Þò½éƒf8YèË–ÇÉdGÌ0_ê>Ã’eaò\És†9’Ù¼²´H¹]ÀgËãç "¢g8Kµp†¥iá³>,¹]"“×ÏùyÍæõ•÷ž!ýS¿B¶|o¦ Â_Þ;g¶~¾ˆ9S#¯Ç÷ö™õ‰”û‹3½ä¹Äé¡r~ºŸÜ.Í
—ïÍD>ÎÙ½¡ò3Lå„Î0ÁÀ8 G„XÀy&