Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .JuliaFormatter.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
style = "blue"
join_lines_based_on_source=true
margin=100
margin=100
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Auto detect text files and perform LF normalization
* text=auto
.githash merge=ours
.githash merge=ours
2 changes: 1 addition & 1 deletion .githash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c35ce35cb9a555d168b58c4f3a17ed146d258f94
224cac24f15449a338abebe1bc17ba74c07d9f5c
2 changes: 1 addition & 1 deletion .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ jobs:
# - julia: '1.12'
# allow-failure: true
continue-on-error: ${{ matrix.allow-failure || false }}

steps:
- uses: actions/checkout@v4

- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia }}

- uses: julia-actions/cache@v2

- name: Run tests
env:
GPUTESTS: "0" # parsed by runtests.jl
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
# - name: Setup Conda env
# run: |
# conda create -n myenv -c conda-forge -c legate cupynumeric=25.11.00 python=3.11 elfutils libdwarf -y

# - name: Load Julia packages from cache
# id: julia-cache
# uses: julia-actions/cache@v2
Expand All @@ -99,7 +99,7 @@
# MYENV_PATH=$CONDA_PATH/envs/myenv
# echo "LD_PRELOAD=$MYENV_PATH/lib/libdw.so.1:$MYENV_PATH/lib/libdwarf.so:$MYENV_PATH/lib/libelf.so.1:$MYENV_PATH/lib/libgomp.so.1:$MYENV_PATH/lib/libstdc++.so.6:$LD_PRELOAD" >> $GITHUB_ENV
# echo "MYENV_PATH=$MYENV_PATH" >> $GITHUB_ENV

# - name: Setup cuNumeric.jl and Legate.jl
# run: |
# conda run --no-capture-output -n myenv julia --color=yes -e '
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -167,4 +167,4 @@ jobs:
docker stop ${{ steps.pkg.outputs.ref }} || true
docker rm ${{ steps.pkg.outputs.ref }} || true
docker image rm ${{ steps.meta.outputs.tags }} || true
fi
fi
2 changes: 1 addition & 1 deletion .github/workflows/developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
wget https://github.com/Kitware/CMake/releases/download/v3.30.7/cmake-3.30.7-linux-x86_64.sh --no-check-certificate
sh cmake-3.30.7-linux-x86_64.sh --skip-license --prefix=$HOME/.local
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Load Julia packages from cache
id: julia-cache
uses: julia-actions/cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ jobs:
run: julia --color=yes --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build_wrapper.sh

logging
logging/*
debug
debug
debug/*

compile_wrapper.sh
Expand Down Expand Up @@ -44,7 +44,7 @@ deps/lapacke_build/
deps/deps.jl

# generated by Julia build system
build.log
build.log
env.log

.localenv
Expand Down Expand Up @@ -82,4 +82,3 @@ node_modules
*.exe
*.out
*.app

23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.0
hooks:
- id: clang-format
types_or: [c++, c]

- repo: local
hooks:
- id: julia-formatter
name: JuliaFormatter
description: "Run JuliaFormatter on staged Julia files."
entry: julia --project=. -e 'using JuliaFormatter; format(ARGS, verbose=true)'
language: system
types: [julia]
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ ENV CUDA_VERSION_MAJOR_MINOR="${CUDA_MAJOR}.${CUDA_MINOR}"
ARG REF=main
ENV REF=${REF}
# using bash
SHELL ["/bin/bash", "-c"]
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive

# force turn off legate auto config for precompilation.
ENV LEGATE_AUTO_CONFIG=0

# much of the CUDA.jl setup is from Tim Besard
# CUDA.jl Dockerfile https://github.com/JuliaGPU/CUDA.jl/blob/master/Dockerfile
# Thank you Tim for the reccomendation.
# Thank you Tim for the reccomendation.

ARG JULIA_CPU_TARGET=native
ENV JULIA_CPU_TARGET=${JULIA_CPU_TARGET}
Expand Down Expand Up @@ -101,7 +101,7 @@ EOF
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*

ENV LEGATE_AUTO_CONFIG=1
ENV LEGATE_AUTO_CONFIG=1

ENTRYPOINT source /etc/.env && exec /bin/bash
WORKDIR /workspace
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

The cuNumeric.jl package wraps the [cuPyNumeric](https://github.com/nv-legate/cupynumeric) C++ API from NVIDIA to bring simple distributed computing on GPUs and CPUs to Julia! We provide a simple array abstraction, the `NDArray`, which supports most of the operations you would expect from a normal Julia array.

> [!WARNING]
> [!WARNING]
> cuNumeric.jl is under active development. This is an alpha API and is subject to change. Stability is not guaranteed until the first official release. We are actively working to improve the build experience to be more seamless and Julia-friendly.

### Quick Start
Expand Down Expand Up @@ -39,7 +39,7 @@ x_max = 10.0f0
domain = [-x_max, x_max]
Ω = domain[2] - domain[1]

samples = Ω*cuNumeric.rand(N) .- x_max
samples = Ω*cuNumeric.rand(N) .- x_max
estimate = (Ω/N) * sum(integrand(samples))

println("Monte-Carlo Estimate: $(estimate)")
Expand Down
2 changes: 1 addition & 1 deletion benchmark/cpp_matmul/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ endif()

find_package(cupynumeric REQUIRED)

add_executable(matmulfp32_test main.cpp)
add_executable(matmulfp32_test main.cpp)
target_link_libraries(matmulfp32_test PRIVATE cupynumeric::cupynumeric)
install(TARGETS matmulfp32_test DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/cmake-install")
2 changes: 1 addition & 1 deletion benchmark/cpp_matmul/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cupynumeric_root=`python -c 'import cupynumeric.install_info as i; from pathlib
echo "Using cuPyNumeric at $cupynumeric_root"

cmake -S . -B build -D legate_ROOT="$legate_root" -D cupynumeric_ROOT="$cupynumeric_root" -D CMAKE_BUILD_TYPE=Debug
cmake --build build --parallel 8 --verbose
cmake --build build --parallel 8 --verbose
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ coverage:
status:
patch: false
project: false
changes: false
changes: false
2 changes: 1 addition & 1 deletion deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#= Copyright 2026 Northwestern University,
#= Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion deps/version.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#= Copyright 2026 Northwestern University,
#= Copyright 2026 Northwestern University,
* Carnegie Mellon University University
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
14 changes: 7 additions & 7 deletions docs/src/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default defineConfig({
// ['script', {src: '/versions.js'], for custom domains, I guess if deploy_url is available.
['script', {src: `${baseTemp.base}siteinfo.js`}]
],

vite: {
define: {
__DEPLOY_ABSPATH__: JSON.stringify('REPLACE_ME_DOCUMENTER_VITEPRESS_DEPLOY_ABSPATH'),
Expand All @@ -50,18 +50,18 @@ export default defineConfig({
}
},
optimizeDeps: {
exclude: [
exclude: [
'@nolebase/vitepress-plugin-enhanced-readabilities/client',
'vitepress',
'@nolebase/ui',
],
},
ssr: {
noExternal: [
],
},
ssr: {
noExternal: [
// If there are other packages that need to be processed by Vite, you can add them here.
'@nolebase/vitepress-plugin-enhanced-readabilities',
'@nolebase/ui',
],
],
},
},
markdown: {
Expand Down
8 changes: 4 additions & 4 deletions docs/src/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { h } from 'vue'
import DefaultTheme from 'vitepress/theme'
import type { Theme as ThemeConfig } from 'vitepress'

import {
NolebaseEnhancedReadabilitiesMenu,
NolebaseEnhancedReadabilitiesScreenMenu,
import {
NolebaseEnhancedReadabilitiesMenu,
NolebaseEnhancedReadabilitiesScreenMenu,
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client'

import VersionPicker from "@/VersionPicker.vue"
Expand Down Expand Up @@ -36,4 +36,4 @@ export const Theme: ThemeConfig = {
app.component('Authors', Authors)
}
}
export default Theme
export default Theme
6 changes: 3 additions & 3 deletions docs/src/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/var
--vp-font-family-mono: JuliaMono-Regular, monospace;
}

/* Disable contextual alternates (kind of like ligatures but different) in monospace,
/* Disable contextual alternates (kind of like ligatures but different) in monospace,
which turns `/>` to an up arrow and `|>` (the Julia pipe symbol) to an up arrow as well. */
.mono-no-substitutions {
font-family: "JuliaMono-Regular", monospace;
Expand Down Expand Up @@ -98,7 +98,7 @@ font-feature-settings: "calt" off;
-145deg,
#9558b282 30%,
#3798269a 30%,
#cb3d33e3
#cb3d33e3
);
--vp-home-hero-image-filter: blur(40px);
}
Expand Down Expand Up @@ -172,4 +172,4 @@ mjx-container {
mjx-container > svg {
margin: auto;
display: inline-block;
}
}
11 changes: 5 additions & 6 deletions docs/src/benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ GEMM Efficiency | GEMM GFLOPS

## Monte-Carlo Integration

Monte-Carlo integration is embaressingly parallel and should scale perfectly. We do not know the exact number of operations in `exp` so the GFLOPs is off by a constant factor.
Monte-Carlo integration is embaressingly parallel and should scale perfectly. We do not know the exact number of operations in `exp` so the GFLOPs is off by a constant factor.

Code Outline:
```julia
Expand All @@ -45,7 +45,7 @@ Solving a PDE requires halo-exchanges and lots of data movement. In this benchma

Since there is no programatic way to set the hardware configuration (as of 24.11) benchmarking cuNumeric.jl code is a bit tedious. As an introduction, we walk through a benchmark of matrix multiplication (SGEMM). All the code for this benchmark can be found in the `cuNumeric.jl/pkg/benchmark` directory.

> [!WARNING]
> [!WARNING]
> We do not commit to maintaining the benchmark scripts, due to difficulty programatically configuring legate and API overturn as we work on cuNumeric v1.0. The general principles used should work, even if the code does not.


Expand Down Expand Up @@ -73,14 +73,14 @@ function total_space(N, M)
end
```

We cannot use rely on common benchmark tools in Julia like [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl) or [ChairMarks.jl](https://github.com/LilithHafner/Chairmarks.jl) or even the built in `Base.@time` macro. The asynchronous nature of operations on NDArrays means that function calls will execute almost immediately and program execution must be blocked to properly time a kernel. It is technically possible to time NDArray operations with something like [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl) by adding a blocking operation (e.g., accessing the result), but the allocations reported by these tools will never be correct and it is safer to use the timing functionality from CuPyNumeric.
We cannot use rely on common benchmark tools in Julia like [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl) or [ChairMarks.jl](https://github.com/LilithHafner/Chairmarks.jl) or even the built in `Base.@time` macro. The asynchronous nature of operations on NDArrays means that function calls will execute almost immediately and program execution must be blocked to properly time a kernel. It is technically possible to time NDArray operations with something like [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl) by adding a blocking operation (e.g., accessing the result), but the allocations reported by these tools will never be correct and it is safer to use the timing functionality from CuPyNumeric.

The timer built into CuPyNumeric blocks execution until all Legate operations preceding the call that generated the timing object complete. We provide two timing utilities: `get_time_microseconds` and `get_time_nanoseconds`.
The timer built into CuPyNumeric blocks execution until all Legate operations preceding the call that generated the timing object complete. We provide two timing utilities: `get_time_microseconds` and `get_time_nanoseconds`.

Now we can write the benchmark code. There are two more parameters we need to set: the number of samples, `n_samples`, and the number of warm-up samples, `n_warnup`. With all this the benchmark loop is:

```julia
using LinearAlgebra
using LinearAlgebra
using cuNumeric

function gemm_cunumeric(N, M, n_samples, n_warmup)
Expand Down Expand Up @@ -150,4 +150,3 @@ As part of a more complete benchmark we ran our code on up to 8 A100 GPUs (singl
GEMM Efficiency | GEMM GFLOPS
:-------------------------:|:-------------------------:
![GEMM Efficiency](images/gemm_efficiency.svg) | ![GEMM GFLOPS](images/gemm_gflops.svg)

2 changes: 1 addition & 1 deletion docs/src/components/AuthorBadge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ const getColor = (name) => {
box-shadow: 0 0 0 1.25px rgba(248, 248, 247, 0.4);
transition: all 0.2s ease;
}
</style>
</style>
8 changes: 4 additions & 4 deletions docs/src/components/Authors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
/>
</div>
</template>

<script setup>
import { useData } from 'vitepress'

const { frontmatter } = useData()
const pageAuthors = frontmatter.value.authors || []
</script>

<style scoped>
.authors-container {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
margin: 1rem 0;
}
</style>
</style>
2 changes: 1 addition & 1 deletion docs/src/components/VersionPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ onMounted(() => {
.VPVersionPicker:hover :deep(button .text) {
color: var(--vp-c-text-2) !important;
}
</style>
</style>
4 changes: 2 additions & 2 deletions docs/src/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

To contribute to cuNumeric.jl, we recommend cloning the repository and adding it to one of your existing environments with `Pkg.develop`.
```bash
git clone https://github.com/JuliaLegate/cuNumeric.jl.git
git clone https://github.com/JuliaLegate/cuNumeric.jl.git
julia --project=. -e 'using Pkg; Pkg.develop(path = "cuNumeric.jl/lib/CNPreferences")'
julia --project=. -e 'using Pkg; Pkg.develop(path = "cuNumeric.jl")'
julia --project=. -e 'using CNPreferences; CNPreferences.use_developer_mode()'
julia --project=. -e 'using Pkg; Pkg.build()'
```
```
Loading
Loading