-
Notifications
You must be signed in to change notification settings - Fork 61
Add the Kokkos+Clad project introduction blogpost #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
_posts/2024-05-26-implementing-kokkos-differentiation-in-clad.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
title: "Implementing Differentiation of the Kokkos Framework in Clad" | ||
layout: post | ||
excerpt: "A GSoC 2024 project aimed at implementing the differentiation of the Kokkos framework into Clad" | ||
sitemap: false | ||
author: Atell Yehor Krasnopolski | ||
permalink: blogs/gsoc24_atell_krasnopolsky_introduction_blog/ | ||
date: 2024-05-26 | ||
tags: gsoc clang llvm clad | ||
--- | ||
|
||
### Introduction | ||
|
||
I'm Atell Krasnopolski, a mathematics student at the University of Wuerzburg, Germany, and a Google Summer of Code 2024 contributor for a project related to Clad, an automatic differentiation tool developed by the Compiler Research group. Specifically, I am going to be implementing the differentiation of the Kokkos framework into Clad. | ||
|
||
**Mentors**: Vaibhav Thakkar, Vassil Vassilev, Petro Zarytskyi | ||
|
||
### Briefly about Kokkos and Clad | ||
|
||
In mathematics and computer algebra, automatic differentiation (AD) is a set of techniques | ||
to numerically evaluate the derivative of a function specified by a computer program. | ||
Automatic differentiation is an alternative technique to Symbolic differentiation and Numerical | ||
differentiation (the method of finite differences). Clad is based on Clang which provides the | ||
necessary facilities for code transformation. The AD library can differentiate non-trivial | ||
functions, to find a partial derivative for trivial cases and has good unit test coverage. | ||
|
||
The Kokkos C++ Performance Portability Ecosystem is a production level solution for writing | ||
modern C++ applications in a hardware-agnostic way. It is part of the US Department of | ||
Energies Exascale Project – the leading effort in the US to prepare the HPC community for | ||
the next generation of supercomputing platforms. The Ecosystem consists of multiple | ||
libraries addressing the primary concerns for developing and maintaining applications in a | ||
portable way. The three main components are the Kokkos Core Programming Model, the | ||
Kokkos Kernels Math Libraries and the Kokkos Profiling and Debugging Tools. | ||
|
||
The Kokkos framework is used in several domains including climate modelling where | ||
gradients are an important part of the simulation process. This project aims at teaching Clad | ||
to differentiate Kokkos entities in a performance-portable way. | ||
|
||
### Why I Chose This Project | ||
|
||
Long story short, I have always been interested in the algorithms at the intersection of computer science and mathematics. In fact, topics like numerical and computational mathematics have sparked my initial interest in mathematics as my university major. Thus, having such an opportunity to work on a project that combines some low-level programming, applied mathematics, and more was a dream from my high school years. | ||
|
||
### Implementation Details and Plans | ||
|
||
The goal is to implement the differentiation of the Kokkos high-performance computing | ||
framework including the support of: | ||
|
||
- Kokkos functors, | ||
- Kokkos lambdas, | ||
- Kokkos methods such as parallel_for, parallel_reduce and deep_copy, | ||
- as well as the general support for Kokkos::View data structures, | ||
- Enhance existing benchmarks demonstrating effectiveness of Clad for Kokkos | ||
|
||
The additional aim of the project is to implement a generic approach to support any C++ | ||
library (starting with Kokkos) in such a way that the core of Clad is invariant to the internals | ||
of the library, but any Clad user can add it in a pluggable format for individual use cases. | ||
This ensures Clad’s usability for bigger projects that may include a lot of libraries. | ||
|
||
To make Kokkos differentiable in Clad, one would need to be able to propagate pullbacks and | ||
pushforwards through its constructs (at least those listed above), which is the goal of this project. | ||
|
||
### Conclusion | ||
|
||
This project represents a unique intersection of mathematics, computer science, and high-performance computing. By extending Clad to support the differentiation of Kokkos entities, we will not only enhance the capabilities of Clad but also provide a valuable tool for the scientific and engineering communities that rely on Kokkos for their simulations and computations. The successful integration of Kokkos with Clad will allow for more efficient and accurate gradient calculations which are essential in fields such as climate modelling and other simulation-heavy domains. | ||
|
||
### Related Links | ||
|
||
- [Clad Repository](https://github.com/vgvassilev/clad) | ||
- [Kokkos Framework](https://kokkos.org/) | ||
- [GSoC Project Proposal](https://summerofcode.withgoogle.com/media/user/7bacecfd1611/proposal/gAAAAABmU0YUILyYTMPRrcmjcv31gQbse1K2pvtrZjJbfFJ-BpANfpBikwSOTM52mNTLxKQeOP-rdhfyqu7KSO-pe74cM18zatTIu6VI4EJzPW8FgNbD8l4=.pdf) | ||
- [My GitHub Profile](https://github.com/gojakuch) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.