Compare commits

...

14 Commits

Author SHA1 Message Date
Joseph Macaranas
33dcecbdb2 Update rocPyDecode.yml 2024-10-07 21:50:49 -04:00
Joseph Macaranas
264df9af47 Update rocPyDecode.yml 2024-10-07 21:50:30 -04:00
Joseph Macaranas
d1ef73e1fb Update rocPyDecode.yml 2024-10-07 20:04:49 -04:00
Joseph Macaranas
f36e0cc633 Update rocPyDecode.yml 2024-10-07 19:45:17 -04:00
Joseph Macaranas
7f826aab94 Update rocPyDecode.yml 2024-10-07 19:44:56 -04:00
Joseph Macaranas
d5a48525f5 Update rocPyDecode.yml 2024-10-07 15:09:53 -04:00
Joseph Macaranas
094c9dd7fd Update rocPyDecode.yml 2024-10-07 15:05:30 -04:00
Joseph Macaranas
aa7bfdfead Update rocPyDecode.yml 2024-10-07 15:02:46 -04:00
Joseph Macaranas
3a8e30a23f Update rocPyDecode.yml 2024-10-07 14:51:16 -04:00
Daniel Su
f72e28afbb External CI: add a global variable to control gfx942 tests (#3864) 2024-10-04 18:57:19 -04:00
spolifroni-amd
a8dd588a72 Removed MIGraphX optimization page (#3848) 2024-10-04 17:06:51 -04:00
Joseph Macaranas
f7dbbb5ad8 External CI: Add option to pull mainline branch for dependencies (#3689)
* External CI: Add option to pull mainline branch for dependencies

* Missing parameter for mainline branch dependencies.

* External CI: mainline branch definitions
2024-10-04 16:28:16 -04:00
Sam Wu
6d5d22ac6a Set devops team as codeowners for rocm-build (#3860)
* Set ext CI as codeowners for rocm-build

* Update CODEOWNERS to rocm-devops
2024-10-04 11:09:17 -06:00
spolifroni-amd
1a86548a2c updated the radeon note, as it were (#3857)
* updated the radeon note, as it were

* updated the note again
2024-10-03 10:58:58 -04:00
54 changed files with 211 additions and 421 deletions

View File

@@ -0,0 +1,42 @@
variables:
- group: common
- template: /.azuredevops/variables-global.yml
resources:
repositories:
- repository: aomp_repo
type: github
endpoint: ROCm
name: ROCm/aomp
ref: amd-mainline-open
- repository: aomp-extras_repo
type: github
endpoint: ROCm
name: ROCm/aomp-extras
ref: amd-mainline-open
- repository: flang_repo
type: github
endpoint: ROCm
name: ROCm/flang
ref: amd-mainline-open
- repository: llvm-project_repo
type: github
endpoint: ROCm
name: ROCm/llvm-project
ref: amd-mainline-open
pipelines:
- pipeline: rocr-runtime_pipeline
source: \ROCR-Runtime
trigger:
branches:
include:
- amd-master
# this job will only be triggered after successful build sequence of llvm-project and ROCR-Runtime
trigger: none
pr: none
jobs:
- template: ${{ variables.CI_COMPONENT_PATH }}/aomp.yml
parameters:
checkoutRepo: aomp_repo

View File

@@ -27,7 +27,10 @@ resources:
pipelines:
- pipeline: rocr-runtime_pipeline
source: \ROCR-Runtime
trigger: true
trigger:
branches:
include:
- amd-staging
# this job will only be triggered after successful build sequence of llvm-project and ROCR-Runtime
trigger: none

View File

@@ -129,6 +129,7 @@ jobs:
gpuTarget: $(JOB_GPU_TARGET)
- job: AMDMIGraphX_testing
condition: eq(variables.ENABLE_GFX942_TESTS, 'true')
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -120,6 +120,7 @@ jobs:
gpuTarget: $(JOB_GPU_TARGET)
- job: MIOpen_testing
condition: eq(variables.ENABLE_GFX942_TESTS, 'true')
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -120,7 +120,7 @@ jobs:
- job: MIVisionX_testing
dependsOn: MIVisionX
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -59,7 +59,7 @@ jobs:
- job: ROCR_Runtime_testing
dependsOn: ROCR_Runtime
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -32,6 +32,7 @@ parameters:
jobs:
- job: ROCgdb
condition: eq(variables.ENABLE_GFX942_TESTS, 'true')
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -98,7 +98,7 @@ jobs:
- job: ROCmValidationSuite_testing
dependsOn: ROCmValidationSuite
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -35,7 +35,7 @@ jobs:
- job: amdsmi_testing
dependsOn: amdsmi
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -413,7 +413,7 @@ jobs:
- job: aomp_testing
dependsOn: aomp
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -101,7 +101,7 @@ jobs:
- job: composable_kernel_testing
dependsOn: composable_kernel
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -91,7 +91,7 @@ jobs:
- job: hip_tests_testing
timeoutInMinutes: 240
dependsOn: hip_tests
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -98,7 +98,7 @@ jobs:
- job: hipBLAS_testing
dependsOn: hipBLAS
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -150,7 +150,7 @@ jobs:
- job: hipBLASLt_testing
dependsOn: hipBLASLt
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -78,7 +78,7 @@ jobs:
- job: hipCUB_testing
dependsOn: hipCUB
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -96,7 +96,7 @@ jobs:
- job: hipFFT_testing
dependsOn: hipFFT
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -82,7 +82,7 @@ jobs:
- job: hipRAND_testing
dependsOn: hipRAND
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -103,7 +103,7 @@ jobs:
- job: hipSOLVER_testing
dependsOn: hipSOLVER
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -97,7 +97,7 @@ jobs:
- job: hipSPARSE_testing
dependsOn: hipSPARSE
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -123,7 +123,7 @@ jobs:
- job: hipSPARSELt_testing
dependsOn: hipSPARSELt
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -79,7 +79,7 @@ jobs:
- job: hipTensor_testing
timeoutInMinutes: 90
dependsOn: hipTensor
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -94,7 +94,7 @@ jobs:
- job: hipfort_testing
dependsOn: hipfort
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -92,7 +92,7 @@ jobs:
- job: omniperf_testing
dependsOn: omniperf
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -102,7 +102,7 @@ jobs:
- job: rccl_testing
timeoutInMinutes: 120
dependsOn: rccl
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -113,7 +113,7 @@ jobs:
- job: rdc_testing
dependsOn: rdc
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -157,7 +157,7 @@ jobs:
- job: rocAL_testing
dependsOn: rocAL
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -98,7 +98,7 @@ jobs:
- job: rocALUTION_testing
dependsOn: rocALUTION
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -121,7 +121,7 @@ jobs:
- job: rocBLAS_testing
dependsOn: rocBLAS
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -88,7 +88,7 @@ jobs:
- job: rocDecode_testing
dependsOn: rocDecode
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -95,7 +95,7 @@ jobs:
- job: rocFFT_testing
dependsOn: rocFFT
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -66,6 +66,7 @@ jobs:
# compiling and running test on the test system together
- job: rocMLIR_testing
condition: eq(variables.ENABLE_GFX942_TESTS, 'true')
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -77,7 +77,7 @@ jobs:
- job: rocPRIM_testing
dependsOn: rocPRIM
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -24,9 +24,7 @@ parameters:
- name: pipModules
type: object
default:
- -i
- https://test.pypi.org/simple
- hip-python
- cibuildwheel
- name: rocmDependencies
type: object
default:
@@ -48,12 +46,6 @@ jobs:
vmImage: ${{ variables.BASE_BUILD_POOL }}
workspace:
clean: all
strategy:
matrix:
gfx942:
JOB_GPU_TARGET: gfx942
gfx90a:
JOB_GPU_TARGET: gfx90a
steps:
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
parameters:
@@ -66,12 +58,11 @@ jobs:
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-rocm.yml
parameters:
dependencyList: ${{ parameters.rocmDependencies }}
gpuTarget: $(JOB_GPU_TARGET)
# CI case: download latest default branch build
${{ if eq(parameters.checkoutRef, '') }}:
${{ if eq(parameters.checkoutRef, 'develop') }}:
dependencySource: staging
# manual build case: triggered by ROCm/ROCm repo
${{ elseif ne(parameters.checkoutRef, '') }}:
${{ elseif ne(parameters.checkoutRef, 'develop') }}:
dependencySource: tag-builds
- task: Bash@3
displayName: 'ROCm symbolic link'
@@ -80,43 +71,57 @@ jobs:
script: |
sudo rm -rf /opt/rocm
sudo ln -s $(Agent.BuildDirectory)/rocm /opt/rocm
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/build-cmake.yml
parameters:
extraBuildFlags: >-
-DROCM_PATH=$(Agent.BuildDirectory)/rocm
-DCMAKE_PREFIX_PATH=$(Agent.BuildDirectory)/rocm
-DCMAKE_BUILD_TYPE=Release
-DAMDGPU_TARGETS=$(JOB_GPU_TARGET)
-DCMAKE_INSTALL_PREFIX_PYTHON=$(Build.BinariesDirectory)
-GNinja
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/artifact-upload.yml
parameters:
gpuTarget: $(JOB_GPU_TARGET)
publish: false
# - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/build-cmake.yml
# parameters:
# extraBuildFlags: >-
# -DROCM_PATH=$(Agent.BuildDirectory)/rocm
# -DCMAKE_PREFIX_PATH=$(Agent.BuildDirectory)/rocm
# -DCMAKE_BUILD_TYPE=Release
# -DAMDGPU_TARGETS=$(JOB_GPU_TARGET)
# -DCMAKE_INSTALL_PREFIX_PYTHON=$(Build.BinariesDirectory)
# -GNinja
# - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/artifact-upload.yml
# parameters:
# gpuTarget: $(JOB_GPU_TARGET)
# publish: false
# - task: Bash@3
# displayName: Create wheel file
# inputs:
# targetType: inline
# script: |
# export ROCM_PATH=$(Agent.BuildDirectory)/rocm
# export HIP_INCLUDE_DIRS=$(Agent.BuildDirectory)/rocm/include/hip
# python3 setup.py bdist_wheel
# workingDirectory: $(Build.SourcesDirectory)
# - template: ${{ variables.CI_TEMPLATE_PATH }}/steps/artifact-prepare-package.yml
# parameters:
# sourceDir: $(Build.SourcesDirectory)/dist
# contentsString: '*.whl'
# targetDir: $(Build.ArtifactStagingDirectory)
# clean: false
# - task: PublishPipelineArtifact@1
# displayName: 'wheel file Publish'
# retryCountOnTaskFailure: 3
# inputs:
# targetPath: $(Build.ArtifactStagingDirectory)
- task: Bash@3
displayName: Create wheel file
inputs:
targetType: inline
script: |
export ROCM_PATH=$(Agent.BuildDirectory)/rocm
export HIP_INCLUDE_DIRS=$(Agent.BuildDirectory)/rocm/include/hip
python3 setup.py bdist_wheel
script: cibuildwheel --output-dir wheelhouse .
workingDirectory: $(Build.SourcesDirectory)
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/artifact-prepare-package.yml
parameters:
sourceDir: $(Build.SourcesDirectory)/dist
contentsString: '*.whl'
targetDir: $(Build.ArtifactStagingDirectory)
clean: false
env:
CIBW_BEFORE_BUILD: python3 rocPyDecode-requirements.py
CIBW_ENVIRONMENT: ROCM_PATH='$(Agent.BuildDirectory)/rocm'
- task: PublishPipelineArtifact@1
displayName: 'wheel file Publish'
retryCountOnTaskFailure: 3
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
targetPath: wheelhouse
- job: rocPyDecode_testing
dependsOn: rocPyDecode
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -79,7 +79,7 @@ jobs:
- job: rocRAND_testing
dependsOn: rocRAND
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -113,7 +113,7 @@ jobs:
- job: rocSOLVER_testing
dependsOn: rocSOLVER
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -107,7 +107,7 @@ jobs:
- job: rocSPARSE_testing
timeoutInMinutes: 90
dependsOn: rocSPARSE
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -82,7 +82,7 @@ jobs:
- job: rocThrust_testing
dependsOn: rocThrust
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -94,7 +94,7 @@ jobs:
- job: rocWMMA_testing
timeoutInMinutes: 90
dependsOn: rocWMMA
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -116,7 +116,7 @@ jobs:
- job: rocm_examples_testing
dependsOn: rocm_examples
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -72,7 +72,7 @@ jobs:
- job: rocm_bandwidth_test_testing
dependsOn: rocm_bandwidth_test
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -29,7 +29,7 @@ jobs:
- job: rocm_smi_lib_testing
dependsOn: rocm_smi_lib
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -49,7 +49,7 @@ jobs:
- job: rocminfo_testing
dependsOn: rocminfo
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -100,7 +100,7 @@ jobs:
- job: rocprofiler_testing
dependsOn: rocprofiler
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -72,7 +72,7 @@ jobs:
- job: rocr_debug_agent_testing
dependsOn: rocr_debug_agent
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -84,7 +84,7 @@ jobs:
- job: roctracer_testing
dependsOn: roctracer
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -93,7 +93,7 @@ jobs:
- job: rpp_testing
dependsOn: rpp
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -348,7 +348,7 @@ jobs:
- job: torchvision_testing
dependsOn: pytorch
condition: succeeded()
condition: and(succeeded(), eq(variables.ENABLE_GFX942_TESTS, 'true'))
variables:
- group: common
- template: /.azuredevops/variables-global.yml

View File

@@ -9,6 +9,10 @@ parameters:
- name: useDefaultBranch
type: boolean
default: true
# useMainlineBranch only processed if useDefaultBranch is false
- name: useMainlineBranch
type: boolean
default: false
- name: latestFromBranch
type: boolean
default: true
@@ -46,8 +50,9 @@ parameters:
MIOpen: develop
MIVisionX: develop
omniperf: amd-staging
omnitrace: amd-staging
rccl: develop
rdc: develop
rdc: amd-staging
rocAL: develop
rocALUTION: develop
rocBLAS: develop
@@ -56,13 +61,13 @@ parameters:
rocFFT: develop
ROCgdb: amd-staging
rocm-cmake: develop
rocm-core: master
rocm-core: amd-staging
rocm-examples: develop
rocminfo: amd-staging
rocMLIR: develop
ROCmValidationSuite: master
rocm_bandwidth_test: master
rocm_smi_lib: develop
rocm_smi_lib: amd-staging
rocPRIM: develop
rocprofiler-register: amd-staging
rocprofiler-sdk: amd-staging
@@ -77,6 +82,64 @@ parameters:
roctracer: amd-staging
rocWMMA: develop
rpp: develop
- name: mainlineBranchList
type: object
default:
AMDMIGraphX: mainline
amdsmi: amd-mainline
aomp-extras: amd-mainline-open
aomp: amd-mainline-open
clr: amd-mainline
composable_kernel: mainline
half: rocm
HIP: amd-mainline
hipBLAS: mainline
hipBLASLt: mainline
hipBLAS-common: mainline
hipCUB: mainline
hipFFT: mainline
hipfort: mainline
HIPIFY: amd-mainline
hipRAND: mainline
hipSOLVER: mainline
hipSPARSE: mainline
hipSPARSELt: mainline
hipTensor: mainline
llvm-project: amd-mainline-open
MIOpen: mainline
MIVisionX: mainline
omniperf: amd-staging
omnitrace: amd-staging
rccl: mainline
rdc: amd-mainline
rocAL: mainline # needs the yaml file
rocALUTION: mainline
rocBLAS: mainline
ROCdbgapi : amd-mainline
rocDecode: mainline
rocFFT: mainline
ROCgdb: amd-mainline-rocgdb-15 #
rocm-cmake: mainline
rocm-core: amd-master
rocm-examples: develop # no mainline
rocminfo: amd-master
rocMLIR: mainline # needs the yaml file
ROCmValidationSuite: master
rocm_bandwidth_test: master
rocm_smi_lib: amd-mainline
rocPRIM: mainline
rocprofiler: amd-master
rocprofiler-register: amd-mainline
rocprofiler-sdk: amd-mainline
ROCR-Runtime: amd-master
rocRAND: mainline
rocr_debug_agent: amd-mainline
rocSOLVER: mainline
rocSPARSE: mainline
rocThrust: mainline
roctracer: amd-master
rocWMMA: mainline
rpp: mainline
- name: allowPartiallySucceededBuilds
type: object
default:
@@ -110,6 +173,8 @@ steps:
buildVersionToDownload: latestFromBranch # default is 'latest'
${{ if eq(parameters.useDefaultBranch, true) }}:
branchName: refs/heads/${{ parameters.defaultBranchList[parameters.componentName] }}
${{ elseif eq(parameters.useMainlineBranch, true) }}:
branchName: refs/heads/${{ parameters.mainlineBranchList[parameters.componentName] }}
${{ else }}:
branchName: ${{ parameters.branchName }}
${{ if containsValue(parameters.allowPartiallySucceededBuilds, parameters.componentName) }}:

View File

@@ -9,6 +9,7 @@ parameters:
default: staging
values:
- staging
- mainline
- tag-builds
- fixed
- name: extractToMnt
@@ -216,6 +217,10 @@ steps:
${{ if eq(parameters.dependencySource, 'staging') }}:
pipelineId: ${{ parameters.stagingPipelineIdentifiers[ split(dependency, ':')[0] ] }}
latestFromBranch: ${{ parameters.latestFromBranch }}
${{ elseif eq(parameters.dependencySource, 'mainline') }}:
pipelineId: ${{ parameters.stagingPipelineIdentifiers[ split(dependency, ':')[0] ] }}
useMainlineBranch: true
latestFromBranch: ${{ parameters.latestFromBranch }}
${{ elseif eq(parameters.dependencySource, 'tag-builds') }}:
pipelineId: ${{ parameters.taggedPipelineIdentifiers[ split(dependency, ':')[0] ] }}
latestFromBranch: false
@@ -232,6 +237,10 @@ steps:
${{ if eq(parameters.dependencySource, 'staging') }}:
pipelineId: ${{ parameters.stagingPipelineIdentifiers[dependency] }}
latestFromBranch: ${{ parameters.latestFromBranch }}
${{ elseif eq(parameters.dependencySource, 'mainline') }}:
pipelineId: ${{ parameters.stagingPipelineIdentifiers[dependency] }}
useMainlineBranch: true
latestFromBranch: ${{ parameters.latestFromBranch }}
${{ elseif eq(parameters.dependencySource, 'tag-builds') }}:
pipelineId: ${{ parameters.taggedPipelineIdentifiers[dependency] }}
latestFromBranch: false

1
.github/CODEOWNERS vendored
View File

@@ -5,3 +5,4 @@ docs/ @amd-aakash @jlgreathouse @samjwu @yhuiYH @ROCm/rocm-documentation
*.rst @amd-aakash @jlgreathouse @samjwu @yhuiYH @ROCm/rocm-documentation
# External CI
/.azuredevops/ @ROCm/external-ci
tools/rocm-build/ @ROCm/rocm-devops

View File

@@ -10,10 +10,7 @@ Use this matrix to view the ROCm compatibility and system requirements across su
You can also refer to the :ref:`past versions of ROCm compatibility matrix<past-rocm-compatibility-matrix>`.
.. note::
Like AMD Instinct accelerators, AMD Radeon and Radeon Pro GPUs can be used in environments for compute purposes (no display information or graphics). If using AMD Radeon or Radeon Pro GPUs with ROCm for graphics-related purposes (for example, display connected), review the `Compatibility matrices <https://rocm.docs.amd.com/projects/radeon/en/latest/docs/compatibility.html>`_ in the Use ROCm on Radeon GPU documentation to confirm system requirements.
Accelerators and GPUs listed in the following table support compute workloads (no display information or graphics). If youre using ROCm with AMD Radeon or Radeon Pro GPUs for graphics workloads, see the `Use ROCm on Radeon GPU documentation <https://rocm.docs.amd.com/projects/radeon/en/latest/docs/compatibility.html>`_ to verify compatibility and system requirements.
.. |br| raw:: html

View File

@@ -1,333 +0,0 @@
<head>
<meta charset="UTF-8">
<meta name="description" content="Inference optimization with MIGraphX">
<meta name="keywords" content="Inference optimization, MIGraphX, deep-learning, MIGraphX
installation, AMD, ROCm">
</head>
# Inference optimization with MIGraphX
The following sections cover inferencing and introduces [MIGraphX](https://rocm.docs.amd.com/projects/AMDMIGraphX/en/latest/).
## Inference
The inference is where capabilities learned during deep-learning training are put to work. It refers to using a fully trained neural network to make conclusions (predictions) on unseen data that the model has never interacted with before. Deep-learning inferencing is achieved by feeding new data, such as new images, to the network, giving the Deep Neural Network a chance to classify the image.
Taking our previous example of MNIST, the DNN can be fed new images of handwritten digit images, allowing the neural network to classify digits. A fully trained DNN should make accurate predictions about what an image represents, and inference cannot happen without training.
## MIGraphX introduction
MIGraphX is a graph compiler focused on accelerating the machine-learning inference that can target AMD GPUs and CPUs. MIGraphX accelerates the machine-learning models by leveraging several graph-level transformations and optimizations. These optimizations include:
* Operator fusion
* Arithmetic simplifications
* Dead-code elimination
* Common subexpression elimination (CSE)
* Constant propagation
After doing all these transformations, MIGraphX emits code for the AMD GPU by calling to MIOpen or rocBLAS or creating HIP kernels for a particular operator. MIGraphX can also target CPUs using DNNL or ZenDNN libraries.
MIGraphX provides easy-to-use APIs in C++ and Python to import machine models in ONNX or TensorFlow. Users can compile, save, load, and run these models using the MIGraphX C++ and Python APIs. Internally, MIGraphX parses ONNX or TensorFlow models into internal graph representation where each operator in the model gets mapped to an operator within MIGraphX. Each of these operators defines various attributes such as:
* Number of arguments
* Type of arguments
* Shape of arguments
After optimization passes, all these operators get mapped to different kernels on GPUs or CPUs.
After importing a model into MIGraphX, the model is represented as `migraphx::program`. `migraphx::program` is made up of `migraphx::module`. The program can consist of several modules, but it always has one main_module. Modules are made up of `migraphx::instruction_ref`. Instructions contain the `migraphx::op` and arguments to the operator.
## Installing MIGraphX
There are three options to get started with MIGraphX installation. MIGraphX depends on ROCm libraries; assume that the machine has ROCm installed.
### Option 1: installing binaries
To install MIGraphX on Debian-based systems like Ubuntu, use the following command:
```bash
sudo apt update && sudo apt install -y migraphx
```
The header files and libraries are installed under `/opt/rocm-\<version\>`, where \<version\> is the ROCm version.
### Option 2: building from source
There are two ways to build the MIGraphX sources.
* [Use the ROCm build tool](https://github.com/ROCm/AMDMIGraphX#use-the-rocm-build-tool-rbuild) - This approach uses `[rbuild](https://github.com/ROCm/rbuild)` to install the prerequisites and build the libraries with just one command.
or
* [Use CMake](https://github.com/ROCm/AMDMIGraphX#use-cmake-to-build-migraphx) - This approach uses a script to install the prerequisites, then uses CMake to build the source.
For detailed steps on building from source and installing dependencies, refer to the following `README` file:
[https://github.com/ROCm/AMDMIGraphX#building-from-source](https://github.com/ROCm/AMDMIGraphX#building-from-source)
### Option 3: use docker
To use Docker, follow these steps:
1. The easiest way to set up the development environment is to use Docker. To build Docker from scratch, first clone the MIGraphX repository by running:
```bash
git clone --recursive https://github.com/ROCm/AMDMIGraphX
```
2. The repository contains a Dockerfile from which you can build a Docker image as:
```bash
docker build -t migraphx .
```
3. Then to enter the development environment, use Docker run:
```bash
docker run --device='/dev/kfd' --device='/dev/dri' -v=`pwd`:/code/AMDMIGraphX -w /code/AMDMIGraphX --group-add video -it migraphx
```
The Docker image contains all the prerequisites required for the installation, so users can go to the folder `/code/AMDMIGraphX` and follow the steps mentioned in [Option 2: Building from Source](#option-2-building-from-source).
## MIGraphX example
MIGraphX provides both C++ and Python APIs. The following sections show examples of both using the Inception v3 model. To walk through the examples, fetch the Inception v3 ONNX model by running the following:
```py
import torch
import torchvision.models as models
inception = models.inception_v3(pretrained=True)
torch.onnx.export(inception,torch.randn(1,3,299,299), "inceptioni1.onnx")
```
This will create `inceptioni1.onnx`, which can be imported in MIGraphX using C++ or Python API.
### MIGraphX Python API
Follow these steps:
1. To import the MIGraphX module in Python script, set `PYTHONPATH` to the MIGraphX libraries installation. If binaries are installed using steps mentioned in [Option 1: Installing Binaries](#option-1-installing-binaries), perform the following action:
```bash
export PYTHONPATH=$PYTHONPATH:/opt/rocm/
```
2. The following script shows the usage of Python API to import the ONNX model, compile it, and run inference on it. Set `LD_LIBRARY_PATH` to `/opt/rocm/` if required.
```py
# import migraphx and numpy
import migraphx
import numpy as np
# import and parse inception model
model = migraphx.parse_onnx("inceptioni1.onnx")
# compile model for the GPU target
model.compile(migraphx.get_target("gpu"))
# optionally print compiled model
model.print()
# create random input image
input_image = np.random.rand(1, 3, 299, 299).astype('float32')
# feed image to model, 'x.1` is the input param name
results = model.run({'x.1': input_image})
# get the results back
result_np = np.array(results[0])
# print the inferred class of the input image
print(np.argmax(result_np))
```
Find additional examples of Python API in the `/examples` directory of the MIGraphX repository.
## MIGraphX C++ API
Follow these steps:
1. The following is a minimalist example that shows the usage of MIGraphX C++ API to load ONNX file, compile it for the GPU, and run inference on it. To use MIGraphX C++ API, you only need to load the `migraphx.hpp` file. This example runs inference on the Inception v3 model.
```c++
#include <vector>
#include <string>
#include <algorithm>
#include <ctime>
#include <random>
#include <migraphx/migraphx.hpp>
int main(int argc, char** argv)
{
migraphx::program prog;
migraphx::onnx_options onnx_opts;
// import and parse onnx file into migraphx::program
prog = parse_onnx("inceptioni1.onnx", onnx_opts);
// print imported model
prog.print();
migraphx::target targ = migraphx::target("gpu");
migraphx::compile_options comp_opts;
comp_opts.set_offload_copy();
// compile for the GPU
prog.compile(targ, comp_opts);
// print the compiled program
prog.print();
// randomly generate input image
// of shape (1, 3, 299, 299)
std::srand(unsigned(std::time(nullptr)));
std::vector<float> input_image(1*299*299*3);
std::generate(input_image.begin(), input_image.end(), std::rand);
// users need to provide data for the input
// parameters in order to run inference
// you can query into migraph program for the parameters
migraphx::program_parameters prog_params;
auto param_shapes = prog.get_parameter_shapes();
auto input = param_shapes.names().front();
// create argument for the parameter
prog_params.add(input, migraphx::argument(param_shapes[input], input_image.data()));
// run inference
auto outputs = prog.eval(prog_params);
// read back the output
float* results = reinterpret_cast<float*>(outputs[0].data());
float* max = std::max_element(results, results + 1000);
int answer = max - results;
std::cout << "answer: " << answer << std::endl;
}
```
2. To compile this program, you can use CMake and you only need to link the `migraphx::c` library to use MIGraphX's C++ API. The following is the `CMakeLists.txt` file that can build the earlier example:
```cmake
cmake_minimum_required(VERSION 3.5)
project (CAI)
set (CMAKE_CXX_STANDARD 14)
set (EXAMPLE inception_inference)
list (APPEND CMAKE_PREFIX_PATH /opt/rocm/hip /opt/rocm)
find_package (migraphx)
message("source file: " ${EXAMPLE}.cpp " ---> bin: " ${EXAMPLE})
add_executable(${EXAMPLE} ${EXAMPLE}.cpp)
target_link_libraries(${EXAMPLE} migraphx::c)
```
3. To build the executable file, run the following from the directory containing the `inception_inference.cpp` file:
```bash
mkdir build
cd build
cmake ..
make -j$(nproc)
./inception_inference
```
:::{note}
Set `LD_LIBRARY_PATH` to `/opt/rocm/lib` if required during the build. Additional examples can be found in the MIGraphX repository under the `/examples/` directory.
:::
## Tuning MIGraphX
MIGraphX uses MIOpen kernels to target AMD GPU. For the model compiled with MIGraphX, tune MIOpen to pick the best possible kernel implementation. The MIOpen tuning results in a significant performance boost. Tuning can be done by setting the environment variable `MIOPEN_FIND_ENFORCE=3`.
:::{note}
The tuning process can take a long time to finish.
:::
**Example:** The average inference time of the inception model example shown previously over 100 iterations using untuned kernels is 0.01383ms. After tuning, it reduces to 0.00459ms, which is a 3x improvement. This result is from ROCm v4.5 on a MI100 GPU.
:::{note}
The results may vary depending on the system configurations.
:::
For reference, the following code snippet shows inference runs for only the first 10 iterations for both tuned and untuned kernels:
```console
### UNTUNED ###
iterator : 0
Inference complete
Inference time: 0.063ms
iterator : 1
Inference complete
Inference time: 0.008ms
iterator : 2
Inference complete
Inference time: 0.007ms
iterator : 3
Inference complete
Inference time: 0.007ms
iterator : 4
Inference complete
Inference time: 0.007ms
iterator : 5
Inference complete
Inference time: 0.008ms
iterator : 6
Inference complete
Inference time: 0.007ms
iterator : 7
Inference complete
Inference time: 0.028ms
iterator : 8
Inference complete
Inference time: 0.029ms
iterator : 9
Inference complete
Inference time: 0.029ms
### TUNED ###
iterator : 0
Inference complete
Inference time: 0.063ms
iterator : 1
Inference complete
Inference time: 0.004ms
iterator : 2
Inference complete
Inference time: 0.004ms
iterator : 3
Inference complete
Inference time: 0.004ms
iterator : 4
Inference complete
Inference time: 0.004ms
iterator : 5
Inference complete
Inference time: 0.004ms
iterator : 6
Inference complete
Inference time: 0.004ms
iterator : 7
Inference complete
Inference time: 0.004ms
iterator : 8
Inference complete
Inference time: 0.004ms
iterator : 9
Inference complete
Inference time: 0.004ms
```
### YModel
The best inference performance through MIGraphX is conditioned upon having tuned kernel configurations stored in a `/home` local User Database (DB). If a user were to move their model to a different server or allow a different user to use it, they would have to run through the MIOpen tuning process again to populate the next User DB with the best kernel configurations and corresponding solvers.
Tuning is time consuming, and if the users have not performed tuning, they would see discrepancies between expected or claimed inference performance and actual inference performance. This has led to repetitive and time-consuming tuning tasks for each user.
MIGraphX introduces a feature, known as YModel, that stores the kernel config parameters found during tuning into a `.mxr` file. This ensures the same level of expected performance, even when a model is copied to a different user/system.
The YModel feature is available starting from ROCm 5.4.1 and UIF 1.1.
#### YModel example
Through the `migraphx-driver` functionality, you can generate `.mxr` files with tuning information stored inside it by passing additional `--binary --output model.mxr` to `migraphx-driver` along with the rest of the necessary flags.
For example, to generate `.mxr` file from the ONNX model, use the following:
```bash
./path/to/migraphx-driver compile --onnx resnet50.onnx --enable-offload-copy --binary --output resnet50.mxr
```
To run generated `.mxr` files through `migraphx-driver`, use the following:
```bash
./path/to/migraphx-driver run --migraphx resnet50.mxr --enable-offload-copy
```
Alternatively, you can use the MIGraphX C++ or Python API to generate `.mxr` files.
![Generating an MXR file](../data/conceptual/image018.png "Generating an MXR file")

View File

@@ -64,7 +64,6 @@ ROCm documentation is organized into the following categories:
* [Using CMake](./conceptual/cmake-packages.rst)
* [ROCm & PCIe atomics](./conceptual/More-about-how-ROCm-uses-PCIe-Atomics.rst)
* [Inception v3 with PyTorch](./conceptual/ai-pytorch-inception.md)
* [Inference optimization with MIGraphX](./conceptual/ai-migraphx-optimization.md)
:::
<!-- markdownlint-disable MD051 -->

View File

@@ -158,8 +158,6 @@ subtrees:
title: ROCm & PCIe atomics
- file: conceptual/ai-pytorch-inception.md
title: Inception v3 with PyTorch
- file: conceptual/ai-migraphx-optimization.md
title: Inference optimization with MIGraphX
- caption: Reference
entries: