brky.ai
TUSAŞ LiftUp Program — Computational Physics TUSAŞ LiftUp Programı — Hesaplamalı Fizik

GPU-Accelerated Poisson Solver for Complex Geometries Karmaşık Geometrilerde GPU-Hızlandırılmış Poisson Çözücü

A high-performance Poisson equation solver using Jacobi iteration on CUDA, with binary mask domain representation and machine learning-assisted initial guesses. Developed for electrostatic analysis on arbitrary geometries under Dirichlet boundary conditions. CUDA üzerinde Jacobi iterasyonu kullanan, binary mask domain temsili ve makine öğrenimi destekli başlangıç tahminleriyle yüksek performanslı bir Poisson denklemi çözücüsü. Dirichlet sınır koşulları altında keyfi geometrilerde elektrostatik analiz için geliştirilmiştir.

Marmara University, Department of Physics — Advisor: Prof. Dr. Erdi Ata Bleda Marmara Üniversitesi, Fizik Bölümü — Danışman: Prof. Dr. Erdi Ata Bleda

CUDA C/C++ Poisson PDE Jacobi FDM Deep Learning Team: Schrödinger's Siths — Berkay Yılmaz · Ahmet Ali Akkurt · Mehmet Dündar Ekip: Schrödinger's Siths — Berkay Yılmaz · Ahmet Ali Akkurt · Mehmet Dündar
§1 — Why Does the Poisson Equation Matter? §1 — Poisson Denklemi Neden Önemli?

The Poisson Equation in Physics and Engineering Fizik ve Mühendislikte Poisson Denklemi

The Poisson equation $\nabla^2\phi = f$ is one of the most fundamental partial differential equations in physics. It links a field's curvature (how the potential bends in space) to the source that generates it. Whenever we ask "given some source distribution, what does the resulting field look like everywhere?", we are solving a Poisson problem. Poisson denklemi $\nabla^2\phi = f$, fiziğin en temel kısmi diferansiyel denklemlerinden biridir. Bir alanın eğriliğini (potansiyelin uzayda nasıl büküldüğünü) onu üreten kaynağa bağlar. "Verilen bir kaynak dağılımı için ortaya çıkan alan her yerde nasıl görünür?" sorusunu her sorduğumuzda, bir Poisson problemi çözüyoruzdur.

Where Does It Appear? Nerelerde Karşımıza Çıkar?

01

ElectrostaticsElektrostatik

Given a charge distribution $\rho(\mathbf{r})$, find the electric potential $\phi$ everywhere. Aircraft fuselage charging, circuit board field analysis, capacitor design — all reduce to solving $\nabla^2\phi = -4\pi\rho$. Verilen bir yük dağılımı $\rho(\mathbf{r})$ için, elektrik potansiyeli $\phi$'yi her yerde bul. Uçak gövde yüklenmesi, baskı devre alan analizi, kapasitör tasarımı — hepsi $\nabla^2\phi = -4\pi\rho$ çözümüne indirgenir.

02

Heat ConductionIsı İletimi

In steady-state heat transfer, temperature distribution satisfies $\nabla^2 T = -q/k$ where $q$ is internal heat generation and $k$ is thermal conductivity. Engine cooling, electronic thermal management, and structural analysis all depend on this. Kararlı hal ısı transferinde, sıcaklık dağılımı $\nabla^2 T = -q/k$ denklemini sağlar; burada $q$ iç ısı üretimi ve $k$ ısıl iletkenlik. Motor soğutma, elektronik termal yönetim ve yapısal analiz buna bağlıdır.

03

Fluid DynamicsAkışkanlar Dinamiği

In incompressible Navier-Stokes solvers, enforcing the divergence-free condition $\nabla \cdot \mathbf{u} = 0$ requires solving a pressure Poisson equation $\nabla^2 p = -\rho\,\nabla\cdot(\mathbf{u}\cdot\nabla\mathbf{u})$ at every time step — the single most expensive operation in the simulation. Sıkıştırılamaz Navier-Stokes çözücülerinde, diverjansız koşul $\nabla \cdot \mathbf{u} = 0$'ı sağlamak her zaman adımında bir basınç Poisson denklemi $\nabla^2 p = -\rho\,\nabla\cdot(\mathbf{u}\cdot\nabla\mathbf{u})$ çözmeyi gerektirir — simülasyondaki en pahalı işlem.

04

Gravitational FieldsKütleçekim Alanları

In astrophysical N-body simulations and cosmological structure formation, the gravitational potential satisfies $\nabla^2\Phi = 4\pi G\rho$. Galaxy formation models solve this on enormous grids at each time step. Astrofiziksel N-cisim simülasyonlarında ve kozmolojik yapı oluşumunda, kütleçekim potansiyeli $\nabla^2\Phi = 4\pi G\rho$ denklemini sağlar. Galaksi oluşum modelleri her zaman adımında bunu devasa gridlerde çözer.

Why Fast Solving Matters Hızlı Çözüm Neden Kritik

In CFD applications, the Poisson solve is performed at every single time step, often consuming 60–80% of total computation time. For a transient 3D simulation with $10^5$ time steps on a $1024^3$ grid, the Poisson solver is called hundreds of thousands of times. A 2× improvement in Poisson solve speed can translate to weeks of saved wall-clock time on cluster resources. This is precisely why GPU-accelerated solvers are not a luxury — they are a practical necessity for production-scale simulations. CFD uygulamalarında, Poisson çözümü her bir zaman adımında yapılır ve toplam hesaplama süresinin genellikle %60–80'ini tüketir. $1024^3$ grid üzerinde $10^5$ zaman adımlı bir geçişli 3B simülasyon için Poisson çözücü yüz binlerce kez çağrılır. Poisson çözüm hızındaki 2× iyileşme, küme kaynaklarında haftalarca duvar saati süresinden tasarruf anlamına gelebilir. GPU-hızlandırılmış çözücülerin bir lüks değil, üretim ölçeğinde simülasyonlar için pratik bir gereklilik olmasının sebebi budur.

Challenges in the Literature Literatürdeki Problemler

Building a high-performance Poisson solver for realistic geometries is far from straightforward. Four key challenges recur across the literature: Gerçekçi geometriler için yüksek performanslı bir Poisson çözücü oluşturmak hiç de kolay değildir. Literatürde dört temel problem sürekli karşımıza çıkar:

Complex GeometriesKarmaşık Geometriler

FFT-based solvers are blazingly fast for uniform rectangular grids with periodic boundaries. But realistic shapes — aircraft wing profiles, electronic circuit layouts — break the periodicity assumption. Direct FFT is either impractical or requires expensive domain embedding. FFT tabanlı çözücüler periyodik sınırlı düzenli dikdörtgen gridler için son derece hızlıdır. Ancak gerçekçi şekiller — uçak kanat profilleri, elektronik devre düzenleri — periyodiklik varsayımını bozar. Doğrudan FFT ya pratik değildir ya da pahalı domain gömme gerektirir.

Halo ProblemHalo Problemi

Finite difference stencils create data dependencies between neighboring grid points. When the domain is split across processors (or GPUs), boundary points need neighbor data owned by adjacent partitions. This inter-process communication — the "halo exchange" — becomes a bottleneck, especially at scale. Sonlu fark stencilleri komşu grid noktaları arasında veri bağımlılıkları yaratır. Domain işlemcilere (veya GPU'lara) bölündüğünde, sınır noktaları komşu bölümlere ait veriye ihtiyaç duyar. Bu işlemciler arası iletişim — "halo değişimi" — özellikle ölçekte bir darboğaz haline gelir.

Speed vs AccuracyHız ve Hassasiyet

For iterative solvers on complex geometries, convergence speed and accuracy are tightly coupled to the initial guess quality. A poor starting point means thousands of wasted iterations. This motivates multi-grid and ML-assisted approaches that provide intelligent warm starts. Karmaşık geometrilerdeki iteratif çözücüler için yakınsama hızı ve hassasiyet, başlangıç tahmini kalitesiyle sıkı biçimde bağlıdır. Kötü bir başlangıç noktası binlerce boşa harcanan iterasyon demektir. Bu durum, akıllı sıcak başlangıçlar sağlayan multi-grid ve ML destekli yaklaşımları motive eder.

Boundary ConditionsSınır Koşulları

When boundary contours cannot be expressed as analytical functions, their numerical representation on the grid introduces interpolation errors. Proper boundary handling — especially for curved surfaces on Cartesian grids — directly affects solution accuracy and convergence. Sınır konturları analitik fonksiyonlarla ifade edilemediğinde, grid üzerindeki sayısal temsilleri interpolasyon hataları yaratır. Özellikle Kartezyen gridler üzerinde eğri yüzeyler için doğru sınır işleme, çözüm doğruluğunu ve yakınsamayı doğrudan etkiler.

Our project addresses all four: we use binary masking to handle arbitrary geometries (§3), asynchronous halo exchange to hide communication latency (§5), multi-grid and neural-network warm starts for fast convergence (§6), and careful boundary treatment at domain contours. Projemiz dördünü de ele alır: keyfi geometrileri işlemek için binary maskeleme (§3), iletişim gecikmesini gizlemek için asenkron halo değişimi (§5), hızlı yakınsama için multi-grid ve sinir ağı sıcak başlangıçları (§6) ve domain konturlarında dikkatli sınır işleme kullanırız.

§2 — Deriving the Poisson Equation from Maxwell §2 — Poisson Denklemini Maxwell'den Türetme

From Maxwell to Poisson Maxwell'den Poisson'a

The Poisson equation is not an arbitrary mathematical construction — it emerges directly from the fundamental laws of electromagnetism. In the electrostatic limit, two of Maxwell's equations combine to produce it. Poisson denklemi keyfi bir matematiksel yapı değildir — doğrudan elektromanyetizmanın temel yasalarından çıkar. Elektrostatik limitte, Maxwell denklemlerinden ikisi birleşerek onu üretir.

Step 1 — Gauss's Law (differential form) Adım 1 — Gauss Yasası (diferansiyel form)

In Gaussian units, Gauss's law relates the divergence of the electric field to the charge density: Gauss birim sisteminde, Gauss yasası elektrik alanın diverjansını yük yoğunluğuna bağlar:

$$\nabla \cdot \mathbf{E}(\mathbf{r}) = 4\pi\rho(\mathbf{r})$$
Step 2 — Electrostatic potential definition Adım 2 — Elektrostatik potansiyel tanımı

In electrostatics, $\nabla \times \mathbf{E} = 0$ (Faraday with no time variation), so the electric field can be written as the gradient of a scalar potential: Elektrostatikte $\nabla \times \mathbf{E} = 0$ (zamana bağlılık olmayan Faraday) olduğundan, elektrik alanı bir skaler potansiyelin gradyanı olarak yazılabilir:

$$\mathbf{E}(\mathbf{r}) = -\nabla\phi(\mathbf{r})$$
Step 3 — Substitution Adım 3 — Yerine koyma

Substituting the potential into Gauss's law: Potansiyeli Gauss yasasına koyarsak:

$$\nabla \cdot (-\nabla\phi) = 4\pi\rho \quad\Longrightarrow\quad -\nabla^2\phi(\mathbf{r}) = 4\pi\rho(\mathbf{r})$$
Step 4 — Poisson equation (Gaussian units) Adım 4 — Poisson denklemi (Gauss birimleri)
$$\boxed{\nabla^2\phi(\mathbf{r}) = -4\pi\rho(\mathbf{r})}$$
Eq. 1 — Poisson equation in Gaussian units, following Jackson (1975) Denk. 1 — Gauss birimlerinde Poisson denklemi, Jackson (1975)

Here $\phi(\mathbf{r})$ is the electrostatic potential and $\rho(\mathbf{r})$ is the charge density. When the charge distribution is known and boundary conditions are specified, finding $\phi$ everywhere in the domain is the core computational problem. For grounded conductors with complex shapes — like aircraft fuselage cross-sections — we apply Dirichlet boundary conditions ($\phi = 0$ on the conductor surface). Burada $\phi(\mathbf{r})$ elektrostatik potansiyel, $\rho(\mathbf{r})$ ise yük yoğunluğudur. Yük dağılımı biliniyor ve sınır koşulları belirlendiğinde, $\phi$'yi domainin her yerinde bulmak temel hesaplama problemidir. Karmaşık şekillere sahip topraklanmış iletkenler için — uçak gövde kesitleri gibi — Dirichlet sınır koşulları uygulanır (iletken yüzeyinde $\phi = 0$).

§3 — Discretization: From PDE to Linear System §3 — Diskritizasyon: PDE'den Lineer Sisteme

Finite Difference Method Sonlu Farklar Yöntemi

To solve the Poisson equation numerically, we discretize the continuous domain onto a uniform Cartesian grid with spacing $h$. The Laplacian operator $\nabla^2$ is approximated using the finite difference method (FDM), which we derive from the Taylor expansion. Poisson denklemini sayısal olarak çözmek için, sürekli domaini $h$ adım büyüklüğüne sahip düzenli bir Kartezyen ızgara üzerine diskritize ederiz. Laplasyen operatörü $\nabla^2$, Taylor açılımından türettiğimiz sonlu farklar yöntemi (FDM) ile yaklaşıklanır.

Taylor Series Derivation of the Second Derivative İkinci Türevin Taylor Serisi Türetmesi

Step 1 — Forward and backward Taylor expansion Adım 1 — İleri ve geri Taylor açılımı

Expand $f(x+h)$ and $f(x-h)$ around point $x$: $f(x+h)$ ve $f(x-h)$'ı $x$ noktası etrafında açalım:

$$f(x+h) = f(x) + hf'(x) + \frac{h^2}{2}f''(x) + \frac{h^3}{6}f'''(x) + \mathcal{O}(h^4)$$ $$f(x-h) = f(x) - hf'(x) + \frac{h^2}{2}f''(x) - \frac{h^3}{6}f'''(x) + \mathcal{O}(h^4)$$
Step 2 — Sum the two expansions Adım 2 — İki açılımı topla

The odd-order terms cancel: Tek dereceli terimler sadeleşir:

$$f(x+h) + f(x-h) = 2f(x) + h^2 f''(x) + \mathcal{O}(h^4)$$
Step 3 — Solve for second derivative Adım 3 — İkinci türev için çöz
$$\boxed{f''(x) = \frac{f(x+h) - 2f(x) + f(x-h)}{h^2} + \mathcal{O}(h^2)}$$
Eq. 2 — Central difference approximation, second-order accurate Denk. 2 — Merkezi fark yaklaşımı, ikinci dereceden doğru

The 5-Point Stencil 5 Noktalı Stencil

Applying the central difference formula (Eq. 2) to both $x$ and $y$ directions on a 2D grid where $(x_i, y_j) = (ih, jh)$: Merkezi fark formülünü (Denk. 2) $(x_i, y_j) = (ih, jh)$ olan 2B ızgara üzerinde hem $x$ hem $y$ yönlerinde uygularsak:

Discrete Laplacian Ayrık Laplasyen
$$\nabla^2\phi\big|_{i,j} \;\approx\; \frac{\phi_{i+1,j} + \phi_{i-1,j} + \phi_{i,j+1} + \phi_{i,j-1} - 4\phi_{i,j}}{h^2}$$
Poisson equation on the grid Izgara üzerinde Poisson denklemi
$$\frac{\phi_{i+1,j} + \phi_{i-1,j} + \phi_{i,j+1} + \phi_{i,j-1} - 4\phi_{i,j}}{h^2} = f_{i,j}$$

where $f_{i,j}$ is the source term at grid point $(i,j)$. For the electrostatic case, $f = -4\pi\rho$. burada $f_{i,j}$ grid noktası $(i,j)$'deki kaynak terimidir. Elektrostatik durum için $f = -4\pi\rho$.

Eq. 3 — Discretized 2D Poisson equation using the 5-point stencil Denk. 3 — 5 noktalı stencil ile diskritize 2B Poisson denklemi

The stencil pattern shows how each grid point depends on its four nearest neighbors. This local dependency is what makes the method highly parallelizable on GPU architectures — but it also introduces the halo problem when the grid is split across multiple processors. Stencil paterni, her ızgara noktasının en yakın dört komşusuna nasıl bağlı olduğunu gösterir. Bu yerel bağımlılık, yöntemi GPU mimarilerinde yüksek oranda paralelleştirilebilir kılar — ancak grid birden fazla işlemciye bölündüğünde halo problemini de ortaya çıkarır.

$\phi_{i-1,j}$
$\phi_{i,j-1}$
$-4\phi_{i,j}$
$\phi_{i,j+1}$
$\phi_{i+1,j}$
Fig. 1 — The 5-point stencil. Each interior point is updated using its 4 neighbors. Şekil 1 — 5 noktalı stencil. Her iç nokta 4 komşusu kullanılarak güncellenir.

This discretization transforms the continuous PDE into a large sparse linear system $A\mathbf{x} = \mathbf{b}$, where $A$ is a pentadiagonal matrix, $\mathbf{x}$ contains the unknown potential values at each grid point, and $\mathbf{b}$ encodes the source distribution and boundary conditions. For a $500 \times 500$ grid, this means a system of $250{,}000$ unknowns. For $2048 \times 2048$, it grows to over 4 million — well beyond direct solvers, motivating the iterative approaches in §4. Bu diskritizasyon, sürekli PDE'yi büyük bir seyrek lineer sisteme $A\mathbf{x} = \mathbf{b}$ dönüştürür; burada $A$ pentadiyagonal bir matristir, $\mathbf{x}$ her ızgara noktasındaki bilinmeyen potansiyel değerlerini içerir ve $\mathbf{b}$ kaynak dağılımını ve sınır koşullarını kodlar. $500 \times 500$'lük bir ızgara için bu, $250{,}000$ bilinmeyenli bir sistem demektir. $2048 \times 2048$ için 4 milyonun üzerine çıkar — doğrudan çözücülerin çok ötesinde, §4'teki iteratif yaklaşımları motive eder.

§4 — Complex Geometries: Binary Mask Approach §4 — Karmaşık Geometriler: Binary Mask Yaklaşımı

Domain Representation with Binary Masking Binary Maskeleme ile Domain Temsili

Real-world physical systems rarely possess simple rectangular shapes. Our approach uses a binary mask matrix $M(i,j)$ on the Cartesian grid: Gerçek dünya fiziksel sistemleri nadiren basit dikdörtgen şekillere sahiptir. Yaklaşımımız, Kartezyen ızgara üzerinde bir ikili maske matrisi $M(i,j)$ kullanır:

$$M(i,j) = \begin{cases} 1 & \text{if } (i,j) \in \Omega \quad \text{(solve Poisson here)} \\ 0 & \text{if } (i,j) \notin \Omega \quad \text{(skip computation)} \end{cases}$$
Eq. 4 — Binary mask definition. $\Omega$ is the computational domain. Denk. 4 — Binary mask tanımı. $\Omega$ hesaplama domainidir.

The boundary of the domain — where $M$ transitions from 1 to 0 — is where we enforce Dirichlet conditions ($\phi = 0$ on the contour). Any geometry representable as a black-and-white image can serve as input. We demonstrated this by using a 2D cross-section of the TUSAŞ KAAN fighter aircraft as the computational domain. Domainin sınırı — $M$'nin 1'den 0'a geçtiği yer — Dirichlet koşullarını uyguladığımız yerdir (kontür üzerinde $\phi = 0$). Siyah-beyaz görsel olarak temsil edilebilen herhangi bir geometri girdi olarak kullanılabilir. Bunu TUSAŞ KAAN savaş uçağının 2B kesitini hesaplama domaini olarak kullanarak gösterdik.

Image-to-Mask Pipeline Görselden Maskeye Dönüşüm Süreci

The key innovation is that any geometry can be imported as a standard image file. The conversion from a photograph or CAD rendering to a computable binary mask follows a four-step pipeline: Temel yenilik, herhangi bir geometrinin standart bir görüntü dosyası olarak içe aktarılabilmesidir. Bir fotoğraftan veya CAD görselinden hesaplanabilir bir binary maskeye dönüşüm dört adımlı bir pipeline izler:

① ORIGINAL RGB Image grayscale ② GRAYSCALE L = 0.299R+0.587G+0.114B threshold ③ BINARY M=1 M=0 L > τ → 0, else → 1 discretize ④ MASK GRID M(i,j) → Cartesian grid Boundary contour (M: 1→0 transition) = Dirichlet condition φ = 0 | Black (M=1) = solve Poisson | White (M=0) = skip Any image → Any geometry → Computable domain
Fig. — Image-to-mask pipeline: any photograph or CAD rendering is converted through grayscale → threshold → binary mask → Cartesian grid. The blue-highlighted cell marks the boundary where Dirichlet condition φ = 0 is enforced. Şekil — Görselden maskeye pipeline: herhangi bir fotoğraf veya CAD görseli gri tonlama → eşikleme → ikili maske → Kartezyen ızgara dönüşümünden geçer. Mavi vurgulanan hücre, φ = 0 Dirichlet koşulunun uygulandığı sınırı işaretler.

Test Geometry: Heart-Shaped Domain Test Geometrisi: Kalp Şekilli Domain

For systematic benchmarking, we used an algebraic heart curve: Sistematik karşılaştırma testleri için cebirsel bir kalp eğrisi kullandık:

$$(x^2 + y^2 - 1)^3 - x^2 y^3 \leq 0$$

with the source term $\rho(x,y) = \sin(x)\cos(y)$ over the domain $[-1.5, 1.5]^2$. kaynak terimi $\rho(x,y) = \sin(x)\cos(y)$ ile, $[-1.5, 1.5]^2$ domaini üzerinde.

Eq. 5 — Heart-shaped domain boundary and test charge distribution Denk. 5 — Kalp şekilli domain sınırı ve test yük dağılımı
Fig. 2 — Binary mask for the heart-shaped domain on a 200×200 grid Şekil 2 — 200×200 ızgara üzerinde kalp şekilli domainin binary maskesi

Mask ImplementationMask Uygulaması

mask_generation.c C
int isInsideHeart(double x, double y) {
    double expr = (x * x + y * y - 1.0);
    double val = (expr * expr * expr) - (x * x * y * y * y);
    return (val <= 0.0) ? 1 : 0;
}

// build the mask matrix over the Cartesian grid
for (int i = 0; i < GRID_SIZE; i++) {
    for (int j = 0; j < GRID_SIZE; j++) {
        int idx = i * GRID_SIZE + j;
        mask[idx] = isInsideHeart(xVals[i], yVals[j]);
    }
}
§5 — Iterative Methods: Ahmet's Comparative Study §5 — İteratif Yöntemler: Ahmet'in Karşılaştırmalı Çalışması

Why Iterative Methods? Neden İteratif Yöntemler?

For a $2048\times2048$ grid, the linear system has over 4 million unknowns. Direct methods (LU decomposition, Cholesky) would require $\mathcal{O}(N^3)$ operations and $\mathcal{O}(N^2)$ memory — completely infeasible. Iterative methods start from an initial guess and progressively refine it, exploiting the sparse structure of the matrix. The question is: which iterative method gives the best balance of convergence speed, parallelizability, and implementation complexity? $2048\times2048$ grid için lineer sistemde 4 milyonun üzerinde bilinmeyen vardır. Doğrudan yöntemler (LU ayrıştırma, Cholesky) $\mathcal{O}(N^3)$ işlem ve $\mathcal{O}(N^2)$ bellek gerektirir — tamamen uygulanabilir değildir. İteratif yöntemler bir başlangıç tahmininden başlayıp matrisin seyrek yapısından faydalanarak onu aşamalı olarak iyileştirir. Soru şudur: hangi iteratif yöntem yakınsama hızı, paralelleştirilebilirlik ve uygulama karmaşıklığı arasında en iyi dengeyi verir?

Ahmet Ali Akkurt implemented all six methods from scratch in C/C++, ran systematic benchmarks on the heart domain, and characterized their convergence properties. This section represents his primary research contribution to the project. Ahmet Ali Akkurt altı yöntemin tamamını C/C++ ile sıfırdan kodladı, kalp domaininde sistematik benchmark'lar çalıştırdı ve yakınsama özelliklerini karakterize etti. Bu bölüm onun projeye temel araştırma katkısını temsil eder.

1. Jacobi Iteration1. Jacobi İterasyonu

Jacobi

Parallelization: ExcellentParalelleştirme: Mükemmel

The simplest fixed-point iteration. Each grid point is updated using only values from the previous iteration — no within-step dependency: En basit sabit nokta iterasyonu. Her grid noktası yalnızca önceki iterasyonun değerleri kullanılarak güncellenir — adım içi bağımlılık yok:

$$\phi_{i,j}^{(k+1)} = \frac{1}{4}\left(\phi_{i-1,j}^{(k)} + \phi_{i+1,j}^{(k)} + \phi_{i,j-1}^{(k)} + \phi_{i,j+1}^{(k)} + 4\pi h^2\rho_{i,j}\right)$$

Convergence: linear, spectral radius $\rho(T_J) = \cos(\pi h) \approx 1 - \frac{\pi^2 h^2}{2}$. Slow for fine grids, but each update is embarrassingly parallel — every thread can work independently. Yakınsama: lineer, spektral yarıçap $\rho(T_J) = \cos(\pi h) \approx 1 - \frac{\pi^2 h^2}{2}$. İnce gridlerde yavaş, ama her güncelleme utanılacak derecede paralel — her thread bağımsız çalışabilir.

2. Gauss-Seidel2. Gauss-Seidel

Gauss-Seidel (GS)

Parallelization: PoorParalelleştirme: Zayıf

Uses the most recently computed values within the same iteration sweep — if the point to the left and below have already been updated, use those new values immediately: Aynı iterasyon geçişi içinde en son hesaplanan değerleri kullanır — sol ve alttaki noktalar zaten güncellendiyse, o yeni değerleri hemen kullan:

$$\phi_{i,j}^{(k+1)} = \frac{1}{4}\left(\phi_{i-1,j}^{(k+1)} + \phi_{i+1,j}^{(k)} + \phi_{i,j-1}^{(k+1)} + \phi_{i,j+1}^{(k)} + 4\pi h^2\rho_{i,j}\right)$$

Converges ~2× faster than Jacobi ($\rho(T_{GS}) = \cos^2(\pi h)$), but the sequential data dependency makes GPU parallelization essentially impossible without modifications. Jacobi'den ~2× hızlı yakınsar ($\rho(T_{GS}) = \cos^2(\pi h)$), ancak sıralı veri bağımlılığı modifikasyon olmadan GPU paralelleştirmesini esasen imkansız kılar.

3. Red-Black Gauss-Seidel3. Red-Black Gauss-Seidel

Red-Black GS (RBGS)

Parallelization: Good (2-phase)Paralelleştirme: İyi (2 fazlı)

Colors the grid like a checkerboard. Red points depend only on black neighbors and vice versa. Within each color phase, all updates are independent: Gridi satranç tahtası gibi renklendirir. Kırmızı noktalar yalnızca siyah komşulara bağlıdır ve tersi. Her renk fazı içinde tüm güncellemeler bağımsızdır:

Phase 1: Update all red $(i+j)$ even points using black neighbors
Phase 2: Update all black $(i+j)$ odd points using updated red neighbors
Faz 1: Tüm kırmızı $(i+j)$ çift noktaları siyah komşuları kullanarak güncelle
Faz 2: Tüm siyah $(i+j)$ tek noktaları güncellenmiş kırmızı komşuları kullanarak güncelle

Same convergence rate as standard GS, but each phase is fully parallelizable. Requires a synchronization barrier between phases. Standart GS ile aynı yakınsama oranı, ama her faz tamamen paralelleştirilebilir. Fazlar arasında bir senkronizasyon bariyeri gerektirir.

4. Averaged Red-Black Gauss-Seidel (ARBGS)4. Ortalamalı Red-Black Gauss-Seidel (ARBGS)

ARBGS

Parallelization: GoodParalelleştirme: İyi

A variant of RBGS with periodic averaging steps that smooth out high-frequency error components. Every $m$ iterations, the solution is blended with a local average: Yüksek frekanslı hata bileşenlerini yumuşatan periyodik ortalama adımları içeren bir RBGS varyantı. Her $m$ iterasyonda çözüm yerel bir ortalama ile harmanlanır:

$$\phi_{i,j}^{*} = \alpha\,\phi_{i,j}^{(k)} + (1-\alpha)\,\overline{\phi}_{i,j}^{(k)}$$

where $\overline{\phi}$ is the 4-neighbor average and $\alpha$ is a smoothing parameter. Provides marginally better convergence than plain RBGS with minimal overhead. burada $\overline{\phi}$ 4-komşu ortalaması ve $\alpha$ bir yumuşatma parametresidir. Minimum ek yükle düz RBGS'den biraz daha iyi yakınsama sağlar.

5. Conjugate Gradient (CG)5. Eşlenik Gradyan (CG)

CG

Parallelization: ModerateParalelleştirme: Orta

A Krylov subspace method that minimizes the error in the $A$-norm at each step. Generates conjugate search directions that guarantee no previously explored direction is revisited: Her adımda hatayı $A$-normunda minimize eden bir Krylov altuzay yöntemi. Daha önce keşfedilen hiçbir yönün tekrar ziyaret edilmeyeceğini garanti eden eşlenik arama yönleri üretir:

$$\mathbf{r}_k = \mathbf{b} - A\mathbf{x}_k, \quad \alpha_k = \frac{\mathbf{r}_k^T \mathbf{r}_k}{\mathbf{p}_k^T A\mathbf{p}_k}, \quad \mathbf{x}_{k+1} = \mathbf{x}_k + \alpha_k \mathbf{p}_k$$

Converges in at most $N$ iterations (theoretically), with superlinear convergence in practice. But each iteration requires a global dot product (MPI_Allreduce) and a sparse matrix-vector multiply — both adding communication overhead on distributed systems. (Teorik olarak) en fazla $N$ iterasyonda yakınsar, pratikte süperlineer yakınsama gösterir. Ancak her iterasyon global bir iç çarpım (MPI_Allreduce) ve seyrek matris-vektör çarpımı gerektirir — ikisi de dağıtık sistemlerde iletişim yükü ekler.

6. Preconditioned Conjugate Gradient (PCG)6. Ön Koşullu Eşlenik Gradyan (PCG)

PCG

Parallelization: Preconditioner-dependentParalelleştirme: Preconditioner'a bağlı

CG accelerated with a preconditioner $M^{-1} \approx A^{-1}$ that improves the condition number $\kappa(M^{-1}A) \ll \kappa(A)$. The preconditioner effectively clusters the eigenvalues, making CG converge in fewer steps: Koşul sayısını iyileştiren bir preconditioner $M^{-1} \approx A^{-1}$ ile hızlandırılmış CG. $\kappa(M^{-1}A) \ll \kappa(A)$. Preconditioner özdeğerleri efektif olarak kümelendirerek CG'nin daha az adımda yakınsamasını sağlar:

$$M\mathbf{z}_k = \mathbf{r}_k, \quad \alpha_k = \frac{\mathbf{r}_k^T \mathbf{z}_k}{\mathbf{p}_k^T A\mathbf{p}_k}, \quad \mathbf{x}_{k+1} = \mathbf{x}_k + \alpha_k \mathbf{p}_k$$

Fastest in terms of iteration count, but the preconditioner solve $M\mathbf{z} = \mathbf{r}$ adds per-iteration cost. Popular preconditioners (ILU, AMG) are inherently sequential, limiting GPU parallelism. İterasyon sayısı açısından en hızlı, ancak preconditioner çözümü $M\mathbf{z} = \mathbf{r}$ iterasyon başına maliyet ekler. Popüler preconditioner'lar (ILU, AMG) doğası gereği sıralıdır ve GPU paralelizmini sınırlar.

Benchmark ComparisonBenchmark Karşılaştırması

Ahmet ran all six methods on a 500×500 heart domain with $\rho(x,y) = \sin(x)\cos(y)$ and tolerance $10^{-10}$. The table summarizes both convergence characteristics and GPU suitability: Ahmet altı yöntemin tamamını 500×500 kalp domaininde $\rho(x,y) = \sin(x)\cos(y)$ ve $10^{-10}$ tolerans ile çalıştırdı. Tablo hem yakınsama özelliklerini hem de GPU uygunluğunu özetler:

MethodYöntem Iterationsİterasyon CPU TimeCPU Süresi GPU SuitabilityGPU Uygunluğu Data DependencyVeri Bağımlılığı
Jacobi ~180,000 29.0 s ExcellentMükemmel NoneYok
Gauss-Seidel ~90,000 14.2 s PoorZayıf SequentialSıralı
Red-Black GS ~90,000 14.8 s Goodİyi 2-phase sync2 fazlı senkron
ARBGS ~82,000 13.9 s Goodİyi 2-phase + smoothing2 faz + smoothing
CG ~450 2.1 s ModerateOrta Global reductionsGlobal indirgeme
PCG ~180 1.8 s ModerateOrta Global + preconditionerGlobal + preconditioner
Fig. 3 — Convergence comparison of iterative methods on the 500×500 heart domain (log-scale residual vs iteration) Şekil 3 — 500×500 kalp domaininde iteratif yöntemlerin yakınsama karşılaştırması (log-ölçek artık vs iterasyon)

Why We Chose Jacobi Despite Slower Convergence Daha Yavaş Yakınsamaya Rağmen Neden Jacobi Seçtik

The benchmark results above make the case for CG/PCG look overwhelming — 180 iterations versus 180,000. So why would anyone pick Jacobi? The answer lies in the project's primary goal: multi-GPU scalability as a first priority. Yukarıdaki benchmark sonuçları CG/PCG lehine baskın görünür — 180 iterasyona karşı 180,000. Peki neden Jacobi seçilir? Cevap projenin birincil hedefinde yatar: ilk öncelik olarak çoklu GPU ölçeklenebilirliği.

Jacobi's update rule has zero data dependency within each iteration. Every thread independently reads from the previous iteration's buffer and writes to a new buffer. There are no race conditions, no sequential sweeps, no global reductions during the stencil compute. This translates directly to: Jacobi'nin güncelleme kuralının her iterasyon içinde sıfır veri bağımlılığı vardır. Her thread önceki iterasyonun tamponundan bağımsız olarak okur ve yeni bir tampona yazar. Yarış koşulu yok, sıralı tarama yok, stencil hesaplaması sırasında global indirgeme yok. Bu doğrudan şuna dönüşür:

$$\phi_{i,j}^{(k+1)} = \frac{1}{4}\left(\phi_{i-1,j}^{\color{#7EC8E3}{(k)}} + \phi_{i+1,j}^{\color{#7EC8E3}{(k)}} + \phi_{i,j-1}^{\color{#7EC8E3}{(k)}} + \phi_{i,j+1}^{\color{#7EC8E3}{(k)}} + 4\pi h^2\rho_{i,j}\right)$$
All reads from iteration $k$ (blue) — enabling embarrassingly parallel execution with zero synchronization Tüm okumalar iterasyon $k$'dan (mavi) — sıfır senkronizasyonla utanılacak derecede paralel çalıştırma sağlar

CG and PCG converge orders of magnitude faster, but they require global MPI_Allreduce calls for dot products at every iteration and sequential preconditioner solves. On a 2-GPU system connected via Ethernet, these synchronization points become the dominant cost. We compensate for Jacobi's slow convergence with multi-grid warm starts (§7) and ML-assisted initial guesses (§7), bringing the effective iteration count down by 79%. CG ve PCG büyüklük mertebeleri daha hızlı yakınsar, ancak her iterasyonda iç çarpımlar için global MPI_Allreduce çağrıları ve sıralı preconditioner çözümleri gerektirir. Ethernet üzerinden bağlanan 2 GPU'lu bir sistemde bu senkronizasyon noktaları baskın maliyet olur. Jacobi'nin yavaş yakınsamasını multi-grid sıcak başlangıçları (§7) ve ML destekli başlangıç tahminleri (§7) ile telafi ederek efektif iterasyon sayısını %79 düşürürüz.

§6 — GPU Implementation §6 — GPU Uygulaması

Kernel Development Path Kernel Geliştirme Yolu

The CUDA implementation evolved through three stages, each addressing a specific performance bottleneck: CUDA uygulaması her biri belirli bir performans darboğazını ele alan üç aşamadan geçerek evrildi:

GPU architecture, system design, and CUDA implementation represent Berkay Yılmaz's primary contribution.

GPU mimarisi, sistem tasarımı ve CUDA uygulaması Berkay Yılmaz'ın projeye temel katkısını temsil eder.

Naive Global Memory

1 thread = 1 grid point
All reads from global DRAM
1 thread = 1 grid noktası
Tüm okumalar global DRAM'den

Shared Memory Tiling

16×16 tile → 18×18 shared
~70% less global reads
16×16 tile → 18×18 shared
~%70 daha az global okuma

Async Dual-Kernel

Interior + boundary split
Compute/comm overlap
İç + sınır ayrımı
Hesaplama/iletişim örtüşmesi

GPU Architecture: How We Map Jacobi to CUDA GPU Mimarisi: Jacobi'yi CUDA'ya Nasıl Eşliyoruz

Understanding how the single-GPU solver exploits the hardware requires looking at NVIDIA's execution model. The RTX A4000 has 48 Streaming Multiprocessors (SMs), each capable of executing multiple warps (groups of 32 threads) concurrently. Our mapping strategy directly leverages this hierarchy: Tek GPU çözücünün donanımdan nasıl faydalandığını anlamak, NVIDIA'nın yürütme modelini incelemeyi gerektirir. RTX A4000, her biri birden fazla warp'ı (32 thread grubu) eşzamanlı olarak yürütebilen 48 Streaming Multiprocessor'e (SM) sahiptir. Eşleme stratejimiz bu hiyerarşiden doğrudan yararlanır:

Single GPU — Jacobi Kernel Execution Model 2D GRID (N×N) 16×16 dim3 grid blocks ceil(N/16) × ceil(N/16) maps to THREAD BLOCK (16×16 = 256 threads) __shared__ tile[18][18] ← 1 warp (32 threads) ... × 8 warps = 256 Per-thread stencil read: tile[ty-1][tx] + tile[ty+1][tx] + tile[ty][tx-1] + tile[ty][tx+1] all from shared memory (~1 cycle) MEMORY HIERARCHY Registers ~1 cycle | per-thread private Shared Memory (48 KB/SM) ~5 cycles | per-block tile[18][18] L2 Cache (4 MB) ~30 cycles | GPU-wide Global DRAM (16 GB GDDR6) ~400 cycles | φ, φ_new, f, mask Shared memory tiling: ~70% fewer global reads vs naive kernel RTX A4000: 48 SMs | 6144 CUDA cores | 16 GB GDDR6 | 256-bit bus | 448 GB/s bandwidth Occupancy: 256 threads/block × 48 SMs = 12,288 concurrent threads → ~97% occupancy at 2048²
Fig. — GPU execution model: each 16×16 tile of the grid maps to a CUDA thread block. Threads in a block cooperatively load data into fast shared memory (18×18 tile with halo), then compute the 5-point stencil entirely from shared memory, avoiding costly global DRAM reads. Şekil — GPU yürütme modeli: gridin her 16×16 tile'ı bir CUDA thread bloğuna eşlenir. Bir bloktaki thread'ler, veriyi hızlı shared memory'ye (halo ile 18×18 tile) işbirlikçi olarak yükler, ardından 5-noktalı stencil'i tamamen shared memory'den hesaplayarak maliyetli global DRAM okumalarından kaçınır.

Halo Exchange Between GPUs GPU'lar Arası Halo Değişimi

In the distributed setting, each GPU owns a horizontal strip of the global grid. Jacobi's stencil needs neighbors — including rows owned by adjacent GPUs. We solve this with ghost layers: each local domain is padded by one extra row on top and bottom. The halo exchange protocol ensures these ghost rows contain up-to-date values from the neighboring GPU: Dağıtık sistemde her GPU, global gridin yatay bir dilimini sahiplenir. Jacobi stencil'i komşulara ihtiyaç duyar — komşu GPU'ların sahip olduğu satırlar dahil. Bunu ghost layer'larla çözeriz: her lokal domain üst ve altta birer ekstra satırla genişletilir. Halo değişim protokolü, bu ghost satırların komşu GPU'dan güncel değerler içermesini sağlar:

Halo Exchange — MPI Non-blocking Protocol GPU 0 interior rows (independent compute) interior rows (independent compute) interior rows (independent compute) boundary row → SEND to GPU 1 ghost row ← RECV from GPU 1 GPU 1 ghost row ← RECV from GPU 0 boundary row → SEND to GPU 0 interior rows (independent compute) interior rows (independent compute) interior rows (independent compute) MPI_Isend MPI_Isend Async Overlap Timeline (per iteration) Step: ① Isend/Irecv ② jacobi_kernel_interior (rows 2..Nx_loc-1) halo transfer (hidden under compute) ③ Wait ④ jacobi_kernel_boundary ⑤⑥ Result: communication latency is hidden behind the interior compute → 15-20% speedup
Fig. — Halo exchange protocol: GPU 0's bottom boundary row is sent to GPU 1's top ghost row (and vice versa) using non-blocking MPI. The interior kernel runs on a separate CUDA stream while halos transfer, hiding communication latency. Şekil — Halo değişim protokolü: GPU 0'ın alt sınır satırı, non-blocking MPI ile GPU 1'in üst ghost satırına gönderilir (ve tersi). İç bölge kernel'i, halo transferi sırasında ayrı bir CUDA stream'de çalışarak iletişim gecikmesini gizler.
§7 — Convergence Acceleration: Multi-Grid + Machine Learning §7 — Yakınsama Hızlandırma: Multi-Grid + Makine Öğrenimi

Cascadic Multi-Grid Strategy Kademeli Multi-Grid Stratejisi

Starting Jacobi from $\phi^{(0)} = 0$ on a $2048^2$ grid wastes thousands of iterations converging gross features that could be captured cheaply on a coarser grid. Our cascadic approach solves hierarchically: $2048^2$ grid üzerinde Jacobi'yi $\phi^{(0)} = 0$'dan başlatmak, kaba bir gridde ucuza yakalanabilecek genel özellikleri yakınsamak için binlerce iterasyon harcar. Kademeli yaklaşımımız hiyerarşik olarak çözer:

$$128^2 \;\xrightarrow{\text{solve + interp}}\; 256^2 \;\xrightarrow{\text{solve + interp}}\; 512^2 \;\xrightarrow{\text{solve + interp}}\; 1024^2 \;\xrightarrow{\text{solve + interp}}\; 2048^2$$
Each level provides the initial guess for the next via mask-aware bilinear interpolation Her seviye bir sonrakine mask-aware bilineer interpolasyon ile başlangıç tahmini sağlar

At each interpolation, domain boundaries and Dirichlet conditions ($\phi = 0$ on the contour) are preserved with boundary-aware algorithms. The CUDA implementation uses texture memory for hardware-accelerated bilinear filtering. Result: 79% iteration reduction on the target layer. Her interpolasyonda, domain sınırları ve Dirichlet koşulları ($\phi = 0$ kontür üzerinde) sınır-farkında algoritmalarla korunur. CUDA uygulaması donanım hızlandırmalı bilineer filtreleme için texture memory kullanır. Sonuç: hedef katmanda %79 iterasyon azalması.

ML-Assisted Initial Guess: The Warm-Start Idea ML Destekli Başlangıç Tahmini: Sıcak Başlangıç Fikri

Multi-grid provides a smooth initial guess, but it still starts each level from scratch. The fundamental insight behind our ML approach is this: the mapping from source distribution $\rho$ to solution $\phi$ is a well-defined operator, and a neural network can learn to approximate it. Multi-grid yumuşak bir başlangıç tahmini sağlar, ama her seviyeye yine sıfırdan başlar. ML yaklaşımımızın temel kavrayışı şudur: kaynak dağılımı $\rho$'dan çözüm $\phi$'ye eşleme iyi tanımlı bir operatördür ve bir sinir ağı bunu yaklaşıklamayı öğrenebilir.

Mathematical Motivation Matematiksel Motivasyon

Consider the iterative solver as minimizing the residual $r^{(k)} = b - A\phi^{(k)}$. Starting from $\phi^{(0)} = 0$, the initial residual norm $\|r^{(0)}\| = \|b\|$ is maximal. If we can instead start from $\phi^{(0)} = \hat{\phi}_\text{NN}$ where $\hat{\phi}_\text{NN} \approx \phi^*$ (the true solution), the initial residual drops dramatically: İteratif çözücüyü artık $r^{(k)} = b - A\phi^{(k)}$'yı minimize etme olarak düşünelim. $\phi^{(0)} = 0$'dan başlayarak ilk artık normu $\|r^{(0)}\| = \|b\|$ maksimumdur. Bunun yerine $\hat{\phi}_\text{NN} \approx \phi^*$ (gerçek çözüm) olmak üzere $\phi^{(0)} = \hat{\phi}_\text{NN}$'den başlayabilirsek, ilk artık dramatik olarak düşer:

Cold start (standard) Soğuk başlangıç (standart)
$$\phi^{(0)} = 0 \quad\Rightarrow\quad \|r^{(0)}\| = \|b\|$$
Warm start (ML-assisted) Sıcak başlangıç (ML destekli)
$$\phi^{(0)} = \hat{\phi}_\text{NN} \quad\Rightarrow\quad \|r^{(0)}\| = \|b - A\hat{\phi}_\text{NN}\| \ll \|b\|$$
Eq. 6 — The warm-start advantage: if the network captures even the dominant Fourier modes, the residual starts much smaller Denk. 6 — Sıcak başlangıç avantajı: ağ baskın Fourier modlarını yakalasa bile, artık çok daha küçük başlar

The network doesn't need to produce an exact solution — it only needs to capture the low-frequency structure of $\phi$. The iterative solver handles the remaining high-frequency corrections efficiently, since Jacobi is actually quite good at smoothing high-frequency errors (spectral radius near zero for short-wavelength modes). Ağın kesin bir çözüm üretmesi gerekmez — yalnızca $\phi$'nin düşük frekanslı yapısını yakalaması yeter. İteratif çözücü kalan yüksek frekanslı düzeltmeleri verimli bir şekilde ele alır, çünkü Jacobi aslında yüksek frekanslı hataları yumuşatmakta oldukça iyidir (kısa dalga boylu modlar için spektral yarıçap sıfıra yakın).

Network Architecture Ağ Mimarisi

We use a fully-connected feedforward network that takes the flattened source distribution $\rho$ (plus the binary mask $M$) as input and outputs the flattened potential field $\hat{\phi}$. The architecture is intentionally kept shallow and lightweight — inference must be faster than the iterations it saves. Düzleştirilmiş kaynak dağılımı $\rho$'yu (artı binary mask $M$'yi) girdi olarak alan ve düzleştirilmiş potansiyel alanı $\hat{\phi}$'yi çıkaran tam bağlantılı ileri beslemeli bir ağ kullanırız. Mimari kasıtlı olarak sığ ve hafif tutulur — çıkarım, tasarruf ettiği iterasyonlardan daha hızlı olmalıdır.

FEEDFORWARD WARM-START NETWORK ρ(i,j) N × N M(i,j) N × N flatten INPUT 2N² H₁ 64 ReLU H₂ 64 ReLU ··· ×3 more (H₃, H₄, H₅) H₅ 64 ReLU OUTPUT Linear reshape φ̂(i,j) N × N Loss Function ℒ = MSE ‖φ̂ − φ*‖² [ρ, M] N×N each → flatten → 2N² → Dense(64) ReLU → ×5 → reshape → N×N ~50K parameters · <5 ms inference (RTX A4000) · 3,000 training pairs · Adam optimizer, lr=1e-3, 200 epochs
Fig. 6 — Dense feedforward warm-start network. Two N×N grids (source ρ and binary mask M) are concatenated and flattened into a 2N² input vector, passed through 5 fully-connected hidden layers (64 neurons, ReLU), and reshaped back to the N×N predicted potential φ̂. Şekil 6 — Yoğun ileri beslemeli sıcak başlangıç ağı. İki N×N grid (kaynak ρ ve binary maske M) birleştirilerek 2N²'lik bir giriş vektörüne düzleştirilir, 5 tam bağlantılı gizli katmandan (64 nöron, ReLU) geçirilir ve N×N boyutunda tahmin edilen potansiyel φ̂'ye yeniden şekillendirilir.

Training & Design Rationale Eğitim ve Tasarım Gerekçesi

The network optimizes the ratio of iteration savings to inference cost. Its ~50K parameters capture the first 10–15 Fourier modes (~85% of solution energy); Jacobi corrects the high-frequency remainder. U-Net, PINN, and FNO alternatives offer higher accuracy but 10–40× higher latency — planned for future work. Ağ, iterasyon tasarrufunun çıkarım maliyetine oranını optimize eder. ~50K parametresi ilk 10–15 Fourier modunu (~%85 çözüm enerjisi) yakalar; Jacobi yüksek frekanslı kalanı düzeltir. U-Net, PINN ve FNO alternatifleri daha yüksek doğruluk sunar ancak 10–40× daha yüksek gecikmeyle — gelecek çalışmalar için planlanmıştır.

Training objective Eğitim hedefi
$$\mathcal{L}(\theta) = \frac{1}{N_{\text{train}}} \sum_{k=1}^{N_{\text{train}}} \left\| \hat{\phi}_\theta(\rho_k, M_k) - \phi^*_k \right\|_2^2$$
Iteration savings İterasyon tasarrufu
$$\Delta N_{\text{iter}} \approx \frac{1}{\log(1/\rho_J)} \log\!\left(\frac{\|b\|}{\|b - A\hat{\phi}_{\text{NN}}\|}\right)$$
ParameterParametre ValueDeğer
Training setEğitim seti 3,000 samples (300 geometries × 10 charge distributions)3.000 örnek (300 geometri × 10 yük dağılımı)
ArchitectureMimari 5 hidden layers × 64 neurons, ReLU, Linear output5 gizli katman × 64 nöron, ReLU, Linear çıkış
Loss / OptimizerKayıp / Optimizer MSE · Adam (lr = 1e-3) · 200 epoch
Iteration reductionİterasyon azalması Up to 50% (charge-distribution dependent)%50'ye kadar (yük dağılımına bağlı)
Inference timeÇıkarım süresi <5 ms — RTX A4000, 128² grid

Dynamic Adaptive Convergence Control Dinamik Adaptif Yakınsama Kontrolü

Standard distributed solvers check global convergence every iteration via MPI_Allreduce, creating a communication bottleneck. Our algorithm adjusts the check interval based on problem size, reducing communication overhead by 90%: Standart dağıtık çözücüler her iterasyonda MPI_Allreduce ile global yakınsamayı kontrol eder ve iletişim darboğazı yaratır. Algoritmamız kontrol aralığını problem boyutuna göre ayarlayarak iletişim yükünü %90 azaltır:

Grid SizeGrid BoyutuCheck IntervalKontrol Aralığı
512²Every 100 iterationsHer 100 iterasyonda
1024²Every 500 iterationsHer 500 iterasyonda
2048²Every 1000 iterationsHer 1000 iterasyonda
§8 — Desktop GUI Application §8 — Masaüstü GUI Uygulaması

Interactive Solver Interface İnteraktif Çözücü Arayüzü

Beyond the command-line solver, we developed a desktop GUI (Tkinter/Python frontend + CUDA backend) that enables interactive exploration of the Poisson solver. The interface lets users draw arbitrary domains with a brush tool, import images as geometry masks, select source functions from a library, and visualize results in real-time with 2D heatmaps and 3D surface plots. Komut satırı çözücünün ötesinde, Poisson çözücünün interaktif keşfini sağlayan bir masaüstü GUI (Tkinter/Python arayüzü + CUDA backend) geliştirdik. Arayüz kullanıcıların fırça aracıyla keyfi domainler çizmesine, görüntüleri geometri maskesi olarak içe aktarmasına, bir kütüphaneden kaynak fonksiyonları seçmesine ve sonuçları 2B ısı haritaları ve 3B yüzey grafikleri ile gerçek zamanlı görselleştirmesine olanak tanır.

The GUI serves as both a research tool — enabling rapid experimentation with different geometries and charge distributions — and a demonstration platform for the TUSAŞ LiftUp program presentations. Users can interactively adjust grid resolution (128 to 2048), toggle multi-grid acceleration, and watch the solution converge live via an embedded log console. GUI hem bir araştırma aracı — farklı geometriler ve yük dağılımları ile hızlı deneme yapılmasını sağlar — hem de TUSAŞ LiftUp programı sunumları için bir gösteri platformu olarak hizmet eder. Kullanıcılar grid çözünürlüğünü (128'den 2048'e) interaktif olarak ayarlayabilir, multi-grid hızlandırmayı açıp kapatabilir ve çözümün gömülü bir log konsolu aracılığıyla canlı olarak yakınsama sürecini izleyebilir.

§9 — Results & Performance §9 — Sonuçlar & Performans

Benchmark ResultsBenchmark Sonuçları

The solver was tested on two NVIDIA RTX A4000 GPUs connected via Gigabit Ethernet (1 Gbps) — deliberately a bandwidth-limited setup to stress-test the async optimizations. Grid sizes ranged from $128^2$ to $2048^2$, with the TUSAŞ KAAN aircraft cross-section as the test geometry under Dirichlet conditions. Çözücü, Gigabit Ethernet (1 Gbps) üzerinden bağlanan iki NVIDIA RTX A4000 GPU'da test edildi — asenkron optimizasyonları stres-test etmek için kasıtlı olarak bant genişliği sınırlı bir kurulum. Grid boyutları $128^2$'den $2048^2$'ye değişti; test geometrisi olarak TUSAŞ KAAN uçağı kesiti kullanıldı.

2048×2048 Configuration Comparison2048×2048 Konfigürasyon Karşılaştırması

Fig 7 — Solve time comparison at 2048×2048 for single GPU, distributed GPU (async MPI), and multi-grid + distributed GPU. Şekil 7 — 2048×2048'de tek GPU, dağıtık GPU (async MPI) ve multi-grid + dağıtık GPU çözüm süresi karşılaştırması.

Speedup vs Grid SizeGrid Boyutuna Göre Hızlanma

Fig 8 — Distributed GPU speedup factor. The crossover point occurs around 512×512. Şekil 8 — Dağıtık GPU hızlanma faktörü. Eşitlenme noktası yaklaşık 512×512 civarındadır.

At small grids ($128^2$, $256^2$), communication overhead dominates and multi-GPU is slower. From $512^2$ onward, the compute-to-communication ratio favors distribution: 2.17× for point charge and 2.47× for Gaussian at $2048^2$. With multi-grid warmup, the total speedup reaches 3.2× (solution time dropping from 290.8s to 88.7s for Gaussian charge). Küçük gridlerde ($128^2$, $256^2$) iletişim yükü baskındır. $512^2$'den itibaren hesaplama/iletişim oranı dağıtımı destekler: $2048^2$'de nokta yük için 2.17×, Gaussian için 2.47×. Multi-grid ısınmasıyla toplam hızlanma 3.2×'e ulaşır (Gaussian yük için çözüm süresi 290.8s'den 88.7s'ye düşer).

Solution VisualizationÇözüm Görselleştirmesi

The potential field $\phi(x,y)$ computed on the heart domain with $\rho(x,y) = \sin(x)\cos(y)$ — Dirichlet boundary ($\phi=0$ on the contour): Kalp domaininde $\rho(x,y) = \sin(x)\cos(y)$ ile hesaplanan potansiyel alanı $\phi(x,y)$ — Dirichlet sınır koşulu ($\phi=0$ kontür üzerinde):

Fig 9 — Electrostatic potential $\phi(x,y)$ on the heart domain, computed by GPU-accelerated Jacobi iteration. Şekil 9 — Kalp domaininde GPU-hızlandırmalı Jacobi iterasyonu ile hesaplanan elektrostatik potansiyel $\phi(x,y)$.
Schrödinger's Siths

Schrödinger's Siths

Research Group — Marmara University, Department of Physics Araştırma Grubu — Marmara Üniversitesi, Fizik Bölümü

Academic Advisor: Prof. Dr. Erdi Ata Bleda · Industry Advisor: Özhan Taşdemir (TUSAŞ) Akademik Danışman: Prof. Dr. Erdi Ata Bleda · Sanayi Danışmanı: Özhan Taşdemir (TUSAŞ)

Berkay Yılmaz
Berkay Yılmaz
Project Lead — GPU Architecture & System DesignProje Lideri — GPU Mimarisi & Sistem Tasarımı
CUDA solver engine, async MPI/NCCL pipeline, multi-grid implementation, ML initial guess, GUI integrationCUDA çözücü motoru, async MPI/NCCL pipeline, multi-grid uygulaması, ML başlangıç tahmini, GUI entegrasyonu
Ahmet Ali Akkurt
Ahmet Ali Akkurt
Iterative Methods & Academic Researchİteratif Yöntemler & Akademik Araştırma
Implemented all 6 iterative solvers from scratch (Jacobi, GS, RBGS, ARBGS, CG, PCG), CPU benchmarks, convergence characterization, literature survey6 iteratif çözücünün tamamını sıfırdan kodladı (Jacobi, GS, RBGS, ARBGS, CG, PCG), CPU benchmark'ları, yakınsama karakterizasyonu, literatür taraması
Mehmet Dündar
Mehmet Dündar
Academic Research & Development SupportAkademik Araştırma & Geliştirme Desteği
Literature survey, problem formulation research, coding support, documentationLiteratür taraması, problem formülasyonu araştırması, kodlama desteği, dokümantasyon

Presented at the 41st International Physics Congress organized by the Turkish Physical Society (2 oral presentations).
Published under TUSAŞ LiftUp Program · Supported by TÜBİTAK 2209/B (No: 1139B412400836)
41. Uluslararası Fizik Kongresi'nde Türk Fizik Derneği organizasyonuyla sözlü olarak sunulmuştur (2 bildiri).
TUSAŞ LiftUp Programı kapsamında yayımlanmıştır · TÜBİTAK 2209/B (No: 1139B412400836) desteği ile