From b287372be512e55eea3aa80c15dde7d81539416a Mon Sep 17 00:00:00 2001 From: Ibrahim Wani <113864060+ibrahimw1@users.noreply.github.com> Date: Tue, 16 Dec 2025 15:37:41 -0700 Subject: [PATCH] [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 --- .azuredevops/components/origami.yml | 117 +++++++++++++++++++++------- 1 file changed, 87 insertions(+), 30 deletions(-) diff --git a/.azuredevops/components/origami.yml b/.azuredevops/components/origami.yml index f0f4c7475..36a47c9ea 100644 --- a/.azuredevops/components/origami.yml +++ b/.azuredevops/components/origami.yml @@ -39,6 +39,7 @@ parameters: - python3 - python3-dev - python3-pip + - python3-venv - libgtest-dev - libboost-filesystem-dev - libboost-program-options-dev @@ -46,6 +47,8 @@ parameters: type: object default: - nanobind>=2.0.0 + - pytest + - pytest-cov - name: rocmDependencies type: object default: @@ -72,8 +75,10 @@ parameters: - { os: ubuntu2204, packageManager: apt } - { os: almalinux8, packageManager: dnf } testJobs: - - { os: ubuntu2204, packageManager: apt, target: gfx942 } - { 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: @@ -116,6 +121,11 @@ jobs: 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 }} @@ -137,6 +147,7 @@ jobs: -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 @@ -169,7 +180,6 @@ jobs: dependsOn: origami_build_${{ job.os }} condition: and(succeeded(), - eq(variables['ENABLE_${{ upper(job.target) }}_TESTS'], 'true'), not(containsValue(split(variables['DISABLED_${{ upper(job.target) }}_TESTS'], ','), '${{ parameters.componentName }}')), eq(${{ parameters.aggregatePipeline }}, False) ) @@ -180,30 +190,30 @@ jobs: workspace: clean: all 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 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 }} - - 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 parameters: checkoutRef: ${{ parameters.checkoutRef }} @@ -212,25 +222,72 @@ jobs: 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: '$(Agent.BuildDirectory)/rocm/bin' - testExecutable: './origami-tests' - testParameters: '--yaml origami-tests.yaml --gtest_output=xml:./test_output.xml --gtest_color=yes' - - script: | - set -e - export PYTHONPATH=$(Agent.BuildDirectory)/s/build/python:$PYTHONPATH - - echo "--- Running origami_test.py ---" - python3 $(Agent.BuildDirectory)/s/python/origami_test.py - - echo "--- Running origami_grid_test.py ---" - python3 $(Agent.BuildDirectory)/s/python/origami_grid_test.py - displayName: 'Run Python Binding Tests' - condition: succeeded() + 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 }}