Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI jobs #10

Merged
merged 80 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
76d4540
add initial check
brandon-b-miller Oct 31, 2023
71f31dc
move pr.yaml
brandon-b-miller Oct 31, 2023
cadc4bc
add empty check_style.sh
brandon-b-miller Oct 31, 2023
3f46b26
basic check_style.sh that does nothing
brandon-b-miller Oct 31, 2023
2dbd68f
add +x
brandon-b-miller Oct 31, 2023
be8c202
try adding a wheel-build job
brandon-b-miller Oct 31, 2023
695a133
fix spacing
brandon-b-miller Oct 31, 2023
cea436a
add runs-on
brandon-b-miller Oct 31, 2023
bc7116f
install ctk
brandon-b-miller Oct 31, 2023
351fd7e
add -q for now
brandon-b-miller Oct 31, 2023
b18b582
switch to apt-get
brandon-b-miller Oct 31, 2023
c3ebe4c
minor fixes
brandon-b-miller Oct 31, 2023
cb21a8e
update package name
brandon-b-miller Oct 31, 2023
7e67976
add install options
brandon-b-miller Oct 31, 2023
487341d
expanding build_wheel.sh
brandon-b-miller Oct 31, 2023
e58540a
add tests and logging
brandon-b-miller Oct 31, 2023
d40ce2e
more test build steps
brandon-b-miller Oct 31, 2023
cefb8f6
fix path
brandon-b-miller Oct 31, 2023
29b319d
Apply suggestions from code review
brandon-b-miller Nov 2, 2023
b4ef9f6
fix style
brandon-b-miller Nov 2, 2023
a3fef15
add wheel-build to needs
brandon-b-miller Nov 2, 2023
5a36b01
apt-get -> yum due to switching to centos
brandon-b-miller Nov 2, 2023
37ce733
fix centos cuda install
brandon-b-miller Nov 2, 2023
cca7db5
set c++11
brandon-b-miller Nov 3, 2023
abeae67
remove testing phase for now, will test on downstream jobs instead later
brandon-b-miller Nov 3, 2023
8af9c15
try adding a matrix
brandon-b-miller Nov 3, 2023
510db4a
Update .github/workflows/pr.yaml
brandon-b-miller Nov 6, 2023
1335b56
install python via conda
brandon-b-miller Nov 6, 2023
cb57054
missed endquote
brandon-b-miller Nov 6, 2023
25bd2b7
try adding test steps in separate jobs
brandon-b-miller Nov 6, 2023
1669c92
fix syntax
brandon-b-miller Nov 6, 2023
42b0c5b
switch to * for now
brandon-b-miller Nov 6, 2023
40b8d91
formatting
brandon-b-miller Nov 6, 2023
f84ba0b
add missing job
brandon-b-miller Nov 6, 2023
946509c
try uploading a directory
brandon-b-miller Nov 6, 2023
a6e76c7
update paths
brandon-b-miller Nov 6, 2023
f59a41a
drop 3.12 for now
brandon-b-miller Nov 6, 2023
306c1b9
add matrix to download
brandon-b-miller Nov 6, 2023
7ea3af1
+x to test_wheel.sh
brandon-b-miller Nov 6, 2023
1b2ce4d
expand test_wheel.sh
brandon-b-miller Nov 6, 2023
02906bb
try reading artifact name
brandon-b-miller Nov 6, 2023
91ac502
a debugging commit
brandon-b-miller Nov 8, 2023
08842b1
update wheel install command
brandon-b-miller Nov 8, 2023
1dc9460
missing ..
brandon-b-miller Nov 8, 2023
a70ea01
fix more paths
brandon-b-miller Nov 8, 2023
a635037
build in verbose mode
brandon-b-miller Nov 8, 2023
8dcceef
cmake.verbose=True in pyproject.toml
brandon-b-miller Nov 8, 2023
5690d0a
require cuda 12.3
brandon-b-miller Nov 9, 2023
667691f
explicitly install gcc
brandon-b-miller Nov 9, 2023
e253487
switch containers, remove extra gcc install
brandon-b-miller Nov 14, 2023
b0b0410
endquote
brandon-b-miller Nov 14, 2023
e0f71aa
base image name on python version, dont install python in test container
brandon-b-miller Nov 14, 2023
ab57c23
adjust matrix
brandon-b-miller Nov 14, 2023
e2a2a3b
install pytest using pip
brandon-b-miller Nov 14, 2023
8c318ff
use gpu runners
brandon-b-miller Nov 14, 2023
8dfd9b9
install gcc again
brandon-b-miller Nov 14, 2023
d1eac13
enforce compiler versions in cmake
brandon-b-miller Nov 14, 2023
78566e0
try installing system compilers
brandon-b-miller Nov 15, 2023
effab51
set and unset e
brandon-b-miller Nov 15, 2023
b80ad0a
start expanding test matrix
brandon-b-miller Nov 15, 2023
ee7841d
do not set e for now
brandon-b-miller Nov 15, 2023
774b2c8
use SCCACHE_S3_NO_CREDENTIALS=1
brandon-b-miller Nov 15, 2023
7449fcb
use ci-wheel containers to get arm images
brandon-b-miller Nov 15, 2023
e11cc48
get python from the image instead of conda
brandon-b-miller Nov 15, 2023
7ef7ce7
use inputs.node_type
brandon-b-miller Nov 15, 2023
ce3bb98
build on cpu runners
brandon-b-miller Nov 15, 2023
6497681
Update .github/workflows/pr.yaml
brandon-b-miller Nov 15, 2023
f340a61
remove python version from path
brandon-b-miller Nov 15, 2023
4614362
separate testing into arm64 and amd64
brandon-b-miller Nov 15, 2023
6baf691
add to needs section
brandon-b-miller Nov 15, 2023
b4db71a
use citestwheel test images
brandon-b-miller Nov 15, 2023
ca82b03
skip bad test
brandon-b-miller Nov 15, 2023
5ea590e
Apply suggestions from code review
bdice Nov 15, 2023
110af93
Update pynvjitlink/tests/test_pynvjitlink.py
brandon-b-miller Nov 16, 2023
c9f57b4
build amd and arm in two separate jobs
brandon-b-miller Nov 16, 2023
0789176
don't test ubuntu 18.04 with arm
brandon-b-miller Nov 16, 2023
f016805
address reviews
brandon-b-miller Nov 16, 2023
1f647ba
fix cmake
brandon-b-miller Nov 16, 2023
78b0b41
try removing cache again
brandon-b-miller Nov 16, 2023
7e48e2b
Revert "try removing cache again"
brandon-b-miller Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
name: pr

on:
push:
branches:
- "pull-request/[0-9]+"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pr-builder:
needs:
- checks
- wheel-build
- wheel-test
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
checks:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/[email protected]
with:
enable_check_generated_files: false
wheel-build:
runs-on: linux-${{ matrix.arch }}-cpu4
strategy:
matrix:
python-version: ["3.9", "3.10"]
arch: ["arm64", "amd64"]
container:
# Use CentOS 7 for an old glibc version, so the wheel has broad manylinux compatibility.
image: "rapidsai/ci-wheel:cuda12.0.1-centos7-py${{ matrix.python-version }}"
brandon-b-miller marked this conversation as resolved.
Show resolved Hide resolved
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get PR Info
id: get-pr-info
uses: rapidsai/shared-actions/get-pr-info@main
- name: Run build_wheel.sh
run: ci/build_wheel.sh
- name: Upload Python Wheel
uses: actions/upload-artifact@v2
with:
path: ./wheel-build-${{ matrix.python-version }}
wheel-test:
needs:
- wheel-build
runs-on: linux-${{ matrix.arch }}-gpu-v100-latest-1
strategy:
matrix:
python-version: ["3.9", "3.10"]
linux-version: ["centos7", "rockylinux8"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above about linux-version being unused.

arch: ["arm64", "amd64"]
container:
image: "rapidsai/ci-wheel:cuda12.0.1-${{ matrix.linux-version }}-py${{ matrix.python-version }}"
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get PR Info
id: get-pr-info
uses: rapidsai/shared-actions/get-pr-info@main
- name: Download Python Wheel
uses: actions/download-artifact@v2
with:
path: ./
- name: run test_wheel.sh
bdice marked this conversation as resolved.
Show resolved Hide resolved
run: ci/test_wheel.sh
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
set(CMAKE_CXX_STANDARD 11)
brandon-b-miller marked this conversation as resolved.
Show resolved Hide resolved

cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)

project(
pynvjitlink
VERSION 0.1.0
LANGUAGES CXX
LANGUAGES CXX CUDA
)

find_package(Python COMPONENTS Interpreter Development REQUIRED)

Python_add_library(_nvjitlinklib MODULE pynvjitlink/_nvjitlinklib.cpp WITH_SOABI)

find_package(
CUDAToolkit 12.0 REQUIRED
CUDAToolkit 12.3 REQUIRED
)
target_link_libraries(_nvjitlinklib PRIVATE CUDA::nvJitLink_static CUDA::nvptxcompiler_static)

Expand Down
23 changes: 23 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION


rapids-logger "Install CUDA Toolkit"
yum update
yum install -y epel-release
yum install -y nvidia-driver-latest-dkms
yum install -y cuda-toolkit-12-3

rapids-logger "Install GCC"
yum install -y centos-release-scl
yum install -y devtoolset-9

source scl_source enable devtoolset-9
brandon-b-miller marked this conversation as resolved.
Show resolved Hide resolved

rapids-logger "Check conda environment"
conda list

rapids-logger "Build wheel"
export SCCACHE_S3_NO_CREDENTIALS=1
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this, I get

      sccache /usr/bin/c++    -o CMakeFiles/cmTC_1b1f2.dir/testCXXCompiler.cxx.o -c /__w/pynvjitlink/pynvjitlink/build/cp310-cp310-manylinux_2_17_x86_64/CMakeFiles/CMakeScratch/TryCompile-DBkCuI/testCXXCompiler.cxx
      sccache: error: Timed out waiting for server startup. Maybe the remote service is unreachable?

during the wheel build step, this is a workaround. Still following up on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the follow-up task here is to try using the aws-actions/configure-aws-credentials@v3 step that I linked above. It doesn't matter for this PR, though.

mkdir -p ./wheel-build-${python_version}
pip wheel . --wheel-dir=./wheel-build-${python_version} -vvv
9 changes: 9 additions & 0 deletions ci/check_style.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION
brandon-b-miller marked this conversation as resolved.
Show resolved Hide resolved

set -euo pipefail

pip install pre-commit

# Run pre-commit checks
pre-commit run --all-files --show-diff-on-failure
16 changes: 16 additions & 0 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION

set -e


rapids-logger "Install wheel"
pip install --find-links ./artifact pynvjitlink
bdice marked this conversation as resolved.
Show resolved Hide resolved

rapids-logger "Build Tests"
cd test_binary_generation && make

rapids-logger "Run Tests"
cd ..
pip install pytest
py.test pynvjitlink/tests
bdice marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 5 additions & 1 deletion pynvjitlink/tests/test_pynvjitlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def device_functions_ptx():
def undefined_extern_cubin():
return read_test_file('undefined_extern.cubin')


@pytest.mark.skip
def test_create_no_arch_error():
# nvjitlink expects at least the architecture to be specified.
Expand All @@ -63,12 +64,14 @@ def test_invalid_arch_error():
match='NVJITLINK_ERROR_UNRECOGNIZED_OPTION error'):
_nvjitlinklib.create('-arch=sm_XX')


@pytest.mark.skip
def test_unrecognized_option_error():
with pytest.raises(RuntimeError,
match='NVJITLINK_ERROR_UNRECOGNIZED_OPTION error'):
_nvjitlinklib.create('-fictitious_option')


@pytest.mark.skip
def test_invalid_option_type_error():
with pytest.raises(TypeError,
Expand Down Expand Up @@ -108,6 +111,7 @@ def test_add_file(input_file, input_type, request):
_nvjitlinklib.add_data(handle, input_type.value, data, filename)
_nvjitlinklib.destroy(handle)


@pytest.mark.skip
def test_get_error_log(undefined_extern_cubin):
handle = _nvjitlinklib.create('-arch=sm_75')
Expand Down Expand Up @@ -188,7 +192,7 @@ def test_get_linked_ptx_from_lto(device_functions_ltoir):
handle = _nvjitlinklib.create('-arch=sm_75', '-lto', '-ptx')
_nvjitlinklib.add_data(handle, input_type, data, filename)
_nvjitlinklib.complete(handle)
ptx = _nvjitlinklib.get_linked_ptx(handle)
ptx = _nvjitlinklib.get_linked_ptx(handle) # noqa: F841
brandon-b-miller marked this conversation as resolved.
Show resolved Hide resolved
_nvjitlinklib.destroy(handle)


Expand Down
8 changes: 8 additions & 0 deletions pynvjitlink/tests/test_pynvjitlink_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,23 @@ def undefined_extern_cubin():
with open(fatbin_path, 'rb') as f:
return f.read()


@pytest.mark.skip
def test_create_no_arch_error():
# nvlink expects at least the architecture to be specified.
with pytest.raises(NvJitLinkError,
match='NVJITLINK_ERROR_MISSING_ARCH error'):
NvJitLinker()


@pytest.mark.skip
def test_invalid_arch_error():
# sm_XX is not a valid architecture
with pytest.raises(NvJitLinkError,
match='NVJITLINK_ERROR_UNRECOGNIZED_OPTION error'):
NvJitLinker('-arch=sm_XX')


@pytest.mark.skip
def test_invalid_option_type_error():
with pytest.raises(TypeError,
Expand All @@ -61,6 +64,7 @@ def test_add_cubin(device_functions_cubin):
name = 'test_device_functions.cubin'
nvjitlinker.add_cubin(device_functions_cubin, name)


@pytest.mark.skip
def test_add_incompatible_cubin_arch_error(device_functions_cubin):
nvjitlinker = NvJitLinker('-arch=sm_70')
Expand All @@ -81,6 +85,7 @@ def test_add_fatbin_sm70(device_functions_fatbin):
name = 'test_device_functions.fatbin'
nvjitlinker.add_fatbin(device_functions_fatbin, name)


@pytest.mark.skip
def test_add_incompatible_fatbin_arch_error(device_functions_fatbin):
nvjitlinker = NvJitLinker('-arch=sm_80')
Expand All @@ -89,6 +94,7 @@ def test_add_incompatible_fatbin_arch_error(device_functions_fatbin):
match='NVJITLINK_ERROR_INVALID_INPUT error'):
nvjitlinker.add_fatbin(device_functions_fatbin, name)


@pytest.mark.skip
def test_add_cubin_with_fatbin_error(device_functions_fatbin):
nvjitlinker = NvJitLinker('-arch=sm_75')
Expand All @@ -105,6 +111,7 @@ def test_add_fatbin_with_cubin(device_functions_cubin):
name = 'test_device_functions.cubin'
nvjitlinker.add_fatbin(device_functions_cubin, name)


@pytest.mark.skip
def test_duplicate_symbols_cubin_and_fatbin(device_functions_cubin,
device_functions_fatbin):
Expand Down Expand Up @@ -136,6 +143,7 @@ def test_get_linked_cubin(device_functions_cubin):
# Just check we got something that looks like an ELF
assert cubin[:4] == b'\x7fELF'


@pytest.mark.skip
def test_get_error_log(undefined_extern_cubin):
nvjitlinker = NvJitLinker('-arch=sm_75')
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tool.scikit-build]
cmake.minimum-version = "3.26.4"
cmake.verbose = true
ninja.make-fallback = true
build-dir = "build/{wheel_tag}"

Expand Down
Loading