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
18 changes: 18 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
env:
SECRET_CODECOV_TOKEN: "l7PxpMgxHEiz2l3UDDj5122Xirv5du1QFQiTf09YISC8VOz/nXeQC2yYY6iTMbccQG3xrumfWke9vtLbAc9LPH75kw3zQODuWMbz0eGSf9wtw7foqO6KAo5neMTeZJ0ZFgFMa2Q89T5SNIQsi4b5Zs7BVto6qB9Z/3QEs/BpsR25cYkY4Y6JBU6XuqZ6GRAc6BtlB4OmBEp3BBsXatx6y64zF0qbp4rocmcBQEoeQkcXtxf0dfA0KNAHpweWPrzIAMZ0aUYp6iEikxwLY5TjVFhOIcpVXUlxIdhl2qaaDF6b6WlgGXiGLpBjsLQfvlOgIlXH59Ddg0IVxboF2a37OA==;U2FsdGVkX19MveWMe1aasYZoJwaeiKO5XqwMZ/utOFj7h1CE9UX4nduBMXTyJ77tpNmCBYsQNJ/PadbX2224hQ=="

steps:
- label: "Julia v1"
plugins:
- JuliaCI/julia#v1:
version: "1"
- JuliaCI/julia-test#v1: ~
- JuliaCI/julia-coverage#v1:
codecov: true
agents:
queue: "juliagpu"
cuda: "*"
if: build.message !~ /\[skip tests\]/
timeout_in_minutes: 60
env:
JULIA_SMC_TEST_GROUP: 'GPU'
10 changes: 5 additions & 5 deletions .github/workflows/Benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: "1"
- uses: julia-actions/cache@v2
- uses: julia-actions/cache@v3
- name: Extract Package Name from Project.toml
id: extract-package-name
run: |
Expand Down Expand Up @@ -46,14 +46,14 @@ jobs:
echo '' >> body.md
echo '' >> body.md
- name: Find Comment
uses: peter-evans/find-comment@v3
uses: peter-evans/find-comment@v4
id: fcbenchmark
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Benchmark Results
- name: Comment on PR
uses: peter-evans/create-or-update-comment@v4
uses: peter-evans/create-or-update-comment@v5
with:
comment-id: ${{ steps.fcbenchmark.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v2
uses: julia-actions/setup-julia@v3
with:
version: '1'
arch: ${{ runner.arch }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: '1'
- uses: julia-actions/cache@v2
- uses: julia-actions/cache@v3
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/Format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Format suggestions
on:
pull_request:
# this argument is not required if you don't use the `suggestion-label` input
types: [opened, reopened, synchronize, labeled, unlabeled]
jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/julia-format@v4
with:
version: '1' # Set `version` to '1.0.54' if you need to use JuliaFormatter.jl v1.0.54 (default: '1')
46 changes: 0 additions & 46 deletions .github/workflows/Test-GPU.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
julia-version: ['1.10', '1']
julia-version: ['1.10', '1.11', '1.12']

steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.julia-version }}
arch: x64
- uses: julia-actions/julia-downgrade-compat@v1
- uses: julia-actions/julia-downgrade-compat@v2
if: ${{ matrix.version == '1.10' }}
with:
skip: LinearAlgebra, Random, SparseArrays
- uses: julia-actions/cache@v2
- uses: julia-actions/cache@v3
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v5
- uses: codecov/codecov-action@v6
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
fail_ci_if_error: false
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ identifiers:
- type: doi
value: 10.5281/zenodo.11314275
description: Zenodo
repository-code: 'https://github.com/gdalle/SparseMatrixColorings.jl'
repository-code: 'https://github.com/JuliaDiff/SparseMatrixColorings.jl'
abstract: >-
Coloring algorithms for sparse Jacobian and Hessian
matrices
Expand Down
22 changes: 16 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SparseMatrixColorings"
uuid = "0a514795-09f3-496d-8182-132a7b665d35"
version = "0.4.27"
authors = ["Guillaume Dalle", "Alexis Montoison"]
version = "0.4.22"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand All @@ -18,25 +18,35 @@ BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CliqueTrees = "60701a23-6482-424a-84db-faee86b9b1f8"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
GPUArrays = "0c68f7d7-f131-5f86-a1c3-88cf8149b2d7"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
cuSPARSE = "b26da814-b3bc-49ef-b0ee-c816305aa060"

[extensions]
SparseMatrixColoringsBandedMatricesExt = "BandedMatrices"
SparseMatrixColoringsBlockBandedMatricesExt = ["BlockArrays", "BlockBandedMatrices"]
SparseMatrixColoringsCUDAExt = "CUDA"
SparseMatrixColoringsCUDAExt = ["CUDA", "cuSPARSE"]
SparseMatrixColoringsCliqueTreesExt = "CliqueTrees"
SparseMatrixColoringsColorsExt = "Colors"
SparseMatrixColoringsGPUArraysExt = "GPUArrays"
SparseMatrixColoringsJuMPExt = ["JuMP", "MathOptInterface"]

[compat]
ADTypes = "1.2.1"
BandedMatrices = "1.9.4"
BlockArrays = "1.6.3"
BlockBandedMatrices = "0.13.1"
CUDA = "5.8.2"
CUDA = "6.0.0"
CliqueTrees = "1"
Colors = "0.12.11, 0.13"
DocStringExtensions = "0.8,0.9"
LinearAlgebra = "<0.0.1, 1"
GPUArrays = "11.5.0"
JuMP = "1.29.1"
LinearAlgebra = "1"
MathOptInterface = "1.45.0"
PrecompileTools = "1.2.1"
Random = "<0.0.1, 1"
SparseArrays = "<0.0.1, 1"
Random = "1"
SparseArrays = "1"
cuSPARSE = "6.0.0"
julia = "1.10"
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# SparseMatrixColorings.jl

[![Build Status](https://github.com/gdalle/SparseMatrixColorings.jl/actions/workflows/Test.yml/badge.svg?branch=main)](https://github.com/gdalle/SparseMatrixColorings.jl/actions/workflows/Test.yml?query=branch%3Amain)
[![Stable Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://gdalle.github.io/SparseMatrixColorings.jl/stable/)
[![Dev Documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://gdalle.github.io/SparseMatrixColorings.jl/dev/)
[![Coverage](https://codecov.io/gh/gdalle/SparseMatrixColorings.jl/branch/main/graph/badge.svg)](https://app.codecov.io/gh/gdalle/SparseMatrixColorings.jl)
[![Build Status](https://github.com/juliadiff/SparseMatrixColorings.jl/actions/workflows/Test.yml/badge.svg?branch=main)](https://github.com/juliadiff/SparseMatrixColorings.jl/actions/workflows/Test.yml?query=branch%3Amain)
[![GPU build status](https://badge.buildkite.com/7d8ed289d7bdb5a25ae48b2c778a202ce4990b7ee558cdfef8.svg?branch=main)](https://buildkite.com/julialang/sparsematrixcolorings-dot-jl)
[![Coverage](https://codecov.io/gh/juliadiff/SparseMatrixColorings.jl/branch/main/graph/badge.svg)](https://app.codecov.io/gh/juliadiff/SparseMatrixColorings.jl)

[![Stable Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliadiff.org/SparseMatrixColorings.jl/stable/)
[![Dev Documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliadiff.org/SparseMatrixColorings.jl/dev/)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/JuliaDiff/BlueStyle)
[![arXiv](https://img.shields.io/badge/arXiv-2505.07308-b31b1b.svg)](https://arxiv.org/abs/2505.07308)
[![DOI](https://zenodo.org/badge/801999408.svg)](https://zenodo.org/doi/10.5281/zenodo.11314275)
Expand Down
4 changes: 3 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,7 @@ makedocs(;
)

deploydocs(;
repo="github.com/gdalle/SparseMatrixColorings.jl", push_preview=true, devbranch="main"
repo="github.com/JuliaDiff/SparseMatrixColorings.jl",
push_preview=true,
devbranch="main",
)
1 change: 1 addition & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ColoringProblem
```@docs
GreedyColoringAlgorithm
ConstantColoringAlgorithm
OptimalColoringAlgorithm
StructuredColoringAlgorithm
```

Expand Down
6 changes: 5 additions & 1 deletion docs/src/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ SparseMatrixColorings.TreeSetColoringResult
SparseMatrixColorings.LinearSystemColoringResult
SparseMatrixColorings.BicoloringResult
SparseMatrixColorings.remap_colors
SparseMatrixColorings.decompress_csc!
```

## Testing
Expand All @@ -50,6 +51,9 @@ SparseMatrixColorings.directly_recoverable_columns
SparseMatrixColorings.symmetrically_orthogonal_columns
SparseMatrixColorings.structurally_orthogonal_columns
SparseMatrixColorings.structurally_biorthogonal
SparseMatrixColorings.substitutable_columns
SparseMatrixColorings.substitutable_bidirectional
SparseMatrixColorings.rank_nonzeros_from_trees
SparseMatrixColorings.valid_dynamic_order
```

Expand All @@ -58,7 +62,7 @@ SparseMatrixColorings.valid_dynamic_order
```@docs
SparseMatrixColorings.respectful_similar
SparseMatrixColorings.matrix_versions
SparseMatrixColorings.same_pattern
SparseMatrixColorings.compatible_pattern
```

## Visualization
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ problem = ColoringProblem()

The algorithm defines how you want to solve it. It can be either a [`GreedyColoringAlgorithm`](@ref) or a [`ConstantColoringAlgorithm`](@ref). For `GreedyColoringAlgorithm`, you can select options such as

- the order in which vertices are processed (a subtype of [`AbstractOrder`](@ref SparseMatrixColorings.AbstractOrder))
- the order in which vertices are processed (a subtype of [`AbstractOrder`](@ref SparseMatrixColorings.AbstractOrder) , or a tuple of such objects)
- the type of decompression you want (`:direct` or `:substitution`)

```@example tutorial
Expand Down
18 changes: 1 addition & 17 deletions ext/SparseMatrixColoringsCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,7 @@ module SparseMatrixColoringsCUDAExt
import SparseMatrixColorings as SMC
using SparseArrays: SparseMatrixCSC, rowvals, nnz, nzrange
using CUDA: CuVector, CuMatrix
using CUDA.CUSPARSE: AbstractCuSparseMatrix, CuSparseMatrixCSC, CuSparseMatrixCSR

SMC.matrix_versions(A::AbstractCuSparseMatrix) = (A,)

## Compression (slow, through CPU)

function SMC.compress(
A::AbstractCuSparseMatrix, result::SMC.AbstractColoringResult{structure,:column}
) where {structure}
return CuMatrix(SMC.compress(SparseMatrixCSC(A), result))
end

function SMC.compress(
A::AbstractCuSparseMatrix, result::SMC.AbstractColoringResult{structure,:row}
) where {structure}
return CuMatrix(SMC.compress(SparseMatrixCSC(A), result))
end
using cuSPARSE: AbstractCuSparseMatrix, CuSparseMatrixCSC, CuSparseMatrixCSR

## CSC Result

Expand Down
5 changes: 2 additions & 3 deletions ext/SparseMatrixColoringsColorsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,8 @@ function show_colors!(
A_ccolor_indices = mod1.(column_colors(res), length(colorscheme))
A_rcolor_indices = mod1.(row_shift .+ row_colors(res), length(colorscheme))
B_ccolor_indices = mod1.(1:maximum(column_colors(res)), length(colorscheme))
B_rcolor_indices = mod1.(
(row_shift + 1):(row_shift + maximum(row_colors(res))), length(colorscheme)
)
B_rcolor_indices =
mod1.((row_shift + 1):(row_shift + maximum(row_colors(res))), length(colorscheme))
A_ccolors = colorscheme[A_ccolor_indices]
A_rcolors = colorscheme[A_rcolor_indices]
B_ccolors = colorscheme[B_ccolor_indices]
Expand Down
29 changes: 29 additions & 0 deletions ext/SparseMatrixColoringsGPUArraysExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module SparseMatrixColoringsGPUArraysExt

using GPUArrays: AbstractGPUSparseMatrix, dense_array_type
using SparseArrays: SparseMatrixCSC
import SparseMatrixColorings as SMC

SMC.matrix_versions(A::AbstractGPUSparseMatrix) = (A,)

## Compression (slow, through CPU)

function SMC.compress(
A::AbstractGPUSparseMatrix, result::SMC.AbstractColoringResult{structure,:column}
) where {structure}
A_cpu = SparseMatrixCSC(A)
B_cpu = SMC.compress(A_cpu, result)
B = dense_array_type(A)(B_cpu)
return B
end

function SMC.compress(
A::AbstractGPUSparseMatrix, result::SMC.AbstractColoringResult{structure,:row}
) where {structure}
A_cpu = SparseMatrixCSC(A)
B_cpu = SMC.compress(A_cpu, result)
B = dense_array_type(A)(B_cpu)
return B
end

end
Loading
Loading