Introduction
This document contains the release notes for the automatic differentiation plugin for clang Clad, release 1.10. Clad is built on top of Clang and LLVM compiler infrastructure. Here we describe the status of Clad in some detail, including major improvements from the previous release and new feature work.
Note that if you are reading this file from a git checkout, this document applies to the next release, not the current one.
What's New in Clad 1.10?
Some of the major new features and improvements to Clad are listed here. Generic improvements to Clad as a whole or to its underlying infrastructure are described first.
External Dependencies
- Clad now works with clang-10 to clang-20
Forward Mode & Reverse Mode
- Improved diagnostics for unsupported features.
- Add custom derivatives for standard math functions.
Forward Mode
- Add support of variadic functions.
Reverse Mode
- Refined function analysis to mark const methods as non-differentiable.
- Make to-be-recorded (TBR) analysis default.
- Automatically generate some constructor pullbacks.
- Implemented "store per change" for method bases to reduce tape usage.
- Enabled differentiation of global variables.
- Enabled differentiation for static member functions.
- Improved handling of object variables, differentiation more consistent across types
- Improved support for default arguments in reverse mode.
- Added primitive support for
std::unique_ptr<T>
. - Refactored handling of custom STL pullbacks.
- Reduce tape usage for objects.
CUDA
- Added
CUDA_HOST_DEVICE
attributes tozero_impl
andzero_init
. - Created
ParmVarDecl
for local kernel variables in device pullbacks. - Reworked indexing of pullbacks to better handle CUDA differentiation
Misc
- Support for LLVM 20, dropped LLVM 9.
- Updated GoogleTest to latest version.
- General CI improvements: Ubuntu 22/24 support, dropped older configs.
- Improved varied analysis.
Fixed Bugs
685 760 772 800 871 879 1009 1044 1095 1125 1262 1269 1270 1276 1294 1295 1302 1304
1353
Special Kudos
This release wouldn't have happened without the efforts of our contributors,
listed in the form of Firstname Lastname (#contributions):
FirstName LastName (#commits)
A B (N)
petro.zarytskyi (44)
Vassil Vassilev (21)
Max Andriychuk (11)
Christina Koutsou (7)
petro (1)
Shubhanjan-GGOD (1)
Rohan-T144 (1)
Petro Mozil (1)
Parth Arora (1)
Jayant (1)
Greg Hazel (1)
Errant (1)
Abdelrhman Elrawy (1)
What's Changed
- Add primitive support for
std::unique_ptr<T>
by @parth-07 in #1222 - Update README.md by @ghazel in #1238
- Improve support for InitListExpr in the reverse mode by @PetroZarytskyi in #1243
- [ci] clang 19 on ubuntu arm seems stable by @vgvassilev in #1244
- Update the documentation for clad::jacobian by @PetroZarytskyi in #1242
- Force differentiation w.r.t. all non-const pointer/array type parameters by @PetroZarytskyi in #1240
- Use move semantics to push objects on tapes by @PetroZarytskyi in #1249
- Correctly handle memory taken by objects in loops by @PetroZarytskyi in #1250
- Make TBR default by @ovdiiuv in #1245
- [ci] Remove redundant main.cpp and avoid specifying C++ standard. by @vgvassilev in #1253
- Support default arguments of object types in the reverse mode by @PetroZarytskyi in #1247
- [cmake] Fix warning that project() should be called prior to enable_language() by @vgvassilev in #1255
- Add new custom derivatives for math functions by @a-elrawy in #1237
- Fix security report by dependabot. by @vgvassilev in #1258
- Remove the special case for
_d_this
in RMV::DifferentiateVarDecl by @PetroZarytskyi in #1259 - Compute the differentiation plan before differentiation starts. by @vgvassilev in #1248
- No need to provide the constructed object to a constructor pullback by @PetroZarytskyi in #1257
- Don't generate pullbacks of non-differentiable constructors in the reverse mode by @PetroZarytskyi in #1254
- Add a check-not clause to the test by @vgvassilev in #1016
- Improve differentiation of object-type decls in the reverse mode by @PetroZarytskyi in #1268
- Specialize zero_init for std::pair. by @vgvassilev in #1284
- Update README For Developer Environment (Discussion-#1260) by @Shubhanjan-GGOD in #1287
- Generate pullbacks of linear constructors by @PetroZarytskyi in #1288
- Do not dereference _d_this by default by @PetroZarytskyi in #1296
- Fix crashing for differentiating static member functions by @Rohan-T144 in #1285
- Differentiate global variables in the reverse mode by @PetroZarytskyi in #1153
- Fix unexpected attempted differentiation of non-differentiation function error by @Errant404 in #1291
- Remove const qualifier from pullback parameters by @PetroZarytskyi in #1303
- Consider const methods non-differentiable by @PetroZarytskyi in #1305
- Consider calls with const reference params non-differentiable by @PetroZarytskyi in #1308
- Support pointer bases in member exprs in reverse mode by @PetroZarytskyi in #1309
- Add information about function template specialization to
DerivativeBuilder::cloneFunction
by @pmozil in #1277 - Generalize logic for xvalue method bases to all non-ref type bases by @PetroZarytskyi in #1311
- Support non-void functions with no dfdx by @PetroZarytskyi in #1312
- Handle return stmt in void functions by @kchristin22 in #1315
- Use memcpy instead of manually copying data, and add malloc check by @jayantpranjal0 in #1279
- Handle CXXConstCastExpr and Dereferenced pointers in shouldBeRecorded by @kchristin22 in #1317
- Fix clad array fixed size initialization inside loop by @kchristin22 in #1321
- Add CUDA_HOST_DEVICE attr in zero_impl and zero_init by @kchristin22 in #1322
- Remove short int suffix in constant creation by @kchristin22 in #1323
- Use static_cast when casting a call arg of a cuda device call to ParmVarDecl by @kchristin22 in #1319
- Clear m_Traversed after traversing differentiate/gradient calls by @ovdiiuv in #1330
- Don't call operators with method calls by @PetroZarytskyi in #1329
- Don't output DVI and Args same time by @ovdiiuv in #1331
- Take const base in custom pullbacks of const methods by @PetroZarytskyi in #1332
- Reduce tape usage for objects by @PetroZarytskyi in #1328
- Add support of variadic functions as call exprs in Forward mode by @kchristin22 in #1246
- [ci] Hopefully python2 is properly gone from osx now. by @vgvassilev in #1339
- [ci] Remove old branch we used to integrate. by @vgvassilev in #1338
- [ci] Balance better the load between Ubuntu 22 and 24. by @vgvassilev in #1341
- [ci] Ubuntu 20 is being phased out; switch to Ubuntu 22 by @vgvassilev in #1340
- Harmonize derivative type generation over all modes by @PetroZarytskyi in #1336
- [ci] Brew is probably better now; remove the llvm install workaround. by @vgvassilev in #1342
- [ci] Drop several configurations to speed up the infrastructure by @vgvassilev in #1343
- Don't mark non-varied constant params by @ovdiiuv in #1148
- Schedule vectorized modes and partially hessians statically by @PetroZarytskyi in #1345
- Move Diffcollector to HandleTU by @ovdiiuv in #1325
- Don't generate += statements of non-real types in reverse mode by @PetroZarytskyi in #1351
- Make ::Derive virtual and consistent across visitors by @PetroZarytskyi in #1348
- [ci] Try to fallback fetch of llvm if it is not part of a package. by @vgvassilev in #1354
- Support llvm20; drop llvm10 by @vgvassilev in #1267
- Update google test to its latest release by @vgvassilev in #1333
- Don't delay the calls when we have no multiplexer. by @vgvassilev in #1356
- Schedule member functions statically by @PetroZarytskyi in #1355
- Make visitor destructors virtual by @PetroZarytskyi in #1358
- Build parenthesis to dereference d_vector before indexing by @ovdiiuv in #1359
- Fix operator= overload to deep copy by @ovdiiuv in #1360
- Fix failing test introduced in #1360 by @ovdiiuv in #1365
New Contributors
- @ghazel made their first contribution in #1238
- @Shubhanjan-GGOD made their first contribution in #1287
- @Rohan-T144 made their first contribution in #1285
- @Errant404 made their first contribution in #1291
- @jayantpranjal0 made their first contribution in #1279
Full Changelog: v1.9...v1.10