Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e4e6dd9
Structured decompression
gdalle Oct 2, 2024
c3a7242
Store graph in result to allow generic matrices
gdalle Oct 2, 2024
d5837b9
Use `fill!` whenever possible
gdalle Oct 2, 2024
12dcf60
More tests
gdalle Oct 2, 2024
3c1350b
Merge branch 'gd/better_result' into gd/structured
gdalle Oct 2, 2024
0e9adcd
Record useless BipartiteGraph
gdalle Oct 2, 2024
fe178d7
Fix docs
gdalle Oct 2, 2024
3937800
Fix cycling inferrability
gdalle Oct 2, 2024
45b16a3
More tests
gdalle Oct 2, 2024
361e53e
Add BandedMatrices
gdalle Oct 2, 2024
4df06f3
Reactivate lts
gdalle Oct 2, 2024
2d71688
Extras
gdalle Oct 2, 2024
eefd1ee
Fix LTS
gdalle Oct 2, 2024
e088877
Ignore unloaded Requires
gdalle Oct 2, 2024
de4a21a
Add BlockBandedMatrices
gdalle Oct 2, 2024
c743b22
Row coloring
gdalle Oct 2, 2024
4f40758
Fix LTS
gdalle Oct 2, 2024
116691d
No fail fast
gdalle Oct 2, 2024
66acbca
BandedBlockBandedMatrices
gdalle Oct 2, 2024
4c838ff
Infinite width
gdalle Oct 2, 2024
59f4d42
Import
gdalle Oct 2, 2024
f3c3776
Fix
gdalle Oct 2, 2024
f55c09a
Fix version
gdalle Oct 2, 2024
00b1961
Merge branch 'main' into gd/structured
gdalle Oct 2, 2024
ef19b99
Merge branch 'main' into gd/structured
gdalle Oct 2, 2024
df53bde
Merge branch 'main' into gd/structured
gdalle Oct 3, 2024
92a3e2d
Remove optimized structured implementations
gdalle Oct 3, 2024
f8cfd6a
Min diff
gdalle Oct 3, 2024
f3531af
Remove cycle range tests
gdalle Oct 3, 2024
a430140
Optimized implementation for structured
gdalle Oct 3, 2024
61da959
Fix import
gdalle Oct 3, 2024
ee82518
Merge remote-tracking branch 'origin/gd/structured2-test' into gd/str…
gdalle Oct 3, 2024
f2d358f
Merge remote-tracking branch 'origin/main' into gd/structured3
gdalle Oct 6, 2024
692ff43
Fix
gdalle Oct 6, 2024
8621d90
Merge remote-tracking branch 'origin/main' into gd/structured3
gdalle Jul 1, 2025
8e25d9c
Remove Requires
gdalle Jul 1, 2025
d1f0a51
Fix test
gdalle Jul 1, 2025
69c2d96
Define StructuredColoringAlgorithm
gdalle Jul 1, 2025
96f5662
Fix doc lunk
gdalle Jul 1, 2025
b24c181
No optimized decompression
gdalle Jul 1, 2025
135e425
Merge main into gd/structured3 (#316)
ErikQQY Apr 28, 2026
52abd51
Merge main into gd/structured3 again (#317)
ErikQQY Apr 28, 2026
f8ced9b
Merge main branch again (#318)
ErikQQY Apr 28, 2026
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
30 changes: 24 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.21"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand All @@ -12,23 +12,41 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[weakdeps]
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
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]
SparseMatrixColoringsCUDAExt = "CUDA"
SparseMatrixColoringsBandedMatricesExt = "BandedMatrices"
SparseMatrixColoringsBlockBandedMatricesExt = ["BlockArrays", "BlockBandedMatrices"]
SparseMatrixColoringsCUDAExt = ["CUDA", "cuSPARSE"]
SparseMatrixColoringsCliqueTreesExt = "CliqueTrees"
SparseMatrixColoringsColorsExt = "Colors"
SparseMatrixColoringsGPUArraysExt = "GPUArrays"
SparseMatrixColoringsJuMPExt = ["JuMP", "MathOptInterface"]

[compat]
ADTypes = "1.2.1"
CUDA = "5.8.2"
BandedMatrices = "1.9.4"
BlockArrays = "1.6.3"
BlockBandedMatrices = "0.13.1"
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
9 changes: 7 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ using Documenter
using DocumenterInterLinks
using SparseMatrixColorings

links = InterLinks("ADTypes" => "https://sciml.github.io/ADTypes.jl/stable/")
links = InterLinks(
"ADTypes" => "https://sciml.github.io/ADTypes.jl/stable/",
"BandedMatrices" => "https://julialinearalgebra.github.io/BandedMatrices.jl/stable/",
)

cp(joinpath(@__DIR__, "..", "README.md"), joinpath(@__DIR__, "src", "index.md"); force=true)

Expand All @@ -21,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",
)
7 changes: 7 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@ SparseMatrixColorings
coloring
fast_coloring
ColoringProblem
```

## Coloring algorithms

```@docs
GreedyColoringAlgorithm
ConstantColoringAlgorithm
OptimalColoringAlgorithm
StructuredColoringAlgorithm
```

## Result analysis
Expand Down
12 changes: 11 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 All @@ -76,3 +80,9 @@ SparseMatrixColorings.what_fig_61
SparseMatrixColorings.efficient_fig_1
SparseMatrixColorings.efficient_fig_4
```

## Misc

```@docs
SparseMatrixColorings.cycle_range
```
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
45 changes: 45 additions & 0 deletions ext/SparseMatrixColoringsBandedMatricesExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module SparseMatrixColoringsBandedMatricesExt

using BandedMatrices: BandedMatrix, bandrange, bandwidths, colrange, rowrange
using SparseMatrixColorings:
BipartiteGraph,
ColoringProblem,
ColumnColoringResult,
StructuredColoringAlgorithm,
RowColoringResult,
column_colors,
cycle_range,
row_colors
import SparseMatrixColorings as SMC

#=
This code is partly taken from ArrayInterface.jl and FiniteDiff.jl
https://github.com/JuliaArrays/ArrayInterface.jl
https://github.com/JuliaDiff/FiniteDiff.jl
=#

function SMC.coloring(
A::BandedMatrix,
::ColoringProblem{:nonsymmetric,:column},
::StructuredColoringAlgorithm;
kwargs...,
)
width = length(bandrange(A))
color = cycle_range(width, size(A, 2))
bg = BipartiteGraph(A)
return ColumnColoringResult(A, bg, color)
end

function SMC.coloring(
A::BandedMatrix,
::ColoringProblem{:nonsymmetric,:row},
::StructuredColoringAlgorithm;
kwargs...,
)
width = length(bandrange(A))
color = cycle_range(width, size(A, 1))
bg = BipartiteGraph(A)
return RowColoringResult(A, bg, color)
end

end
Loading