`numba_cpu`'s band plasma scratch is sized per node of a chunk, not per thread

Aperta
#348 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start with _plasma_work in src/solprop/backends/numba_cpu/backend.py (around line 1040), where the band plasma scratch is sized per node of a chunk, then the row count from band_work_rows and the node indexing in src/solprop/backends/numba_cpu/kernels.py. The chunk rule in src/solprop/translate/free.py sets the column size. Done means one set of six rows per thread, the memory ledger's plasma_work at most a thread count's rows, and the column tests passing at one and many threads. The issue needs maintainer decisions on the AGENTS.md rule and the shared buffer plan, so it is not a good first pick.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: backends performance priority: low
What happens

numba_cpu's multipass band plasma column (the band-exact plasma integrals of SEP 18) holds six fine-grid rows per node of a chunk in _plasma_work. SEP 25's physics review left this as a follow-up, since per-thread rows would be far smaller on large free-space chunks. SEP 28 then raised the spatial node budget from 64 MiB to 1 GiB, which makes the array larger.

From the chunk rule, column_bytes = 20 * 16 * n_pol * n_to, the scratch comes to about 150 MiB divided by the number of polarisation components at the default budget, once the grid has enough columns to fill a chunk. Per-thread rows would be about 4 MB at 64 threads and 1200 fine samples. That is arithmetic from the code, not a measurement.

Why it matters

It is memory that does no good once a chunk is wider than the thread count. It is charged in the memory ledger, so the accounting is right. It applies only to band plasma on numba_cpu, a tier 2 backend (ADR-061).

Context

The kernels index it by node, and band_work_rows gives the row count. Per-thread rows inside a prange are a new pattern here: #104 raises the same point about AGENTS.md's rule, so settle it once. #89 is the shared buffer plan, and ##349 is the chunk rule itself.

Read, not run.

To do
  • Give the column one set of six rows per thread, not per node, with the ledger row following.
  • Check the band column's bounds and its results across thread counts are unchanged.
  • Record the new plasma_work figure at the default spatial budget.
Done when

On a Cartesian band plasma run at the default budget, memory_ledger()'s plasma_work is at most a thread count's rows, and the column's tests pass at one and at many threads. python -m benchmarks ab --backend numba_cpu on a cartesian_filament case on 2x Xeon Gold 6240 shows no loss beyond its A/A range.


Checked against commit 8a9f764.

Lingua principale
Python
Stelle
3
Fork
3
Merge medio
4h 42m
PR unite (30g)
91

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LupoLab/solprop

Tutte le issue di LupoLab/solprop

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.