PERF-2 P3 bench: the coarsest level uses the CPU's red-black symmetric ordering (a nearly singular coarsest system settles on a smoother-dependent constant, which the prolongation doubled up every level: the 19 % disagreement)
CI / CI Success (push) Blocked by required conditions
CI / Build (macos-latest) (push) Waiting to run
CI / Test (macos-latest) (push) Blocked by required conditions
CI / Test (ubuntu-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (macos-latest) (push) Blocked by required conditions
CI / Python Bindings (maturin) (ubuntu-latest) (push) Blocked by required conditions
CI / WASM Build + Size Check (push) Blocked by required conditions
CI / Distributed Training Tests (push) Blocked by required conditions
CI / Format Check (push) Failing after 5s
CI / Build (ubuntu-latest) (push) Failing after 6s
CI / Clippy Check (push) Failing after 7s
Documentation / Build User Guide (push) Successful in 6s
Performance Benchmarks / Run Benchmarks (push) Failing after 14s
Documentation / Build API Documentation (push) Failing after 30s
CI / Build CPU-Only (Explicit) (push) Failing after 1m31s

This commit is contained in:
Omar Sobh
2026-09-16 01:10:12 -05:00
parent 06a60b5fed
commit 3b7f8fb362
2 changed files with 16 additions and 6 deletions
@@ -78,9 +78,13 @@ extern "C" __global__ void mg_zero(int n_cells, const unsigned int* __restrict__
x[(size_t)blockIdx.y * n + cells[t]] = 0.0f;
}
/* The coarsest level: one thread per march, `sweeps` symmetric lexicographic sweeps over <= a few dozen cells. */
/* The coarsest level: one thread per march, `sweeps` symmetric RED-BLACK
* sweeps (red, black, black, red — the CPU's ordering, so a nearly singular
* coarsest system settles on the same constant) from zero. */
extern "C" __global__ void mg_coarsest(
int K, int n_cells, const unsigned int* __restrict__ cells, int n,
int K, int n_cells, const unsigned int* __restrict__ cells,
int n_red, const unsigned int* __restrict__ red,
int n_black, const unsigned int* __restrict__ black, int n,
const float* __restrict__ ae, const float* __restrict__ aw,
const float* __restrict__ an, const float* __restrict__ as_,
const float* __restrict__ ap, const float* __restrict__ b,
@@ -91,10 +95,11 @@ extern "C" __global__ void mg_coarsest(
int base = k * n;
for (int t = 0; t < n_cells; ++t) x[base + cells[t]] = 0.0f;
for (int sw = 0; sw < sweeps; ++sw) {
for (int pass = 0; pass < 2; ++pass) {
for (int q = 0; q < n_cells; ++q) {
int t = pass == 0 ? q : n_cells - 1 - q;
int g = base + cells[t];
for (int half = 0; half < 4; ++half) {
const unsigned int* list = (half == 0 || half == 3) ? red : black;
int n_list = (half == 0 || half == 3) ? n_red : n_black;
for (int t = 0; t < n_list; ++t) {
int g = base + list[t];
float s = 0.0f;
float e = ae[g]; if (e != 0.0f) s += e * x[g + 1];
float w = aw[g]; if (w != 0.0f) s += w * x[g - 1];