Skip to content

Commit

Permalink
Merge branch 'main' into conda-recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham authored Jan 11, 2024
2 parents 2b05630 + ce20b81 commit 7da186e
Show file tree
Hide file tree
Showing 39 changed files with 658 additions and 383 deletions.
13 changes: 4 additions & 9 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#python code owners
nvjitlink/ @rapidsai/nvjitlink-python-codeowners
pynvjitlink/ @rapidsai/pynvjitlink-write

#cmake code owners
**/CMakeLists.txt @rapidsai/nvjitlink-cmake-codeowners
**/cmake/ @rapidsai/nvjitlink-cmake-codeowners
**/CMakeLists.txt @rapidsai/pynvjitlink-write
**/cmake/ @rapidsai/pynvjitlink-write

#build/ops code owners
.github/ @rapidsai/ops-codeowners
ci/ @rapidsai/ops-codeowners
conda/ @rapidsai/ops-codeowners
**/Dockerfile @rapidsai/ops-codeowners
**/.dockerignore @rapidsai/ops-codeowners
docker/ @rapidsai/ops-codeowners
.github/ @rapidsai/ops-codeowners
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Create a bug report to help us improve nvjitlink
about: Create a bug report to help us improve pynvjitlink
title: "[BUG]"
labels: "? - Needs Triage, bug"
assignees: ''
Expand All @@ -18,9 +18,9 @@ A clear and concise description of what you expected to happen.

**Environment details (please complete the following information):**
- Environment location: [Bare-metal, Docker, Cloud(specify cloud provider)]
- Method of nvjitlink install: [conda, Docker, or from source]
- Method of pynvjitlink install: [conda, Docker, or from source]
- If method of install is [Docker], provide `docker pull` & `docker run` commands used


**Additional context**
Add any other context about the problem here.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: Feature request
about: Suggest an idea for nvjitlink
about: Suggest an idea for pynvjitlink
title: "[FEA]"
labels: "? - Needs Triage, feature request"
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I wish I could use nvjitlink to do [...]
A clear and concise description of what the problem is. Ex. I wish I could use pynvjitlink to do [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/submit-question.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Submit question
about: Ask a general question about nvjitlink
about: Ask a general question about pynvjitlink
title: "[QST]"
labels: "? - Needs Triage, question"
assignees: ''
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
Thank you for contributing to nvjitlink :)
Thank you for contributing to pynvjitlink :)
Here are some guidelines to help the review process go smoothly.
Expand Down
44 changes: 44 additions & 0 deletions .github/actions/compute-matrix/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Compute matrix

outputs:
BUILD_MATRIX:
value: ${{ steps.compute-matrix.outputs.BUILD_MATRIX }}
TEST_MATRIX:
value: ${{ steps.compute-matrix.outputs.TEST_MATRIX }}

runs:
using: composite
steps:
- name: Compute matrix
id: compute-matrix
shell: bash
run: |
set -eo pipefail
export BUILD_MATRIX="
- { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.9', LINUX_VER: 'centos7' }
- { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.10', LINUX_VER: 'centos7' }
- { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.11', LINUX_VER: 'centos7' }
- { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.9', LINUX_VER: 'rockylinux8' }
- { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.10', LINUX_VER: 'rockylinux8' }
- { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.11', LINUX_VER: 'rockylinux8' }
"
export TEST_MATRIX="
- { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.9', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.10', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { CUDA_VER: '12.0.1', ARCH: 'amd64', PY_VER: '3.11', LINUX_VER: 'ubuntu18.04', gpu: 'v100', driver: 'latest' }
- { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.9', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' }
- { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.10', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' }
- { CUDA_VER: '12.0.1', ARCH: 'arm64', PY_VER: '3.11', LINUX_VER: 'ubuntu20.04', gpu: 'a100', driver: 'latest' }
"
echo "BUILD_MATRIX=$(
yq -n -o json 'env(BUILD_MATRIX)' | \
jq -c '.' \
)" | tee --append "${GITHUB_OUTPUT}"
echo "TEST_MATRIX=$(
yq -n -o json 'env(TEST_MATRIX)' | \
jq -c '.' \
)" | tee --append "${GITHUB_OUTPUT}"
6 changes: 6 additions & 0 deletions .github/copy-pr-bot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2023, NVIDIA CORPORATION.

# Configuration file for `copy-pr-bot` GitHub App
# https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/

enabled: true
41 changes: 41 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
name: build

on:
push:
tags:
- 'v*'

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

jobs:
compute-matrix:
runs-on: ubuntu-latest
outputs:
BUILD_MATRIX: ${{ steps.compute-matrix.outputs.BUILD_MATRIX }}
steps:
- uses: actions/checkout@v4
- name: Compute Build Matrix
id: compute-matrix
uses: ./.github/actions/compute-matrix
build-wheels:
needs:
- compute-matrix
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.02
with:
build_type: branch
script: "ci/build_wheel.sh"
matrix_filter: ${{ needs.compute-matrix.outputs.BUILD_MATRIX }}
publish-wheels:
needs:
- build-wheels
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.02
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: pynvjitlink
53 changes: 53 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
name: pr

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

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

jobs:
pr-builder:
needs:
- checks
- compute-matrix
- build-wheels
- test-wheels
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.02
checks:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.02
with:
enable_check_generated_files: false
compute-matrix:
runs-on: ubuntu-latest
outputs:
BUILD_MATRIX: ${{ steps.compute-matrix.outputs.BUILD_MATRIX }}
TEST_MATRIX: ${{ steps.compute-matrix.outputs.TEST_MATRIX }}
steps:
- uses: actions/checkout@v4
- name: Compute Build Matrix
id: compute-matrix
uses: ./.github/actions/compute-matrix
build-wheels:
needs:
- compute-matrix
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.02
with:
build_type: pull-request
script: "ci/build_wheel.sh"
matrix_filter: ${{ needs.compute-matrix.outputs.BUILD_MATRIX }}
test-wheels:
needs:
- build-wheels
- compute-matrix
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.02
with:
build_type: pull-request
script: "ci/test_wheel.sh"
matrix_filter: ${{ needs.compute-matrix.outputs.TEST_MATRIX }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ build
*.so
*.egg-info
.*.swp

# compiled test files
pynvjitlink/tests/test_device_functions.*
pynvjitlink/tests/undefined_extern.cubin
22 changes: 14 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
repos:
- repo: https://github.com/PyCQA/flake8
rev: 3.7.8
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v11.1.0
hooks:
- id: clang-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
hooks:
- id: clang-format
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
- id: ruff-format
24 changes: 12 additions & 12 deletions .ycm_extra_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@

from pathlib import Path

CONDA_PREFIX = os.environ['CONDA_PREFIX']
CONDA_PREFIX = os.environ["CONDA_PREFIX"]
NVJITLINK_DIR = Path(__file__).parent
VER = sys.version_info
PYTHON_INCLUDE_NAME = 'python3.10' # Not ideal
PYTHON_INCLUDE_NAME = "python3.10" # Not ideal

CONDA_INCLUDE_DIR = Path(CONDA_PREFIX, 'include')
CONDA_INCLUDE_DIR = Path(CONDA_PREFIX, "include")
PYTHON_INCLUDE_DIR = Path(CONDA_INCLUDE_DIR, PYTHON_INCLUDE_NAME)
NVJITLINK_INCLUDE_DIR = Path(NVJITLINK_DIR, 'include')
CUDA_INCLUDE_DIR = '/usr/local/cuda-12.0/include'
NVJITLINK_INCLUDE_DIR = Path(NVJITLINK_DIR, "include")
CUDA_INCLUDE_DIR = "/usr/local/cuda-12.0/include"

flags = [
'--cuda-gpu-arch=sm_50',
f'-I{CONDA_INCLUDE_DIR}',
f'-I{CUDA_INCLUDE_DIR}',
f'-I{NVJITLINK_INCLUDE_DIR}',
f'-I{PYTHON_INCLUDE_DIR}',
"--cuda-gpu-arch=sm_50",
f"-I{CONDA_INCLUDE_DIR}",
f"-I{CUDA_INCLUDE_DIR}",
f"-I{NVJITLINK_INCLUDE_DIR}",
f"-I{PYTHON_INCLUDE_DIR}",
]


def Settings(**kwargs):
return {'flags': flags}
return {"flags": flags}


if __name__ == '__main__':
if __name__ == "__main__":
print(Settings())
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nvjitlink 0.0.0 (DD Mon YYYY)
# pynvjitlink 0.0.0 (DD Mon YYYY)

## New Features

Expand Down
20 changes: 9 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR)

project(
nvjitlink
VERSION 0.1.0
LANGUAGES CXX
pynvjitlink
VERSION 0.1.6
LANGUAGES CXX CUDA
)

find_package(Python COMPONENTS Interpreter Development REQUIRED)

Python_add_library(_nvjitlinklib MODULE nvjitlink/_nvjitlinklib.cpp WITH_SOABI)
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)

set(opt_option -O0)
if(WIN32)
set(opt_option -/Od)
endif()
target_compile_options(_nvjitlinklib PRIVATE -Werror -Wall ${opt_option})
target_compile_options(_nvjitlinklib PRIVATE -Werror -Wall)

install(TARGETS _nvjitlinklib LIBRARY DESTINATION nvjitlink)
target_compile_features(_nvjitlinklib PRIVATE cxx_std_11)

install(TARGETS _nvjitlinklib LIBRARY DESTINATION pynvjitlink)
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# <div align="left"><img src="https://rapids.ai/assets/images/rapids_logo.png" width="90px"/>&nbsp;nvjitlink</div>
# <div align="left"><img src="https://rapids.ai/assets/images/rapids_logo.png" width="90px"/>&nbsp;pynvjitlink</div>

The [RAPIDS](https://rapids.ai) nvjitlink library provides a Python binding for the
The [RAPIDS](https://rapids.ai) pynvjitlink library provides a Python binding for the
[nvJitLink library](https://docs.nvidia.com/cuda/nvJitLink/index.html). It is presently a
work-in-progress.

**NOTE:** For the latest stable [README.md](https://github.com/rapidsai/nvjitlink/blob/main/README.md) ensure you are on the `main` branch.
**NOTE:** For the latest stable [README.md](https://github.com/rapidsai/pynvjitlink/blob/main/README.md) ensure you are on the `main` branch.

## Quick Start
TODO

## Install nvjitlink
## Install pynvjitlink

Install with either:

```
python setup.py develop
```shell
python -m pip install -e .
```

or

```
python setup.py install
```shell
python -m pip install .
```

### Conda
Expand All @@ -30,4 +31,4 @@ TODO

## Contributing Guide

Review the [CONTRIBUTING.md](https://github.com/rapidsai/nvjitlink/blob/main/CONTRIBUTING.md) file for information on how to contribute code and issues to the project.
Review the [CONTRIBUTING.md](https://github.com/rapidsai/pynvjitlink/blob/main/CONTRIBUTING.md) file for information on how to contribute code and issues to the project.
14 changes: 14 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION

set -euo pipefail

rapids-logger "Install CUDA Toolkit"
source "$(dirname "$0")/install_latest_cuda_toolkit.sh"

rapids-logger "Build wheel"
mkdir -p ./wheel-build
pip wheel . --wheel-dir=./wheel-build -vvv

rapids-logger "Upload Wheel"
RAPIDS_PY_WHEEL_NAME="pynvjitlink-cu12" rapids-upload-wheels-to-s3 ./wheel-build
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

set -euo pipefail

pip install pre-commit

# Run pre-commit checks
pre-commit run --all-files --show-diff-on-failure
Loading

0 comments on commit 7da186e

Please sign in to comment.