mirror of
https://github.com/ROCm/ROCm.git
synced 2026-01-06 21:33:57 -05:00
* Fix the skipping of origami tests * Update dependencies for origami refactor * test * Unsupress test output. * Ctest implementation * Test ctest * Test ctest 2 * Add pip install test * Fix python version * Add python dep * test * test 2 * Debug for readme * Fix pip install * Fix pip install 2 * Clean up * Run tests on 950 * Replace 950 with 1201 * 1101 * Add more archs * Add more archs 2 * Comment out archs * Move pip install script to ./azuredevops/scripts * Fix path * Fix path 2 * Fix path 3 * Fix path 4 * Remove pip install testing: * Use inline script * Add old deps
309 lines
12 KiB
YAML
309 lines
12 KiB
YAML
parameters:
|
|
- name: componentName
|
|
type: string
|
|
default: origami
|
|
- name: checkoutRepo
|
|
type: string
|
|
default: 'self'
|
|
- name: checkoutRef
|
|
type: string
|
|
default: ''
|
|
# monorepo related parameters
|
|
- name: sparseCheckoutDir
|
|
type: string
|
|
default: ''
|
|
- name: triggerDownstreamJobs
|
|
type: boolean
|
|
default: false
|
|
- name: downstreamAggregateNames
|
|
type: string
|
|
default: ''
|
|
- name: buildDependsOn
|
|
type: object
|
|
default: null
|
|
- name: unifiedBuild
|
|
type: boolean
|
|
default: false
|
|
# set to true if doing full build of ROCm stack
|
|
# and dependencies are pulled from same pipeline
|
|
- name: aggregatePipeline
|
|
type: boolean
|
|
default: false
|
|
- name: aptPackages
|
|
type: object
|
|
default:
|
|
- cmake
|
|
- git
|
|
- ninja-build
|
|
- wget
|
|
- python3
|
|
- python3-dev
|
|
- python3-pip
|
|
- python3-venv
|
|
- libgtest-dev
|
|
- libboost-filesystem-dev
|
|
- libboost-program-options-dev
|
|
- name: pipModules
|
|
type: object
|
|
default:
|
|
- nanobind>=2.0.0
|
|
- pytest
|
|
- pytest-cov
|
|
- name: rocmDependencies
|
|
type: object
|
|
default:
|
|
- clr
|
|
- llvm-project
|
|
- rocm-cmake
|
|
- rocminfo
|
|
- ROCR-Runtime
|
|
- rocprofiler-register
|
|
- name: rocmTestDependencies
|
|
type: object
|
|
default:
|
|
- clr
|
|
- llvm-project
|
|
- rocm-cmake
|
|
- rocminfo
|
|
- ROCR-Runtime
|
|
- rocprofiler-register
|
|
|
|
- name: jobMatrix
|
|
type: object
|
|
default:
|
|
buildJobs:
|
|
- { os: ubuntu2204, packageManager: apt }
|
|
- { os: almalinux8, packageManager: dnf }
|
|
testJobs:
|
|
- { os: ubuntu2204, packageManager: apt, target: gfx90a }
|
|
# - { os: ubuntu2204, packageManager: apt, target: gfx1100 }
|
|
# - { os: ubuntu2204, packageManager: apt, target: gfx1151 }
|
|
# - { os: ubuntu2204, packageManager: apt, target: gfx1201 }
|
|
- name: downstreamComponentMatrix
|
|
type: object
|
|
default:
|
|
- hipBLASLt:
|
|
name: hipBLASLt
|
|
sparseCheckoutDir: projects/hipblaslt
|
|
skipUnifiedBuild: 'false'
|
|
buildDependsOn:
|
|
- origami_build
|
|
|
|
jobs:
|
|
- ${{ each job in parameters.jobMatrix.buildJobs }}:
|
|
- job: origami_build_${{ job.os }}
|
|
${{ if parameters.buildDependsOn }}:
|
|
dependsOn:
|
|
- ${{ each build in parameters.buildDependsOn }}:
|
|
- ${{ build }}_${{ job.os }}
|
|
variables:
|
|
- group: common
|
|
- template: /.azuredevops/variables-global.yml
|
|
- name: ROCM_PATH
|
|
value: $(Agent.BuildDirectory)/rocm
|
|
pool:
|
|
vmImage: ${{ variables.BASE_BUILD_POOL }}
|
|
${{ if eq(job.os, 'almalinux8') }}:
|
|
container:
|
|
image: rocmexternalcicd.azurecr.io/manylinux228:latest
|
|
endpoint: ContainerService3
|
|
workspace:
|
|
clean: all
|
|
steps:
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
|
parameters:
|
|
aptPackages: ${{ parameters.aptPackages }}
|
|
pipModules: ${{ parameters.pipModules }}
|
|
packageManager: ${{ job.packageManager }}
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-cmake-custom.yml
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-vendor.yml
|
|
parameters:
|
|
dependencyList:
|
|
- gtest
|
|
- ${{ if ne(job.os, 'almalinux8') }}:
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-vendor.yml
|
|
parameters:
|
|
dependencyList:
|
|
- catch2
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
|
parameters:
|
|
checkoutRepo: ${{ parameters.checkoutRepo }}
|
|
sparseCheckoutDir: ${{ parameters.sparseCheckoutDir }}
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-rocm.yml
|
|
parameters:
|
|
checkoutRef: ${{ parameters.checkoutRef }}
|
|
dependencyList: ${{ parameters.rocmDependencies }}
|
|
os: ${{ job.os }}
|
|
aggregatePipeline: ${{ parameters.aggregatePipeline }}
|
|
${{ if parameters.triggerDownstreamJobs }}:
|
|
downstreamAggregateNames: ${{ parameters.downstreamAggregateNames }}
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/build-cmake.yml
|
|
parameters:
|
|
os: ${{ job.os }}
|
|
extraBuildFlags: >-
|
|
-DCMAKE_PREFIX_PATH=$(Agent.BuildDirectory)/rocm;$(Agent.BuildDirectory)/vendor
|
|
-DCMAKE_CXX_COMPILER=$(Agent.BuildDirectory)/rocm/llvm/bin/amdclang++
|
|
-DORIGAMI_BUILD_SHARED_LIBS=ON
|
|
-DORIGAMI_ENABLE_PYTHON=ON
|
|
-DORIGAMI_BUILD_TESTING=ON
|
|
-DORIGAMI_ENABLE_FETCH=ON
|
|
-GNinja
|
|
- ${{ if ne(job.os, 'almalinux8') }}:
|
|
- task: PublishPipelineArtifact@1
|
|
displayName: 'Publish Build Directory Artifact'
|
|
inputs:
|
|
targetPath: '$(Agent.BuildDirectory)/s/build'
|
|
artifact: '${{ parameters.componentName }}_${{ job.os }}_build_dir'
|
|
publishLocation: 'pipeline'
|
|
- task: PublishPipelineArtifact@1
|
|
displayName: 'Publish Python Source Artifact'
|
|
inputs:
|
|
targetPath: '$(Agent.BuildDirectory)/s/python'
|
|
artifact: '${{ parameters.componentName }}_${{ job.os }}_python_src'
|
|
publishLocation: 'pipeline'
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/manifest.yml
|
|
parameters:
|
|
componentName: ${{ parameters.componentName }}
|
|
sparseCheckoutDir: ${{ parameters.sparseCheckoutDir }}
|
|
os: ${{ job.os }}
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/artifact-upload.yml
|
|
parameters:
|
|
os: ${{ job.os }}
|
|
componentName: ${{ parameters.componentName }}
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/artifact-links.yml
|
|
|
|
- ${{ if eq(parameters.unifiedBuild, False) }}:
|
|
- ${{ each job in parameters.jobMatrix.testJobs }}:
|
|
- job: origami_test_${{ job.os }}_${{ job.target }}
|
|
timeoutInMinutes: 120
|
|
dependsOn: origami_build_${{ job.os }}
|
|
condition:
|
|
and(succeeded(),
|
|
not(containsValue(split(variables['DISABLED_${{ upper(job.target) }}_TESTS'], ','), '${{ parameters.componentName }}')),
|
|
eq(${{ parameters.aggregatePipeline }}, False)
|
|
)
|
|
variables:
|
|
- group: common
|
|
- template: /.azuredevops/variables-global.yml
|
|
pool: ${{ job.target }}_test_pool
|
|
workspace:
|
|
clean: all
|
|
steps:
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
|
parameters:
|
|
aptPackages: ${{ parameters.aptPackages }}
|
|
pipModules: ${{ parameters.pipModules }}
|
|
packageManager: ${{ job.packageManager }}
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-cmake-custom.yml
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/preamble.yml
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
|
parameters:
|
|
checkoutRepo: ${{ parameters.checkoutRepo }}
|
|
sparseCheckoutDir: ${{ parameters.sparseCheckoutDir }}
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-vendor.yml
|
|
parameters:
|
|
dependencyList:
|
|
- gtest
|
|
- ${{ if ne(job.os, 'almalinux8') }}:
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-vendor.yml
|
|
parameters:
|
|
dependencyList:
|
|
- catch2
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/local-artifact-download.yml
|
|
parameters:
|
|
preTargetFilter: ${{ parameters.componentName }}
|
|
os: ${{ job.os }}
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-rocm.yml
|
|
parameters:
|
|
checkoutRef: ${{ parameters.checkoutRef }}
|
|
dependencyList: ${{ parameters.rocmTestDependencies }}
|
|
os: ${{ job.os }}
|
|
gpuTarget: ${{ job.target }}
|
|
${{ if parameters.triggerDownstreamJobs }}:
|
|
downstreamAggregateNames: ${{ parameters.downstreamAggregateNames }}
|
|
- task: CMake@1
|
|
displayName: 'Origami Test CMake Configuration'
|
|
inputs:
|
|
cmakeArgs: >-
|
|
-DCMAKE_PREFIX_PATH=$(Agent.BuildDirectory)/rocm;$(Agent.BuildDirectory)/vendor
|
|
-DCMAKE_CXX_COMPILER=$(Agent.BuildDirectory)/rocm/llvm/bin/amdclang++
|
|
-DORIGAMI_BUILD_SHARED_LIBS=ON
|
|
-DORIGAMI_ENABLE_PYTHON=ON
|
|
-DORIGAMI_BUILD_TESTING=ON
|
|
-GNinja
|
|
$(Agent.BuildDirectory)/s
|
|
- task: Bash@3
|
|
displayName: 'Build Origami Tests and Python Bindings'
|
|
inputs:
|
|
targetType: inline
|
|
workingDirectory: build
|
|
script: |
|
|
cmake --build . --target origami-tests origami_python -- -j$(nproc)
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/gpu-diagnostics.yml
|
|
# Run tests using CTest (discovers and runs both C++ and Python tests)
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/test.yml
|
|
parameters:
|
|
componentName: ${{ parameters.componentName }}
|
|
os: ${{ job.os }}
|
|
testDir: 'build'
|
|
testParameters: '--output-on-failure --force-new-ctest-process --output-junit test_output.xml'
|
|
# Test pip install workflow
|
|
# - task: Bash@3
|
|
# displayName: 'Test Pip Install'
|
|
# inputs:
|
|
# targetType: inline
|
|
# script: |
|
|
# set -e
|
|
|
|
# echo "==================================================================="
|
|
# echo "Testing pip install workflow (pip install -e .)"
|
|
# echo "==================================================================="
|
|
|
|
# # Set environment variables for pip install CMake build
|
|
# export ROCM_PATH=$(Agent.BuildDirectory)/rocm
|
|
# export CMAKE_PREFIX_PATH=$(Agent.BuildDirectory)/rocm:$(Agent.BuildDirectory)/vendor
|
|
# export CMAKE_CXX_COMPILER=$(Agent.BuildDirectory)/rocm/llvm/bin/amdclang++
|
|
|
|
# echo "ROCM_PATH: $ROCM_PATH"
|
|
# echo "CMAKE_PREFIX_PATH: $CMAKE_PREFIX_PATH"
|
|
# echo "CMAKE_CXX_COMPILER: $CMAKE_CXX_COMPILER"
|
|
# echo ""
|
|
|
|
# # Install from source directory
|
|
# cd "$(Agent.BuildDirectory)/s/python"
|
|
# pip install -e .
|
|
|
|
# # Verify import works
|
|
# echo ""
|
|
# echo "Verifying origami can be imported..."
|
|
# python3 -c "import origami; print('✓ Successfully imported origami')"
|
|
|
|
# # Run pytest on installed package
|
|
# echo ""
|
|
# echo "Running pytest tests..."
|
|
# python3 -m pytest tests/ -v -m "not slow" --tb=short
|
|
|
|
# echo ""
|
|
# echo "==================================================================="
|
|
# echo "Pip install test completed successfully"
|
|
# echo "==================================================================="
|
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/docker-container.yml
|
|
parameters:
|
|
aptPackages: ${{ parameters.aptPackages }}
|
|
pipModules: ${{ parameters.pipModules }}
|
|
environment: test
|
|
gpuTarget: ${{ job.target }}
|
|
|
|
- ${{ if parameters.triggerDownstreamJobs }}:
|
|
- ${{ each component in parameters.downstreamComponentMatrix }}:
|
|
- ${{ if not(and(parameters.unifiedBuild, eq(component.skipUnifiedBuild, 'true'))) }}:
|
|
- template: /.azuredevops/components/${{ component.name }}.yml@pipelines_repo
|
|
parameters:
|
|
checkoutRepo: ${{ parameters.checkoutRepo }}
|
|
sparseCheckoutDir: ${{ component.sparseCheckoutDir }}
|
|
buildDependsOn: ${{ component.buildDependsOn }}
|
|
downstreamAggregateNames: ${{ parameters.downstreamAggregateNames }}+${{ parameters.componentName }}
|
|
triggerDownstreamJobs: true
|
|
unifiedBuild: ${{ parameters.unifiedBuild }}
|