{"id":25645646,"url":"https://github.com/exanauts/argos.jl","last_synced_at":"2025-10-09T20:19:59.872Z","repository":{"id":37797277,"uuid":"307942526","full_name":"exanauts/Argos.jl","owner":"exanauts","description":"Reduced-space optimization, for optimal power flow.","archived":false,"fork":false,"pushed_at":"2025-03-30T02:15:25.000Z","size":2770,"stargazers_count":21,"open_issues_count":2,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-10-05T00:46:49.500Z","etag":null,"topics":["gpu","julia","optimization"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exanauts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-28T07:49:41.000Z","updated_at":"2025-07-28T11:40:15.000Z","dependencies_parsed_at":"2023-09-27T16:26:42.502Z","dependency_job_id":"4f922c85-9f87-4904-9457-49559eb22e04","html_url":"https://github.com/exanauts/Argos.jl","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/exanauts/Argos.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exanauts%2FArgos.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exanauts%2FArgos.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exanauts%2FArgos.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exanauts%2FArgos.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exanauts","download_url":"https://codeload.github.com/exanauts/Argos.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exanauts%2FArgos.jl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002014,"owners_count":26083258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gpu","julia","optimization"],"created_at":"2025-02-23T09:17:41.479Z","updated_at":"2025-10-09T20:19:59.828Z","avatar_url":"https://github.com/exanauts.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Argos.jl\n\n[![][docs-stable-img]][docs-stable-url] [![][build-latest-img]][build-url] [![][codecov-latest-img]][codecov-latest-url] [![DOI][doi-img]][doi-url]\n\nArgos.jl extends the power-system modeler [ExaPF.jl](https://github.com/exanauts/ExaPF.jl)\nand the interior-point solver [MadNLP.jl](https://github.com/MadNLP/MadNLP.jl)\nto solve optimal power flow (OPF) problems entirely in Julia.\n\nThe package is structured as follows:\n- in `src/Evaluators/`, various optimization evaluators implement the different callbacks (objective, gradient, Hessian)\n  required in the optimization algorithms.\n- in `src/Algorithms/`, an Augmented Lagrangian algorithm is implemented, targeting\n  primarily the resolution of large-scale OPF problems on GPU architectures.\n- in `src/Wrappers/`, a wrapper for [MathOptInterface](https://github.com/jump-dev/MathOptInterface.jl) and a wrapper for [NLPModels.jl](https://github.com/JuliaSmoothOptimizers/NLPModels.jl/) are implemented.\n\n## Installation\n\nOne can install Argos with the default package manager:\n```julia\nadd Argos\n```\n\nTo check that everything is working as expected, please run\n```julia\ntest Argos\n```\n\nBy default, this command tests all the `Evaluators` implemented in Argos\non the CPU and, if available, on a CUDA GPU.\n\n## Quickstart\n\nThe function `run_opf` is the entry point to Argos.\nIt takes as input a path to a MATPOWER file and solves the associated OPF with MadNLP:\n```julia\n# Solve in the full-space\nips = Argos.run_opf(\"data/case9.m\", Argos.FullSpace())\n\n```\nThe second argument specifies the formulation used inside MadNLP to solve\nthe OPF problem. `FullSpace()` implements the classical full-space formulation,\n(as implemented inside [MATPOWER](https://matpower.org/) or\n[PowerModels.jl](https://github.com/lanl-ansi/PowerModels.jl)). Alternatively,\none may want to solve the OPF using the reduced-space formulation of Dommel and\nTinney:\n```julia\n# Solve in the reduced-space\nips = Argos.run_opf(\"data/case9.m\", Argos.DommelTinney())\n\n```\n\n## How to use Argos' evaluators?\n\nArgos implements two evaluators to solve the OPF problem:\nthe `FullSpaceEvaluator` implements the classical OPF formulation\nin the full-space, whereas `ReducedSpaceEvaluator` implements the\nreduced-space formulation of Dommel \u0026 Tinney.\n\n### Using an evaluator\nInstantiating a new evaluator from a MATPOWER file simply amounts to\n```julia\n# Reduced-space evaluator\nnlp = Argos.ReducedSpaceEvaluator(\"case57.m\")\n# Full-space evaluator\nflp = Argos.FullSpaceEvaluator(\"case57.m\")\n```\n\nAn initial optimization variable can be computed as\n```julia\nu = Argos.initial(nlp)\n```\nThe variable `u` is the control that will be used throughout the\noptimization. Once a new point `u` obtained, one can refresh all the structures\ninside `nlp` with:\n```julia\nArgos.update!(nlp, u)\n```\nOnce the structures are refreshed, the other callbacks can be evaluated as well:\n```julia\nArgos.objective(nlp, u) # objective\nArgos.gradient(nlp, u)  # reduced gradient\nArgos.jacobian(nlp, u)  # reduced Jacobian\nArgos.hessian(nlp, u)   # reduced Hessian\n```\n\n\n### MOI wrapper\n\nArgos implements a wrapper to [MathOptInterface](https://github.com/jump-dev/MathOptInterface.jl)\nto solve the optimal power flow problem with any nonlinear optimization solver compatible\nwith MathOptInterface:\n```julia\nnlp = Argos.ReducedSpaceEvaluator(\"case57.m\")\noptimizer = Ipopt.Optimizer() # MOI optimizer\n# Update tolerance to be above tolerance of Newton-Raphson subsolver\nMOI.set(optimizer, MOI.RawOptimizerAttribute(\"tol\"), 1e-5)\n# Solve reduced space problem\nsolution = Argos.optimize!(optimizer, nlp)\n```\n\n### NLPModels wrapper\n\nAlternatively, one can use NLPModels.jl to wrap any evaluators implemented\nin Argos. This amounts simply to:\n```julia\nnlp = Argos.FullSpaceEvaluator(\"case57.m\")\n# Wrap in NLPModels\nmodel = Argos.OPFModel(nlp)\n\nx0 = NLPModels.get_x0(model)\nobj = NLPModels.obj(model, x0)\n\n```\nOnce the evaluator is wrapped inside NLPModels.jl, we can leverage any\nsolver implemented in [JuliaSmoothOptimizers](https://github.com/JuliaSmoothOptimizers/)\nto solve the OPF problem.\n\n\n## How to deport the solution of the OPF on the GPU?\n[`ExaPF.jl`](https://github.com/exanauts/ExaPF.jl) is\nusing [`KernelAbstractions`](https://github.com/JuliaGPU/KernelAbstractions.jl)\nto implement all its core operations. Hence, deporting the computation\non GPU accelerators is straightforward. Argos.jl inherits this behavior and\nall evaluators can be instantiated on GPU accelerators, simply as\n```julia\nusing CUDAKernels # Load CUDA backend for KernelAbstractions\nusing ArgosCUDA\nnlp = Argos.ReducedSpaceEvaluator(\"case57.m\"; device=CUDADevice())\n```\nWhen doing so, all kernels are instantiated on the GPU to avoid\nmemory transfer between the host and the device. The sparse linear\nalgebra operations are handled by `cuSPARSE`, and the sparse factorizations\nare performed using `cusolverRF` via the Julia wrapper [CUSOLVERRF.jl](https://github.com/exanauts/CUSOLVERRF.jl).\nThis package is loaded via the included `ArgosCUDA.jl` package in `/lib`.\nWhen deporting the computation on the GPU, the reduced Hessian can be evaluated\nin parallel.\n\n\n### Batch evaluation of the reduced Hessian\nInstead of computing the reduced Hessian one Hessian-vector product after one Hessian-vector product,\nthe Hessian-vector products can be evaluated in batch.\nTo activate the batch evaluation for the reduced Hessian, please specify\nthe number of Hessian-vector products to perform in one batch as\n```julia\nnlp = Argos.ReducedSpaceEvaluator(\"case57.m\"; device=CUDADevice(), nbatch_hessian=8)\n```\nNote that on large instances, the batch computation can be demanding in terms of GPU's memory.\n\n[docs-stable-img]: https://img.shields.io/badge/docs-latest-blue.svg\n[docs-stable-url]: https://exanauts.github.io/Argos.jl/\n[build-url]: https://github.com/exanauts/Argos.jl/actions?query=workflow\n[build-latest-img]: https://github.com/exanauts/Argos.jl/workflows/Run%20tests/badge.svg?branch=master\n[codecov-latest-img]: https://codecov.io/gh/exanauts/Argos.jl/branch/master/graphs/badge.svg?branch=master\n[codecov-latest-url]: https://codecov.io/github/exanauts/Argos.jl?branch=master\n[doi-img]: https://zenodo.org/badge/307942526.svg\n[doi-url]: https://zenodo.org/badge/latestdoi/307942526\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexanauts%2Fargos.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexanauts%2Fargos.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexanauts%2Fargos.jl/lists"}