Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7df264e
Merge pull request #13 from JuliaLabs/agentic
emmanuellujan Nov 13, 2025
2a60fb1
Bump codecov/codecov-action from 4 to 5
dependabot[bot] Nov 13, 2025
c1c5c57
Bump actions/checkout from 4 to 5
dependabot[bot] Nov 13, 2025
1662c94
Merge pull request #15 from JuliaLabs/dependabot/github_actions/actio…
emmanuellujan Nov 13, 2025
bc52d62
Merge pull request #14 from JuliaLabs/dependabot/github_actions/codec…
emmanuellujan Nov 13, 2025
f3d7009
CompatHelper: add new compat entry for BSON at version 0.3, (keep exi…
Nov 14, 2025
1a4594d
CompatHelper: add new compat entry for DecisionTree at version 0.12, …
Nov 14, 2025
13513d0
CompatHelper: add new compat entry for MKL at version 0.9, (keep exis…
Nov 14, 2025
d48b443
CompatHelper: add new compat entry for CSV at version 0.10, (keep exi…
Nov 14, 2025
670dbcc
CompatHelper: add new compat entry for OrderedCollections at version …
Nov 14, 2025
f9cb61c
CompatHelper: add new compat entry for DataFrames at version 1, (keep…
Nov 14, 2025
65d099c
CompatHelper: add new compat entry for CairoMakie at version 0.15, (k…
Nov 14, 2025
7307d04
CompatHelper: add new compat entry for ScikitLearn at version 0.7, (k…
Nov 14, 2025
a772f58
CompatHelper: add new compat entry for BenchmarkTools at version 1, (…
Nov 14, 2025
9c11dea
Merge pull request #16 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
44f1734
Merge pull request #23 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
7fec42b
Merge pull request #21 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
0b8799a
Merge pull request #18 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
6a9ffb3
Merge branch 'main' into compathelper/new_version/2025-11-14-01-48-08…
emmanuellujan Nov 14, 2025
ec4af66
Merge pull request #17 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
88c8c29
Merge branch 'main' into compathelper/new_version/2025-11-14-01-48-12…
emmanuellujan Nov 14, 2025
27bea46
Merge pull request #19 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
215304a
Merge branch 'main' into compathelper/new_version/2025-11-14-01-48-15…
emmanuellujan Nov 14, 2025
708fe40
Merge pull request #20 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
322579b
Merge branch 'main' into compathelper/new_version/2025-11-14-01-48-23…
emmanuellujan Nov 14, 2025
978edb5
Merge pull request #24 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
b07ffc9
Merge branch 'main' into compathelper/new_version/2025-11-14-01-48-18…
emmanuellujan Nov 14, 2025
9507b67
Merge pull request #22 from JuliaLabs/compathelper/new_version/2025-1…
emmanuellujan Nov 14, 2025
20f4e6f
Merge pull request #25 from JuliaLabs/agentic
emmanuellujan Nov 21, 2025
b885177
Documentation update
emmanuellujan Nov 22, 2025
e951f54
new banner
emmanuellujan Nov 22, 2025
a92ac35
Add image and enhance README content
emmanuellujan Nov 22, 2025
50d099f
Update in documentation
emmanuellujan Nov 22, 2025
f0959c1
Merge branch 'main' of github.com:JuliaLabs/SmartSolve.jl
emmanuellujan Nov 22, 2025
944e7d8
Bump actions/checkout from 5 to 6
dependabot[bot] Nov 24, 2025
3063fd7
Merge pull request #26 from JuliaLabs/dependabot/github_actions/actio…
emmanuellujan Nov 24, 2025
eb2b1ea
Update of agentic example and minor source modifications.
emmanuellujan Nov 25, 2025
13fce09
Merge branch 'main' of github.com:JuliaLabs/SmartSolve.jl
emmanuellujan Nov 25, 2025
934d200
Update of agentic example and minor modifications to the main source …
emmanuellujan Nov 25, 2025
34b99d0
Update of GPU agentic example
emmanuellujan Nov 25, 2025
9629c24
Update of cuda agentic example
emmanuellujan Nov 25, 2025
4a1be4e
Update of cpu agentic example
emmanuellujan Nov 26, 2025
fda5162
Update of agentic CUDA example
emmanuellujan Nov 29, 2025
6f512c9
Update of CUDA agentic example
emmanuellujan Nov 29, 2025
9d23edb
Small update of agentic examples.
emmanuellujan Dec 1, 2025
c42449d
Add readme in agentic example
emmanuellujan Dec 1, 2025
79be631
Small fix in agentic example
emmanuellujan Dec 1, 2025
a5ac42e
Small fix in cuda agentic example
emmanuellujan Dec 1, 2025
176c4a4
Improvements in benchmark of agentic cuda example
emmanuellujan Dec 2, 2025
d43dd19
Update of benchmarks in agentic examples
emmanuellujan Dec 2, 2025
5ae3d4c
Fix y axis in benchmark plot
emmanuellujan Dec 3, 2025
8e9288f
Fix x axis units in agentic cuda example
emmanuellujan Dec 3, 2025
ed6d925
Update of agnetic cpu exampe
emmanuellujan Dec 4, 2025
59646eb
fix to cuda issue?
emmanuellujan Dec 4, 2025
3e5398d
Disable julia pre
emmanuellujan Dec 4, 2025
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
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ jobs:
matrix:
version:
- '1.12'
- 'pre'
#- 'pre'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
Expand All @@ -39,7 +39,7 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -52,7 +52,7 @@ jobs:
contents: write
statuses: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: '1'
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.DS_Store
Manifest.toml
docs/build/
9 changes: 9 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
BenchmarkTools = "1"
CSV = "0.10"
BSON = "0.3"
CUDA = "5.9.2"
CairoMakie = "0.15"
DecisionTree = "0.12"
DataFrames = "1"
LinearAlgebra = "1.12.0"
MKL = "0.9"
MatrixDepot = "1.0.13"
OpenAI = "0.12.0"
OrderedCollections = "1"
ScikitLearn = "0.7"
Test = "1.11.0"
julia = "1.11"
62 changes: 10 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,14 @@

<img src="smartsolve.png" alt="SmartSolve.jl">


SmartSolve.jl is a Julia-based toolbox for AI-guided algorithmic discovery, designed to accelerate computations by generating enhanced algorithmic and architectural selection strategies. Envisioned as a general-purpose tool for scientific computing, current efforts focus on challenges in computational linear algebra. The toolbox addresses the growing complexity of selecting efficient solvers, data formats, precision strategies, and hardware resources for structurally diverse matrices—where conventional approaches offer substantial opportunities for improvement. SmartSolve.jl constructs a performance database through systematic benchmarking and applies automated Pareto analysis to identify optimal trade-offs between accuracy and speed. This database underpins a data-driven model that synthesizes dispatch strategies tailored to high-performance linear algebra software.

## How to start

In the following example SmartSolve is used to automatically generate SmartLU, an optimized version of the LU decomposition.

```bash
cd SmartSolve/examples/smartlu
julia --project=.
```

```julia
pkg> dev ../..
pkg> instantiate
julia> include("generate_smartlu.jl")
```

## Publications

- Emmanuel Lujan and Alan Edelman. "When Structure is Silent: Opportunities for Algorithmic Dispatch in Linear Algebra," 2025 IEEE High Performance Extreme Computing Conference (HPEC). Submitted.
- Rushil Shah, Emmanuel Lujan, and Rabab Alomairy, and Alan Edelman. "Data-Driven Dynamic Algorithm Dispatch with Large Language Models," 2025 IEEE High Performance Extreme Computing Conference (HPEC). Submitted.
- Emmanuel Lujan, Rushil Shah, Rabab Alomairy, and Alan Edelman. "SmartSolve.jl: AI for Algorithmic Discovery," 0.1.0-alpha. Zenodo [(link)](https://doi.org/10.5281/zenodo.15784217).
- Rabab Alomairy, Felipe Tome, Julian Samaroo, Alan Edelman. _"Dynamic Task Scheduling with Data Dependency Awareness Using Julia"_, 2024 IEEE High Performance Extreme Computing Conference (HPEC) [(link)](https://ieeexplore.ieee.org/document/10938467).

## Talks

- Rushil Shah, Emmanuel Lujan, and Rabab Alomairy. _"Automated Algorithm Selection Discovery via LLMs,"_ JuliaCon 2025, Lightning Talk. [(Link)](https://pretalx.com/juliacon-2025/talk/review/FXWAYZEZ9XEPYPHL3JJNAS7NBACU3GXE).
- Alan Edelman et al. _"Julia, Portable Numerical Linear Algebra and Beyond."_ Presentation at Householder Symposium, 2025. [(Link)](https://householder-symposium.github.io/presenters.html). Accessed June 20, 2025.
- Alan Edelman, _"Improving the HPC Experience: Did Julia Get It Right, or Will AI Hide the Problem (or Both)?"_ Keynote at the Workshop on Asynchronous Many-Task Systems and Applications (WAMTA), 2025. [(Link)](https://wamta25.github.io/keynote). Accessed June 20, 2025.

## How to Cite

```bibtex
@software{SmartSolve2025,
author = {Lujan, Emmanuel and Shah, Rushil N. and Alomairy, Rabab and Edelman, Alan},
title = {SmartSolve.jl: AI for Algorithmic Discovery},
month = jul,
year = 2025,
publisher = {Zenodo},
version = {0.1.0-alpha},
doi = {10.5281/zenodo.15784217},
url = {https://doi.org/10.5281/zenodo.15784217},
}
```

## Acknowledgements

We thank [DARPA](https://www.darpa.mil/research/programs/mathematics-for-the-discovery-of-algorithms-and-architectures) for supporting this work at MIT.




<a href="https://julia.mit.edu/SmartSolve.jl/dev/">
<img alt="Development documentation" src="https://img.shields.io/badge/documentation-in%20development-orange?style=flat-square">
</a>
<a href="https://mit-license.org">
<img alt="MIT license" src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square">
</a>
<a href="https://github.com/JuliaLabs/SmartSolve.jl/issues/new">
<img alt="Ask us anything" src="https://img.shields.io/badge/Ask%20us-anything-1abc9c.svg?style=flat-square">
</a>
</a>
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SmartSolve = "4fbb3a3c-2fa1-4c19-8d57-bae8bc1e16ac"
Empty file added docs/citation.bib
Empty file.
87 changes: 71 additions & 16 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,78 @@
using SmartSolve
using Documenter
using DocumenterCitations
using Literate

DocMeta.setdocmeta!(SmartSolve, :DocTestSetup, :(using SmartSolve); recursive=true)

makedocs(;
modules=[SmartSolve],
authors="JuliaLabs",
sitename="SmartSolve.jl",
format=Documenter.HTML(;
canonical="https://JuliaLabs.github.io/SmartSolve.jl",
edit_link="main",
assets=String[],
),
pages=[
"Home" => "index.md",
],
DocMeta.setdocmeta!(
SmartSolve,
:DocTestSetup,
:(using SmartSolve);
recursive = true,
)

ENV["BASE_PATH"] = joinpath(@__DIR__, "../")

# Citations ####################################################################
bib = CitationBibliography(joinpath(@__DIR__, "citation.bib"))


# Generate examples ############################################################
const examples_path = joinpath(@__DIR__, "..", "examples")
const output_path = joinpath(@__DIR__, "src/generated")
function create_examples(examples, examples_path, output_path)
for (_, example_path) in examples
s = split(example_path, "/")
sub_path, file_name = string(s[1:end-1]...), s[end]
example_filepath = joinpath(examples_path, example_path)
Literate.markdown(example_filepath,
joinpath(output_path, sub_path),
documenter = true)
end
examples = [title => joinpath("generated", replace(example_path, ".jl" => ".md"))
for (title, example_path) in examples]
return examples
end

# Basic examples
examples = [
# "Simple example" => "simple-example/simple-example.jl",
]
basic_examples = create_examples(examples, examples_path, output_path)

# Make and deploy docs #########################################################

makedocs(
root = joinpath(dirname(pathof(SmartSolve)), "..", "docs"),
source = "src",
build = "build",
clean = true,
doctest = true,
modules = [SmartSolve],
repo = "https://github.com/JuliaLabs/SmartSolve.jl/blob/{commit}{path}#{line}",
highlightsig = true,
sitename = "SmartSolve.jl",
expandfirst = [],
draft = false,
pages = ["Home" => "index.md",
"Install" => "install.md",
#"Examples" => basic_examples,
"Simple examples" => ["Generate linear solver" =>
"gen_lin_solver.md",
"Benchmark & generate linear solver" =>
"benchmark_and_gen_lin_solver.md"],
"Awards, Publications & Talks" => "publications.md",
"API" => "api.md"],
format = Documenter.HTML(;
prettyurls = get(ENV, "CI", "false") == "true",
canonical = "https://github.com/JuliaLabs/SmartSolve.jl",
assets = String[],
),
plugins=[bib]
)

deploydocs(;
repo="github.com/JuliaLabs/SmartSolve.jl",
devbranch="main",
repo = "https://github.com/JuliaLabs/SmartSolve.jl",
devbranch = "main",
push_preview = true,
)

9 changes: 9 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# API Reference

This page provides a list of all documented types and functions and in SmartSolve.jl.


```@autodocs
Modules = [SmartSolve]
Order = [:type, :function, :constant]
```
Binary file added docs/src/assets/smartsolve-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/assets/smartsolve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions docs/src/benchmark_and_gen_lin_solver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Benchmark and generate linear solver

Automatically generate an optimized LU decomposition by selecting a specialized solver tailored to the input matrix structure.

Define candidate algorithms
```julia
dgetrf(A::Matrix) = lu(A)
dgetrf(A::SparseMatrixCSC) = lu(Matrix(A))
dgetrf(A::SparseMatrixCSC{Bool, Int64}) = lu(Matrix(A))
dgetrf(A::Symmetric) = lu(A.data)
bandedlu(A::Matrix) = BandedMatrices.lu(BandedMatrix(sparse(A)))
bandedlu(A::SparseMatrixCSC{Float64, Int64}) = BandedMatrices.lu(BandedMatrix(A))
bandedlu(A::SparseMatrixCSC{Int64, Int64}) = BandedMatrices.lu(BandedMatrix(Float64.(A)))
bandedlu(A::SparseMatrixCSC{Bool, Int64}) = BandedMatrices.lu(BandedMatrix(Float64.(A)))
bandedlu(A::Symmetric) = BandedMatrices.lu(Float64.(BandedMatrix(sparse(A.data))))
algs = [dgetrf, bandedlu]
```

Define your custom matrices to be included in training
```julia
n = 2^12;
A = ...
B = ...
mats = [A, B]
```

Generate a smart version of the algorithm
```julia
alg_name = "lu"
alg_path = "smartlu/"
smartsolve(alg_path, alg_name, algs; n_experiments = 1,
mats = mats, ns = [2^8.2^10,2^12], features = [:isbandedpattern])
```

Include and run the newly generated algorithm
```julia
include("$alg_path/smart$alg_name.jl")
smartlu(A)\b
```
15 changes: 15 additions & 0 deletions docs/src/gen_lin_solver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generate LU with iterative refinement
```julia
using SmartSolve

prompt = """
Generate a high performance Julia implementation of LU
with iterative refinement using the following reference:
https://nhigham.com/2023/03/13/what-is-iterative-refinement
"""

secret_key = ENV["OPENAI_API_KEY"]

code, hist, conv = generate(prompt, secret_key)

```
27 changes: 21 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,28 @@
CurrentModule = SmartSolve
```

# SmartSolve
![SmartSolve logo](assets/smartsolve.png)

Documentation for [SmartSolve](https://github.com/JuliaLabs/SmartSolve.jl).
SmartSolve.jl is a Julia-based toolbox for AI-guided algorithmic discovery, designed to accelerate computations by generating enhanced algorithmic and architectural selection strategies. Envisioned as a general-purpose tool for scientific computing, current efforts focus on challenges in computational linear algebra. The toolbox addresses the growing complexity of selecting efficient solvers, data formats, precision strategies, and hardware resources for structurally diverse matrices—where conventional approaches offer substantial opportunities for improvement. SmartSolve.jl constructs a performance database through systematic benchmarking and applies automated Pareto analysis to identify optimal trade-offs between accuracy and speed. This database underpins a data-driven model that synthesizes dispatch strategies tailored to high-performance linear algebra software.

```@index
```
## How to Cite

```@autodocs
Modules = [SmartSolve]
```bibtex
@software{SmartSolve2025,
author = {Lujan, Emmanuel and Shah, Rushil N. and Alomairy, Rabab and Edelman, Alan},
title = {SmartSolve.jl: AI for Algorithmic Discovery},
month = jul,
year = 2025,
publisher = {Zenodo},
version = {0.1.0-alpha},
doi = {10.5281/zenodo.15784217},
url = {https://doi.org/10.5281/zenodo.15784217},
}
```

## Acknowledgements

We thank [DARPA](https://www.darpa.mil/research/programs/mathematics-for-the-discovery-of-algorithms-and-architectures) for supporting this work at MIT.


5 changes: 5 additions & 0 deletions docs/src/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Install
```julia
​~$ julia
pkg> add https://github.com/JuliaLabs/SmartSolve.jl
```
13 changes: 13 additions & 0 deletions docs/src/publications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Awards
- Outstanding Short Paper Award. Rushil Shah, Emmanuel Lujan, and Rabab Alomairy, and Alan Edelman. "Data-Driven Dynamic Algorithm Dispatch with Large Language Models," 2025 IEEE High Performance Extreme Computing Conference (HPEC).

## Publications
- Emmanuel Lujan and Alan Edelman. "When Structure is Silent: Opportunities for Algorithmic Dispatch in Linear Algebra," 2025 IEEE High Performance Extreme Computing Conference (HPEC).
- Outstanding Short Paper Award. Rushil Shah, Emmanuel Lujan, and Rabab Alomairy, and Alan Edelman. "Data-Driven Dynamic Algorithm Dispatch with Large Language Models," 2025 IEEE High Performance Extreme Computing Conference (HPEC).
- Emmanuel Lujan, Rushil Shah, Rabab Alomairy, and Alan Edelman. "SmartSolve.jl: AI for Algorithmic Discovery," 0.1.0-alpha. Zenodo [(link)](https://doi.org/10.5281/zenodo.15784217).
- Rabab Alomairy, Felipe Tome, Julian Samaroo, Alan Edelman. _"Dynamic Task Scheduling with Data Dependency Awareness Using Julia"_, 2024 IEEE High Performance Extreme Computing Conference (HPEC) [(link)](https://ieeexplore.ieee.org/document/10938467).

## Talks
- Rushil Shah, Emmanuel Lujan, and Rabab Alomairy. _"Automated Algorithm Selection Discovery via LLMs,"_ JuliaCon 2025, Lightning Talk. [(Link)](https://pretalx.com/juliacon-2025/talk/review/FXWAYZEZ9XEPYPHL3JJNAS7NBACU3GXE).
- Alan Edelman et al. _"Julia, Portable Numerical Linear Algebra and Beyond."_ Presentation at Householder Symposium, 2025. [(Link)](https://householder-symposium.github.io/presenters.html). Accessed June 20, 2025.
- Alan Edelman, _"Improving the HPC Experience: Did Julia Get It Right, or Will AI Hide the Problem (or Both)?"_ Keynote at the Workshop on Asynchronous Many-Task Systems and Applications (WAMTA), 2025. [(Link)](https://wamta25.github.io/keynote). Accessed June 20, 2025.
File renamed without changes.
9 changes: 9 additions & 0 deletions examples/agentic/generate-cpu-linear-solver/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SmartSolve = "4fbb3a3c-2fa1-4c19-8d57-bae8bc1e16ac"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[sources]
SmartSolve = {path = "../../.."}
Loading
Loading