The `on_axis_*` statistics copy the whole state to the host on device builds

Aperta
#359 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
22/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
performance

Direzione di ricerca

Start with the device-copy path around line 1313 of native/src/solprop_native/backend.py, where the whole state is copied to the host for each saved plane that requests on_axis_* statistics. The first step is measurement, not code: time one saved plane with and without those statistics on a GPU build, using a Cartesian grid of at least 384 x 384. Parity is checked by tests/backends/test_on_axis_statistics.py against numpy_ref. Done means the cost is recorded with device, grid and date, and either the device scan is in place with parity on CUDA and HIP, or the issue is closed because the copy is under 1 % of run time.

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

Descrizione

area: gpu performance priority: low
What is missing

The on_axis_* statistics (SEP 19) read one row of the field at the axis. On a device build the native backend copies the whole state to the host and scans the row there, once per saved plane that asks for them. SEP 19 left the device form out on purpose, as "needed only to avoid the state copy on a GPU", and deferred it to GPU qualification.

Why it matters

Possibly not much. On a large Cartesian run the copy is the whole state at each such plane. Its cost has not been measured on a GPU, so that is the first step. Read, not run.

To do
  • Time a saved plane with and without on_axis_* on a data-centre GPU, on a Cartesian run of at least 384 x 384.
  • If the copy matters, add a one-row device scan through the existing plasma scan, keeping tests/backends/test_on_axis_statistics.py's parity against numpy_ref. If not, close this with the number.
Done when

The cost is recorded with device, grid and date, and either the statistics no longer copy the state on a device, with parity holding on a CUDA and a HIP build, or the issue closes because the copy is under 1 % of the run's time at one plane per 100 steps.


Checked against commit 8a9f764. Takes over the roadmap's entry "The on-axis statistics on device builds".

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.