Skip to content

Add build scripts for CUDA testing on gpuCI - #7499

Merged
sklam merged 11 commits into
numba:masterfrom
charlesbluca:gpuci-build-scripts
Oct 28, 2021
Merged

sklam merged 11 commits into
numba:masterfrom
charlesbluca:gpuci-build-scripts

Conversation

@charlesbluca

Copy link
Copy Markdown
Contributor

This PR adds the relevant build scripts to run Numba's CUDA tests on gpuCI for pull requests. Some key things to note:

  • gpuCI tests will not be run by default on PRs; instead they are triggered with a phrase commented on the PR by the following gpuCI admins for this repo:
gmarkall
testhound
stuartarchibald
sklam
esc
charlesbluca
quasiben
  • currently the phrase we're considering is gpuci run tests, happy to discuss that more in this issue though

  • tests will be ran with Python 3.8 and CUDA toolkit 9.2, 10.0, 10.2, 11.0, 11.2, and 11.4; this can be changed by modifying the axis.yaml added by this PR accordingly

  • tests are ran in the gpuci/rapidsai docker container, with a separate environment being created with Numba's build requirements; in the future, we should be able to move to custom Numba images with all requirements preinstalled if timing is an issue (note that this is why we specify a RAPIDS_VER and CUDA_VER in axis.yaml, even though these go unused for the testing)

  • currently Numba does not support outputting these test results in JUnit XML format (to my knowledge); if this functionality is added, we can modify these scripts so that the results of each individual gpuCI job (i.e. cudatoolkit=9.2, 10.0, etc.) are posted to the triggering PR

Once this PR is merged in, we can do the internal work to target gpuCI to this repo, and verify that things are working properly with a follow-up test PR; for an example of the tests in action, view charlesbluca#1

Reference an existing issue

This is a second attempt at #5123.

charlesbluca and others added 6 commits October 18, 2021 10:38
Co-authored-by: Graham Markall <535640+gmarkall@users.noreply.github.com>
Co-authored-by: Graham Markall <535640+gmarkall@users.noreply.github.com>
@gmarkall gmarkall added 3 - Ready for Review Effort - medium Medium size effort needed and removed 2 - In Progress labels Oct 21, 2021
@gmarkall

Copy link
Copy Markdown
Member

I've added some docs that explain how we can trigger the CI. At this point I think the PR / setup is ready for discussion with @esc @stuartarchibald @sklam.

@gmarkall

Copy link
Copy Markdown
Member

gpuci run tests

@esc

esc commented Oct 27, 2021

Copy link
Copy Markdown
Member

We are currently stuck on getting GPUCI to report it's status back to Github.

@gmarkall

Copy link
Copy Markdown
Member

I've got it to report manually using a token I generated myself with the repo:status scope only - I'll see if I can add this to the gpuCI config, and then there should be no further action needed on the Numba repo side.

@gmarkall

Copy link
Copy Markdown
Member

gpuci rerun tests

@gmarkall

Copy link
Copy Markdown
Member

gpuci run tests

@gmarkall

Copy link
Copy Markdown
Member

gpuci run tests

1 similar comment
@gmarkall

Copy link
Copy Markdown
Member

gpuci run tests

@gmarkall gmarkall added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Oct 27, 2021
@gmarkall

Copy link
Copy Markdown
Member

@esc We now have the check status updating automatically from gpuCI! I added another commit onto this PR that fixes a tiny doc issue mentioned in #7513 so that we had a "fresh" commit to test with.

I think this is now ready for any final review / merging.

@esc esc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor points to discuss, but otherwise ready to merge.

@gmarkall thank you so much for setting this up. Having a public CI with GPU enabled will be a real boon! 🌸

RAPIDS_VER:
- "21.12"

excludes:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: what does this do, is it needed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file defines a matrix of configurations that is the cross-product of all the axes, excludes can be used to remove some configurations from the generated set of configurations, so you don't have to run the cross-product, but only the subset you're interested in. This will probably get a few entries once i start making changes to the config to test the NVIDIA conda packages and the NVIDIA CUDA Python bindings with Numba.

It is documented at: https://github.com/jenkinsci/yaml-axis-plugin/blob/master/README.md#excluding-logic

Comment thread buildscripts/gpuci/build.sh Outdated
@@ -0,0 +1,64 @@
##############################################
# Numba GPU build and test script for CI #

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the final hash # symbol appears to be misaligned.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now aligned.

No functional change, just to improve the aesthetics of the script.
@gmarkall

Copy link
Copy Markdown
Member

@esc Many thanks for the review! Comments added on discussion points.

@gmarkall gmarkall added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Oct 27, 2021

@stuartarchibald stuartarchibald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch and for setting this up. It's great to see Numba having this integration as it means that PRs can be tested by more people without reliance on the build farm (which is often under pressure near releases/needs to be maintained at times!). I've a few suggestions, otherwise looks good! Thanks again!

Comment thread buildscripts/gpuci/axis.yaml
Comment thread buildscripts/gpuci/build.sh Outdated
Comment thread buildscripts/gpuci/build.sh Outdated

gpuci_logger "Create testing env"
. /opt/conda/etc/profile.d/conda.sh
gpuci_mamba_retry create -n numba -y \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
gpuci_mamba_retry create -n numba -y \
gpuci_mamba_retry create -n numba_ci -y \

suggest using a different env name to the package name as it can help with debugging.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

Comment thread buildscripts/gpuci/build.sh Outdated
"numpy" \
"scipy" \
"cffi"
conda activate numba

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
conda activate numba
conda activate numba_ci

for consistency with the above suggestion.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change as above.

. /opt/conda/etc/profile.d/conda.sh
gpuci_mamba_retry create -n numba -y \
"python=${PYTHON_VER}" \
"cudatoolkit=${CUDA_TOOLKIT_VER}" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Anaconda distro compilers should ideally be used here such that the gpuCI build is testing issues arising solely from CUDA and not through the use of different compilers. Think the Anaconda compiler packages are gcc_linux-64=7 and gxx_linux-64=7 (pin to 7 at present for libc etc compat).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WIll add the Anaconda compilers.

Comment thread buildscripts/gpuci/build.sh Outdated
Comment on lines +50 to +53
gpuci_logger "Check Python version"
python --version
$CC --version
$CXX --version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably remove this if the compilers are set from Anaconda distro. Also numba -s (below) dumps python info.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the Python info, but I'll leave in the compiler checks in case some oddity results in the Anaconda compilers being installed but not used (e.g. in case there's something about the image we run on that is / becomes unanticipated).

Comment thread buildscripts/gpuci/build.sh Outdated
Comment on lines +55 to +58
gpuci_logger "Check conda environment"
conda info
conda config --show-sources
conda list --show-channel-urls

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this covered by numba -s?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Comment thread buildscripts/gpuci/build.sh Outdated
Comment on lines +5 to +11
NUMARGS=$#
ARGS=$*

# Arg parsing function
function hasArg {
(( ${NUMARGS} != 0 )) && (echo " ${ARGS} " | grep -q " $1 ")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, will try removing.

- Rename conda env to numba_ci so it's not "numba", which will be less
  confusing (e.g. reading paths).
- Use Anaconda compilers.
- Remove Python version check, which comes from numba -s also.
- Remove conda list, which comes from numba -s also

A couple of other changes not based on the feedback:

- Install psutil, suggested by numba -s
- Run in verbose mode, so if there's a crash in a test we can see which
  one.
@gmarkall

Copy link
Copy Markdown
Member

gpuci run tests

@gmarkall

Copy link
Copy Markdown
Member

@stuartarchibald Thanks for the review! I believe all comments are addressed (and gpuCI still passes).

@stuartarchibald stuartarchibald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch looks good! Thanks for the implementation, setup and fixes @charlesbluca and @gmarkall!

@stuartarchibald stuartarchibald added 5 - Ready to merge Review and testing done, is ready to merge and removed 4 - Waiting on reviewer Waiting for reviewer to respond to author labels Oct 28, 2021
@stuartarchibald stuartarchibald added this to the Numba 0.55 RC milestone Oct 28, 2021
@stuartarchibald

Copy link
Copy Markdown
Contributor

@charlesbluca Congratulations on your first contribution to Numba!

@sklam
sklam merged commit a7cc0d0 into numba:master Oct 28, 2021
esc added a commit to esc/numba that referenced this pull request Nov 4, 2021
* python3.10: (61 commits)
  fix branch pruner tests
  alternative error for unsupported predicates for 3.10
  enable peephole for list_to_tuple in 3.10
  implement GEN_START bytecode instruction for 3.10
  fix unroller defeat 3.10 optimizer
  fix polarity of offset correction
  Fixup instruction pointer offsets
  fix cpython tracing API
  bump max python version
  gpuCI build.sh: Remove dead hasArg code
  gpuCI config changes based on PR numba#7499 feedback
  build.sh: Align a hash in a comment
  More fixes
  Fix missing arg to _add_subprogram()
  README: Remove macOS from CUDA support list.
  Fixup for NvvmDIBuilder
  Correct line number
  Fix unit test wrt new DWARF producer
  flake8
  Add test for break on symbol
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge CUDA CUDA related issue/PR Effort - medium Medium size effort needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants