{"id":19705894,"url":"https://github.com/llnl/adapt-fp","last_synced_at":"2025-04-29T16:32:07.924Z","repository":{"id":44154929,"uuid":"166279238","full_name":"LLNL/adapt-fp","owner":"LLNL","description":null,"archived":false,"fork":false,"pushed_at":"2022-09-27T06:41:03.000Z","size":211,"stargazers_count":9,"open_issues_count":1,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-15T00:02:54.236Z","etag":null,"topics":["cpp"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LLNL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-17T18:56:02.000Z","updated_at":"2023-11-20T02:56:45.000Z","dependencies_parsed_at":"2023-01-18T15:01:40.084Z","dependency_job_id":null,"html_url":"https://github.com/LLNL/adapt-fp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2Fadapt-fp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2Fadapt-fp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2Fadapt-fp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LLNL%2Fadapt-fp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LLNL","download_url":"https://codeload.github.com/LLNL/adapt-fp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224179044,"owners_count":17268992,"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","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":["cpp"],"created_at":"2024-11-11T21:31:36.671Z","updated_at":"2024-11-11T21:33:00.393Z","avatar_url":"https://github.com/LLNL.png","language":"C++","readme":"# ADAPT: Algorithmic Differentiation for Floating-Point Precision Tuning\n\nThis repository contains the source code for the ADAPT tool [1], which allows\nyou to instrument your own C++ code and analyze it with the aim of finding a\nmixed-precision version (i.e., some double-precision variables have been changed\nto single precision).\n\nADAPT performs algorithmic (or \"automatic\") differentiation [2] and then uses\nthe partial derivatives (\"adjoints\") to estimate the error introduced by\nchanging each variable's type. It then recommends variables that should be\nreplaced to maximize the amount of conversions under an error threshold that you\nprovide.\n\n[1] Harshitha Menon, Michael O. Lam, Daniel Osei-Kuffuor, Markus Schordan, Scott\nLloyd, Kathryn Mohror, and Jeffrey Hittinger. 2018. ADAPT: algorithmic\ndifferentiation applied to floating-point precision tuning. In Proceedings of\nthe International Conference for High Performance Computing, Networking,\nStorage, and Analysis (SC '18). IEEE Press, Piscataway, NJ, USA, Article 48, 13\npages. [ACM DL Link](https://dl.acm.org/citation.cfm?id=3291720)\n\n[2] Wikipedia article: \"[Automatic\nDifferentiation](https://en.wikipedia.org/wiki/Automatic_differentiation)\"\n\n## Prerequisites\n\nADAPT depends on [CoDiPack](https://github.com/SciCompKL/CoDiPack) [3], a template\nexpression-based library for C++11. This library must be accessible to the\ncompiler, possibly by adding `-I/path/to/CoDiPack/folder` to `CXXFLAGS`.\nYou will also need to use the `-DCODI_ZeroAdjointReverse=0` preprocessor flag\nto allow proper access to intermediate adjoints.\n\nYou should also consider using `-DCODI_EnableImplicitConversion\n-DCODI_DisableImplicitConversionWarning` to enable implicit casts from `AD_real`\nto `double`. This allows you to avoid some `AD_value()` calls (see Using ADAPT\nbelow) but it could also hide unintended conversions (causing a loss of adjoint\ninformation).\n\n[3] Max Sagebaum, Tim Albring, and Nicolas R. Gauger. 2017. High-Performance\nDerivative Computations using CoDiPack. arXiv preprint arXiv:1709.07229.\n[arXiv Link](https://arxiv.org/abs/1709.07229)\n\n## Getting Started\n\nTo build your project with ADAPT, include the ADAPT folder as an include path by\nadding `-I/path/to/ADAPT/folder` to `CXXFLAGS`. Also, you must compile with the\n`-std=c++11` option.\n\nAdd the following to each source code file that needs to reference ADAPT:\n\n```c\n#include \u003cadapt.h\u003e\n```\n\nAdd the following to exactly one source code file (usually the one with your\n`main`):\n\n```c\n#include \u003cadapt-impl.cpp\u003e\n```\n\n## Using ADAPT\n\nChange any variables that you wish to analyze from `float` or `double` to\n`AD_real`. Tag any independent variables using the `AD_INDEPENDENT` macro,\nintermediate results (usually any assignment to the variables of interest)\nusing the `AD_INTERMEDIATE` macro, and any output variables\n(and their error threshold) using the `AD_DEPENDENT` macro. Call `AD_begin()`\nbefore any code that you wish to analyze, and call `AD_report()` after all of\nthe code that you wish to analyze. Call `AD_value()` to convert `AD_real`\nvariables to a `double` where necessary (e.g., for output).\n\nThere are also a couple of options that you can set to change the behavior of\nthe analysis. These options are enabled using function calls:\n\n* `AD_enable_absolute_value_error()` - Enable taking the absolute value of\n  errors during variable analysis. Useful when the program contains long chains\n  of self-assignments (i.e., reads and writes to the same variable). Must be\n  called before `AD_report`.\n\n* `AD_enable_source_aggregation()` - Enable aggregation based on source info of\n  assignments rather than variable definitions. Must be called before any of the\n  `AD_INDEPENDENT`/`AD_INTERMEDIATE` macros.\n\nThe included demos (in the `sanity`, `sum2pi_x`, and `arclength` folders)\nprovide examples of how to use ADAPT. Consult the README files in those folders\nfor more information about the individual demos.\n\n## Getting Involved\n\nTo get involved, submit an issue or email the authors directly.\n\n## Contributing\n\nTo contribute, submit a pull request or email the authors directly.\n\n## Release\n\nADAPT is released under an GPL license. For more details see the NOTICE and\nLICENSE files.\n\nLLNL-CODE-762758\n\nADAPT uses the \"JSON for Modern C++\" library, distributed under the MIT license:\n\n```\n    __ _____ _____ _____\n __|  |   __|     |   | |  JSON for Modern C++\n|  |  |__   |  |  | | | |  version 3.1.2\n|_____|_____|_____|_|___|  https://github.com/nlohmann/json\n\nLicensed under the MIT License \u003chttp://opensource.org/licenses/MIT\u003e.\nSPDX-License-Identifier: MIT\nCopyright (c) 2013-2018 Niels Lohmann \u003chttp://nlohmann.me\u003e.\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllnl%2Fadapt-fp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fllnl%2Fadapt-fp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fllnl%2Fadapt-fp/lists"}