Unpack LLVM Distribution, and setup lit to run tests for specific test suite#1149
Unpack LLVM Distribution, and setup lit to run tests for specific test suite#1149bob80905 wants to merge 19 commits into
Conversation
|
As discussed offline, I do not think this is the correct approach. The CMakeCache file is very specific to the machine and is not portable to other machines. Simply patching the CMakeCache file is not a robust solution. Instead, I think the better approach is to define an LLVM distribution that builds and installs the offloader, clang, and other dependencies into a self-contained and portable package. This package can then be distributed and ran on other machines without any additional building required. Similarly for the offload tests, an install target can be defined that copies over all the lit tests into its own install prefix (which may or may not be the same as the install prefix for the LLVM distribution). The main issue to solve would be getting lit to find all the dependencies required to run the tests. A solution for this would be to include a Python script that scans for the required dependencies and uses the information to generate a lit.site.cfg.py to satisfy the requirements for running lit tests. |
| cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images -DHLSL_ENABLE_OFFLOAD_DISTRIBUTION=${{ inputs.SplitBuild == true && 'On' || 'Off' }} -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install ${{ github.workspace }}/llvm-project/llvm/ | ||
| ninja hlsl-test-depends | ||
| - name: Dump GPU Info | ||
| - name: Dump GPU Info (build runner) |
There was a problem hiding this comment.
Note, though it doesn't seem to make sense long term to have a dump gpu info step on the build runner machine, it does make sense to have it short term, since PRs will continue to run with splitbuild disabled while I test and validate that everything is working correctly.
| "d3d12": (True, False, False, False, False, "DXC-compiled shaders on DirectX 12"), | ||
| "vk": (False, True, False, False, False, "DXC-compiled shaders on Vulkan"), | ||
| "mtl": (False, False, True, False, False, "DXC-compiled shaders on Metal"), | ||
| "clang-d3d12": ( |
There was a problem hiding this comment.
This looks different because darker formatted it like this.
| mkdir build | ||
| cd build | ||
| cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images ${{ github.workspace }}/llvm-project/llvm/ | ||
| cmake -G Ninja ${{ inputs.LLVM-ExtraCMakeArgs }} -DCMAKE_BUILD_TYPE=${{ inputs.BuildType }} -DLLVM_ENABLE_ASSERTIONS=On -C ${{ github.workspace }}/llvm-project/clang/cmake/caches/HLSL.cmake -C ${{ github.workspace }}/OffloadTest/cmake/caches/sccache.cmake -DDXC_DIR=${{ github.workspace }}/DXC/build/bin -DLLVM_EXTERNAL_OFFLOADTEST_SOURCE_DIR=${{ github.workspace }}/OffloadTest -DLLVM_EXTERNAL_PROJECTS="OffloadTest" -DLLVM_LIT_ARGS="--xunit-xml-output=testresults.xunit.xml -v" -DOFFLOADTEST_TEST_CLANG=${{steps.Test-Clang.outputs.TEST_CLANG || 'Off' }} -DGOLDENIMAGE_DIR=${{ github.workspace }}/golden-images -DHLSL_ENABLE_OFFLOAD_DISTRIBUTION=${{ inputs.SplitBuild == true && 'On' || 'Off' }} -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install ${{ github.workspace }}/llvm-project/llvm/ |
There was a problem hiding this comment.
Note to reviewers: HLSL_ENABLE_OFFLOAD_DISTRIBUTION is introduced in PR llvm/llvm-project#196640
…parate artifact for DXC, addressing Deric
This PR adds a new distribution to the HLSL cmake file. The purpose is so that we can portably distribute binaries to other machines so that offload testing can be optimized. Assisted by: Github Copilot This PR was inspired by @Icohedron 's comment here: llvm/offload-test-suite#1149 (comment) This addresses llvm/offload-test-suite#1150
This PR adds a new distribution to the HLSL cmake file. The purpose is so that we can portably distribute binaries to other machines so that offload testing can be optimized. Assisted by: Github Copilot This PR was inspired by @Icohedron 's comment here: llvm/offload-test-suite#1149 (comment) This addresses llvm/offload-test-suite#1150
This PR adds a new distribution to the HLSL cmake file. The purpose is so that we can portably distribute binaries to other machines so that offload testing can be optimized. Assisted by: Github Copilot This PR was inspired by @Icohedron 's comment here: llvm/offload-test-suite#1149 (comment) This addresses llvm/offload-test-suite#1150
This PR adds a new distribution to the HLSL cmake file. The purpose is so that we can portably distribute binaries to other machines so that offload testing can be optimized. Assisted by: Github Copilot This PR was inspired by @Icohedron 's comment here: llvm/offload-test-suite#1149 (comment) This addresses llvm/offload-test-suite#1150
This PR adds a new distribution to the HLSL cmake file. The purpose is so that we can portably distribute binaries to other machines so that offload testing can be optimized. Assisted by: Github Copilot This PR was inspired by @Icohedron 's comment here: llvm/offload-test-suite#1149 (comment) This addresses llvm/offload-test-suite#1150
We are still encountering errors when configuring cmake with ninja, as ninja cannot be found:
https://github.com/llvm/offload-test-suite/actions/runs/25338698984/job/74291993540#step:13:155
Though the path is correct on the build machine's environment, it no longer holds in the test machine's (a different machine's) environment.
@Icohedron recommended a completely different approach, which involves installing an llvm distribution to the test machine. This avoids needing to replace exe paths in CMakeCache.txt files, and avoids dealing with CMake entirely.
This PR sets up the infrastructure for installing the LLVM offload distribution (with all relevant files) without needing ninja or cmake, and just running lit tests on the appropriate suite.
Assisted by Github Copilot.
Fixes #1150