Skip to content
Closed
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
5 changes: 4 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ MatrixAlgebraKitChainRulesCoreExt = "ChainRulesCore"
Aqua = "0.6, 0.7, 0.8"
ChainRulesCore = "1"
ChainRulesTestUtils = "1"
CUDA = "5"
JET = "0.9"
LinearAlgebra = "1"
SafeTestsets = "0.1"
Expand All @@ -27,6 +28,7 @@ julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Expand All @@ -36,4 +38,5 @@ TestExtras = "5ed8adda-3752-4e41-b88a-e8b09835ee3a"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["Aqua", "JET", "SafeTestsets", "Test", "TestExtras","ChainRulesCore", "ChainRulesTestUtils", "StableRNGs", "Zygote"]
test = ["Aqua", "JET", "SafeTestsets", "CUDA", "Test", "TestExtras", "ChainRulesCore",
"ChainRulesTestUtils", "StableRNGs", "Zygote"]
16 changes: 16 additions & 0 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM nvidia/cuda:12.0.0-devel-ubuntu20.04

# julia
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install --yes --no-install-recommends \
# basic stuff
curl ca-certificates \
libcutensor-dev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

ARG JULIA=1.6
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean Julia v1.6. Is that what we want?

Copy link
Member Author

Choose a reason for hiding this comment

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

Still working on getting this ironed out, I think this is only the default value and this is actually replaced in the Jenkinsfile. This is mostly just copied from the ITensors.jl repository and doesn't currently work yet.

RUN curl -s -L https://julialang-s3.julialang.org/bin/linux/x64/${JULIA}/julia-${JULIA}-latest-linux-x86_64.tar.gz | \
tar -C /usr/local -x -z --strip-components=1 -f -
61 changes: 61 additions & 0 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
pipeline {
agent none
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '8', daysToKeepStr: '20'))
}
stages {
stage('GPU Testing') {
parallel {
stage('MatrixAlgebraKitCUDAExt julia-lts') {
options {
timeout(time: 45, unit: 'MINUTES')
}
agent {
dockerfile {
label 'gpu&&v100'
filename 'Dockerfile'
dir 'jenkins'
additionalBuildArgs '--build-arg JULIA=1.10'
args '--gpus "device=1"'
}
}
environment {
HOME = pwd(tmp:true)
OMP_NUM_THREADS = 4
JULIA_NUM_THREADS = 4
}
steps {
sh '''
julia --project=. -e 'using Pkg: Pkg; Pkg.test("MatrixAlgebraKit"; test_args=["--group=cuda"])'
'''
}
}
stage('MatrixAlgebraKitCUDAExt julia-1') {
options {
timeout(time: 45, unit: 'MINUTES')
}
agent {
dockerfile {
label 'gpu&&v100'
filename 'Dockerfile'
dir 'jenkins'
additionalBuildArgs '--build-arg JULIA=1.11'
args '--gpus "device=1"'
}
}
environment {
HOME = pwd(tmp:true)
OMP_NUM_THREADS = 4
JULIA_NUM_THREADS = 4
}
steps {
sh '''
julia --project=. -e 'using Pkg: Pkg; Pkg.test("MatrixAlgebraKit"; test_args=["--group=cuda"])'
'''
}
}
}
}
}
}
3 changes: 3 additions & 0 deletions test/cuda.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
println("hello")
@test true
using CUDA
93 changes: 57 additions & 36 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,43 +1,64 @@
using SafeTestsets

@safetestset "Truncate" begin
include("truncate.jl")
end
@safetestset "QR / LQ Decomposition" begin
include("qr.jl")
include("lq.jl")
end
@safetestset "Singular Value Decomposition" begin
include("svd.jl")
end
@safetestset "Hermitian Eigenvalue Decomposition" begin
include("eigh.jl")
end
@safetestset "General Eigenvalue Decomposition" begin
include("eig.jl")
end
@safetestset "Schur Decomposition" begin
include("schur.jl")
end
@safetestset "Polar Decomposition" begin
include("polar.jl")
end
@safetestset "Image and Null Space" begin
include("orthnull.jl")
end
@safetestset "ChainRules" begin
include("chainrules.jl")
const pat = r"(?:--group=)(\w+)"
arg_id = findfirst(contains(pat), ARGS)
const GROUP = if isnothing(arg_id)
uppercase(get(ENV, "GROUP", "ALL"))
else
uppercase(only(match(pat, ARGS[arg_id]).captures))
end

@safetestset "MatrixAlgebraKit.jl" begin
@safetestset "Code quality (Aqua.jl)" begin
using MatrixAlgebraKit
using Aqua
Aqua.test_all(MatrixAlgebraKit)
@time begin
if GROUP == "ALL" || GROUP == "DECOMPOSITIONS"
@safetestset "Truncate" begin
include("truncate.jl")
end
@safetestset "QR / LQ Decomposition" begin
include("qr.jl")
include("lq.jl")
end
@safetestset "Singular Value Decomposition" begin
include("svd.jl")
end
@safetestset "Hermitian Eigenvalue Decomposition" begin
include("eigh.jl")
end
@safetestset "General Eigenvalue Decomposition" begin
include("eig.jl")
end
@safetestset "Schur Decomposition" begin
include("schur.jl")
end
@safetestset "Polar Decomposition" begin
include("polar.jl")
end
@safetestset "Image and Null Space" begin
include("orthnull.jl")
end
end

if GROUP == "ALL" || GROUP == "ChainRules"
@safetestset "ChainRules" begin
include("chainrules.jl")
end
end
@safetestset "Code linting (JET.jl)" begin
using MatrixAlgebraKit
using JET
JET.test_package(MatrixAlgebraKit; target_defined_modules=true)

if GROUP == "ALL" || GROUP == "CUDA"
@safetestset "CUDA" begin
include("cuda.jl")
end
end

if GROUP == "ALL" || GROUP == "UTILITY"
@safetestset "Code quality (Aqua.jl)" begin
using MatrixAlgebraKit
using Aqua
Aqua.test_all(MatrixAlgebraKit)
end
@safetestset "Code linting (JET.jl)" begin
using MatrixAlgebraKit
using JET
JET.test_package(MatrixAlgebraKit; target_defined_modules=true)
end
end
end
Loading