8000 Add intro blog for STL Concurrency primitives GSoC 2025 project by pmozil · Pull Request #295 · compiler-research/compiler-research.github.io · GitHub
[go: up one dir, main page]

Skip to content

Add intro blog for STL Concurrency primitives GSoC 2025 project #295

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions _data/contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,30 @@
potentially establishing a new standard for high-performance genomic data analysis.
proposal: /assets/docs/Aditya_Pandey_GSoC2025.pdf
mentors: Martin Vassilev, Jonas Rembser, Fons Rademakers, Vassil Vassilev

- name: Petro Mozil
photo: PetroMozil.jpeg
info: "Google Summer of Code 2025 Contributor"
email: mozil.petryk@gmail.com
education: "Bachelor of Computer Science, Ukrainian Catholic University, Ukraine"
github: "https://github.com/pmozil"
active: 1
linkedin: "https://www.linkedin.com/in/petro-mozil-a94583170/"
projects:
- title: "Enabling support for STL concurrency primitives in CLAD"
status: Ongoing
description: |
Clad recursively iterates over the syntax tree to check whether a given
statement should be differentiated. Each function that is called from
inside of a differentiated function should be differentiated as well,
and so should any object method. The main issue for clad is that std::thread is an object,
and thus as a type that should be differentiated However, std::thread shouldn’t
be differentiated, the function inside of it should.
Some of STL’s concurrency primitives face the same problem -
the methods in them should not be differentiated,
and only the location of where they were called should be preserved.
proposal: /assets/docs/petro_mozil_promosal_GSoC_2025.pdf
mentors: Martin Vassilev, David Lange

- name: Salvador de la Torre Gonzalez
info: "Google Summer of Code 2025 Contributor"
Expand Down
10 changes: 10 additions & 0 deletions _pages/team/petro-mozil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "Compiler Research - Team - Petro Mozil"
layout: gridlay

Check failure on line 3 in _pages/team/petro-mozil.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`gridlay` is not a recognized word. (unrecognized-spelling)
excerpt: "Compiler Research: Team members"
sitemap: false
permalink: /team/PetroMozil
email: mozil.petryk@gmail.com
---

{% include team-profile.html %}
50 changes: 50 additions & 0 deletions _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
title: "Supporting STL Concurrency Primitives in CLAD"
layout: post
excerpt: "Support for STL concurrency features in CLAD is a useful feature for applications utilizing cpu threads. Many applications of autodifferentiation benefit from parallel or concurrent processing, and support for some STL concurrency primitives such as threads and basic synchronization primitives may considerably simplify the user's design."
sitemap: false
author: Petro Mozil
permalink: blogs/gsoc25_/

Check failure on line 7 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`blogs` is not a recognized word. (unrecognized-spelling)
banner_image: /images/blog/gsoc-banner.png
date: 2025-05-18
tags: gsoc llvm clang audo-differentiation

Check failure on line 10 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`audo` is not a recognized word. (unrecognized-spelling)

Check failure on line 10 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`llvm` is not a recognized word. (unrecognized-spelling)
---

## About me

I am Petro Mozil, a student participating in the Google Summer of Code program in 2025.
I will work on adding support of STL conurrency primitives to CLAD.

Check failure on line 16 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`conurrency` is not a recognized word. (unrecognized-spelling)

## Problem description

`Clad` is a plugin for automatic differentiation for the `clang` compiler.
Automatic differentiation is a term for multiple techniques of deriving a mathematical function non-analytically. Some of the ways of doing this include simply calculating the derivatiev numberically or by deriving a function by a set of rules, symbolically.

Check failure on line 21 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`numberically` is not a recognized word. (unrecognized-spelling)

Check failure on line 21 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`derivatiev` is not a recognized word. (unrecognized-spelling)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Automatic differentiation is a term for multiple techniques of deriving a mathematical function non-analytically. Some of the ways of doing this include simply calculating the derivatiev numberically or by deriving a function by a set of rules, symbolically.
Automatic differentiation is a term for multiple techniques of deriving a mathematical function analytically. Some of the ways of doing this include simply calculating the derivative numerically or by deriving a function by a set of rules, symbolically.

Why non-analytically?


`Clad` provides an interface that returns an object that containd the derivative of a given function. There might be problems with some functions, if they are to be derived. For example, one would not derive `printf`, and neither would they derive `std::tread` - those are exceptions, and should be handled differently from mathematical functions.

Check failure on line 23 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`containd` is not a recognized word. (unrecognized-spelling)

The main goals of this project are to implement support for automatically derive functions that contain `std::thread` so that the user wouldn't have to separate the multi-processing logic from the mathematical functions - such a feature would be a great time-saver for production of multi-processing code.

## Objectives

The objectives for thi project include adding support for multiple objects in STL, such as `std::thread`, `std::atomic`, `std::mutex`.

Check failure on line 29 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`thi` is not a recognized word. (unrecognized-spelling)

The first, and, likely, most important part of the project is to add support for `std::thread` - this will include deriving not the `std::thread` constructor, but deriving the function suppliend for the thread.

Check failure on line 31 in _posts/2025-05-18-Supporting-STL-concurrency-primitives-in-clad.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`suppliend` is not a recognized word. (unrecognized-spelling)

Support for mutexes is a bit more straighforward - though `clad` creates a second object to represent the derived value, it shouldn't do so for a mutex. It is a matter of having a custom derivative for `std::mutex`.

Atomics will likely involve moer effort - they would require custom derivatives for `compare_exchange` functions as well as their methods.

If time allows, I would also like to add support for `std::condition_variable`, `std::lock_guard`, `std::unique_lock` and `std::jthread`, and most of those would also only involve a custom derivative.


## Conclusion

A a result of this project, support for the concurrency primitives is expected. Clad should seamlessly derive functions with concurrency primitives in them.
Though this project does not focus on features immediately reuired from `clad`, it should result in making easier the lives of those, who use clad for high-perf computing.

## Related links

- [LLVM Repository](https://github.com/llvm/llvm-project)
- [CLAD repository](https://github.com/vgvassilev/clad)
- [Project description](https://hepsoftwarefoundation.org/gsoc/2025/proposal_Clad-STLConcurrency.html)
- [My github](https://github.com/pmozil)
Binary file added assets/docs/petro_mozil_promosal_GSoC_2025.pdf
Binary file not shown.
Binary file added images/team/PetroMozil.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
0