mirror of
https://github.com/ROCm/ROCm.git
synced 2026-01-06 21:33:57 -05:00
[origami] Test update (#5768)
* 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
This commit is contained in:
@@ -39,6 +39,7 @@ parameters:
|
|||||||
- python3
|
- python3
|
||||||
- python3-dev
|
- python3-dev
|
||||||
- python3-pip
|
- python3-pip
|
||||||
|
- python3-venv
|
||||||
- libgtest-dev
|
- libgtest-dev
|
||||||
- libboost-filesystem-dev
|
- libboost-filesystem-dev
|
||||||
- libboost-program-options-dev
|
- libboost-program-options-dev
|
||||||
@@ -46,6 +47,8 @@ parameters:
|
|||||||
type: object
|
type: object
|
||||||
default:
|
default:
|
||||||
- nanobind>=2.0.0
|
- nanobind>=2.0.0
|
||||||
|
- pytest
|
||||||
|
- pytest-cov
|
||||||
- name: rocmDependencies
|
- name: rocmDependencies
|
||||||
type: object
|
type: object
|
||||||
default:
|
default:
|
||||||
@@ -72,8 +75,10 @@ parameters:
|
|||||||
- { os: ubuntu2204, packageManager: apt }
|
- { os: ubuntu2204, packageManager: apt }
|
||||||
- { os: almalinux8, packageManager: dnf }
|
- { os: almalinux8, packageManager: dnf }
|
||||||
testJobs:
|
testJobs:
|
||||||
- { os: ubuntu2204, packageManager: apt, target: gfx942 }
|
|
||||||
- { os: ubuntu2204, packageManager: apt, target: gfx90a }
|
- { 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
|
- name: downstreamComponentMatrix
|
||||||
type: object
|
type: object
|
||||||
default:
|
default:
|
||||||
@@ -116,6 +121,11 @@ jobs:
|
|||||||
parameters:
|
parameters:
|
||||||
dependencyList:
|
dependencyList:
|
||||||
- gtest
|
- 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
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
||||||
parameters:
|
parameters:
|
||||||
checkoutRepo: ${{ parameters.checkoutRepo }}
|
checkoutRepo: ${{ parameters.checkoutRepo }}
|
||||||
@@ -137,6 +147,7 @@ jobs:
|
|||||||
-DORIGAMI_BUILD_SHARED_LIBS=ON
|
-DORIGAMI_BUILD_SHARED_LIBS=ON
|
||||||
-DORIGAMI_ENABLE_PYTHON=ON
|
-DORIGAMI_ENABLE_PYTHON=ON
|
||||||
-DORIGAMI_BUILD_TESTING=ON
|
-DORIGAMI_BUILD_TESTING=ON
|
||||||
|
-DORIGAMI_ENABLE_FETCH=ON
|
||||||
-GNinja
|
-GNinja
|
||||||
- ${{ if ne(job.os, 'almalinux8') }}:
|
- ${{ if ne(job.os, 'almalinux8') }}:
|
||||||
- task: PublishPipelineArtifact@1
|
- task: PublishPipelineArtifact@1
|
||||||
@@ -169,7 +180,6 @@ jobs:
|
|||||||
dependsOn: origami_build_${{ job.os }}
|
dependsOn: origami_build_${{ job.os }}
|
||||||
condition:
|
condition:
|
||||||
and(succeeded(),
|
and(succeeded(),
|
||||||
eq(variables['ENABLE_${{ upper(job.target) }}_TESTS'], 'true'),
|
|
||||||
not(containsValue(split(variables['DISABLED_${{ upper(job.target) }}_TESTS'], ','), '${{ parameters.componentName }}')),
|
not(containsValue(split(variables['DISABLED_${{ upper(job.target) }}_TESTS'], ','), '${{ parameters.componentName }}')),
|
||||||
eq(${{ parameters.aggregatePipeline }}, False)
|
eq(${{ parameters.aggregatePipeline }}, False)
|
||||||
)
|
)
|
||||||
@@ -180,30 +190,30 @@ jobs:
|
|||||||
workspace:
|
workspace:
|
||||||
clean: all
|
clean: all
|
||||||
steps:
|
steps:
|
||||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/checkout.yml
|
|
||||||
parameters:
|
|
||||||
checkoutRepo: ${{ parameters.checkoutRepo }}
|
|
||||||
sparseCheckoutDir: ${{ parameters.sparseCheckoutDir }}
|
|
||||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-other.yml
|
||||||
parameters:
|
parameters:
|
||||||
aptPackages: ${{ parameters.aptPackages }}
|
aptPackages: ${{ parameters.aptPackages }}
|
||||||
pipModules: ${{ parameters.pipModules }}
|
pipModules: ${{ parameters.pipModules }}
|
||||||
packageManager: ${{ job.packageManager }}
|
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/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
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/local-artifact-download.yml
|
||||||
parameters:
|
parameters:
|
||||||
preTargetFilter: ${{ parameters.componentName }}
|
preTargetFilter: ${{ parameters.componentName }}
|
||||||
os: ${{ job.os }}
|
os: ${{ job.os }}
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
displayName: 'Download Build Directory Artifact'
|
|
||||||
inputs:
|
|
||||||
artifact: '${{ parameters.componentName }}_${{ job.os }}_build_dir'
|
|
||||||
path: '$(Agent.BuildDirectory)/s/build'
|
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
displayName: 'Download Python Source Artifact'
|
|
||||||
inputs:
|
|
||||||
artifact: '${{ parameters.componentName }}_${{ job.os }}_python_src'
|
|
||||||
path: '$(Agent.BuildDirectory)/s/python'
|
|
||||||
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-rocm.yml
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/dependencies-rocm.yml
|
||||||
parameters:
|
parameters:
|
||||||
checkoutRef: ${{ parameters.checkoutRef }}
|
checkoutRef: ${{ parameters.checkoutRef }}
|
||||||
@@ -212,25 +222,72 @@ jobs:
|
|||||||
gpuTarget: ${{ job.target }}
|
gpuTarget: ${{ job.target }}
|
||||||
${{ if parameters.triggerDownstreamJobs }}:
|
${{ if parameters.triggerDownstreamJobs }}:
|
||||||
downstreamAggregateNames: ${{ parameters.downstreamAggregateNames }}
|
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
|
- 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
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/test.yml
|
||||||
parameters:
|
parameters:
|
||||||
componentName: ${{ parameters.componentName }}
|
componentName: ${{ parameters.componentName }}
|
||||||
os: ${{ job.os }}
|
os: ${{ job.os }}
|
||||||
testDir: '$(Agent.BuildDirectory)/rocm/bin'
|
testDir: 'build'
|
||||||
testExecutable: './origami-tests'
|
testParameters: '--output-on-failure --force-new-ctest-process --output-junit test_output.xml'
|
||||||
testParameters: '--yaml origami-tests.yaml --gtest_output=xml:./test_output.xml --gtest_color=yes'
|
# Test pip install workflow
|
||||||
- script: |
|
# - task: Bash@3
|
||||||
set -e
|
# displayName: 'Test Pip Install'
|
||||||
export PYTHONPATH=$(Agent.BuildDirectory)/s/build/python:$PYTHONPATH
|
# inputs:
|
||||||
|
# targetType: inline
|
||||||
echo "--- Running origami_test.py ---"
|
# script: |
|
||||||
python3 $(Agent.BuildDirectory)/s/python/origami_test.py
|
# set -e
|
||||||
|
|
||||||
echo "--- Running origami_grid_test.py ---"
|
# echo "==================================================================="
|
||||||
python3 $(Agent.BuildDirectory)/s/python/origami_grid_test.py
|
# echo "Testing pip install workflow (pip install -e .)"
|
||||||
displayName: 'Run Python Binding Tests'
|
# echo "==================================================================="
|
||||||
condition: succeeded()
|
|
||||||
|
# # 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
|
- template: ${{ variables.CI_TEMPLATE_PATH }}/steps/docker-container.yml
|
||||||
parameters:
|
parameters:
|
||||||
aptPackages: ${{ parameters.aptPackages }}
|
aptPackages: ${{ parameters.aptPackages }}
|
||||||
|
|||||||
Reference in New Issue
Block a user