Skip to content

Commit

Permalink
Add llvmMoved GPU test (chapel-lang#22318)
Browse files Browse the repository at this point in the history
Somewhat in response to comments on
<chapel-lang#22085>.

I think it would be good if we had some kind of alert whenever LLVM
updates to ensure that we update GPU support in kind. This test hard
codes the version of LLVM we expect to use for our nightly tests and if
we run it on a job with a newer LLVM it will fail.

The test includes a checklist of things to consider regarding GPU
support and an LLVM update and gives instructions on how to update.

[Reviewed by @e-kayrakli]
  • Loading branch information
stonea authored Oct 24, 2023
2 parents 47622e1 + 82a0325 commit 2875526
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
69 changes: 69 additions & 0 deletions test/gpu/native/llvmMoved.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*
/!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\
/!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\
ATTENTION:
If this test fails it means we're running a new version of LLVM. Before
updating the test so it no longer fails, use the following checklist to
see if there are other changes we need to make.
If you don't want to address all these items yourself, create a GH issue
about addressing them and assign that to someone who's familiar with GPU
support and who will follow through on it.
/!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\
/!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\ /!\
CHECKLIST:
- [ ] In the technote search for any mentions of the previous version of
LLVM and replace them with the newer version.
- [ ] Check to see what version of CUDA and ROCm this version of LLVM
supports for its NVPTX and AMDGPU backend. If (compared to our
prior supported version) things have changed. Determine if we want to
have Chapel support this newer version of CUDA/ROCm. If so then:
- [ ] Make sure we have nightly testing set up to work with this newer
version.
- [ ] Look at util/chplenv/chpl_gpu.py, in here we have code that
checks to see if you're using a compatible version of CUDA/ROCm
(as of writing this comment this is in the
`_validate_cuda_version_impl` and `_validate_rocm_version_impl`
functions). Update this code.
- [ ] Check to see if there are any mentions of these version
requirements in the tech note and update as needed.
- [ ] Check public issue #22085, we believe this should be resolved
once LLVM adds support for CUDA 12. If LLVM has added support for
CUDA 12 and it's resolved remove this checklist item. If LLVM
added support for CUDA 12 and it's not resolved reopen the issue
so we can discuss what to do next.
- [ ] Take a moment to think if there are other items that should belong on
this checklist and add them if appropriate.
- [ ] Update the EXPECTED_LLVM_VERSION constant so this test no longer
fails.
*/

//-----------------------------------------------------------------------------

// After addressing the checklist items (or creating a GH issue to do so)
// modify the following const so that this test no longer fails.
const EXPECTED_LLVM_VERSION = 15;

//-----------------------------------------------------------------------------

config const actualLlvmVersion : int; // Passed in by .execopts

if actualLlvmVersion > EXPECTED_LLVM_VERSION {
writef("For GPU support, Chapel officially supports using LLVM %s but " +
"found version %s, so this test has failed. ",
EXPECTED_LLVM_VERSION, actualLlvmVersion);
writef("Look at this test and its included checklist to see how to update" +
"GPU support for a newer version of LLVM.");
}
3 changes: 3 additions & 0 deletions test/gpu/native/llvmMoved.execopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
LLVM_VERSION=`${CHPL_HOME}/util/printchplenv --all --simple | grep CHPL_LLVM_VERSION | cut -d = -f 2-`
echo --actualLlvmVersion=$LLVM_VERSION
1 change: 1 addition & 0 deletions test/gpu/native/llvmMoved.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
warning: The prototype GPU support implies --no-checks. This may impact debuggability. To suppress this warning, compile with --no-checks explicitly
4 changes: 4 additions & 0 deletions third-party/llvm/README
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,7 @@ follows, assuming CWD is $CHPL_HOME/third-party/llvm/:
16. update this README file
17. commit the docs and chplenv changes
18. PR, test, merge, etc.

Updating LLVM versions may also have impacts on GPU support. See the test
$CHPL_HOME/test/gpu/native/llvmMoved.chpl for a description of these
impacts.

0 comments on commit 2875526

Please sign in to comment.