A saved plane of a large Cartesian field costs about 3 s in copies, and a kept native save on Linux is unexplained

Aperta
#346 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 in src/solprop/output/schema.py at spectrum_to_optics and the copy at _observed_field in src/solprop/backends/driver.py, then follow the plane into src/solprop/output/hdf5.py and src/solprop/output/memory.py. The benchmark ledger in docs/dev/benchmarks.md gives the baseline timings to reproduce. Done means a saved plane of kerr_beam_384 costs at most half of 3 s on the stated machine, with bitwise-equal output and a test that a kept plane is unaffected by later steps.

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

Descrizione

area: free space area: gpu area: output performance priority: low
What happens

Two costs at a saved plane have not been explained.

A large Cartesian plane costs about 3 s, in copies. #59 measured what repeats per saved plane of kerr_beam_384's 1.77 GB field (ledger):

step time
the saved plane's copy 1.1 s
spectrum_to_optics, the conversion to the stored convention 1.0 s
the output store's copy 0.6 s
the native observation 0.35 s

A capillary or radial plane costs 7–25 ms. #59 left this as output-layer work for a pull request of its own. Each copy is also another field-sized allocation at the plane, which matters on runs sized to memory.

A kept native save on Linux. SEP 29 recorded about 4.5 ms for a kept native Adams save, against numba_cpu's 1.6 ms, unexplained, with run totals level (1.398 s against 1.397 s, about 110 saves). The native march (SEP 39) and #59 have changed this path since, and the case it used is no longer in benchmarks/, so re-measure first with a run that saves each step.

Why it matters

A run keeping several planes of a large beam spends seconds per plane outside the physics, and its peak memory sits at the plane, not in the steps.

Context
  • _observed_field gives an owning host array. An in-memory store has to own what it keeps, while a file only has to write it, so the copies may differ per handler. The file writer and the in-memory store are where they end.
  • #5 is the problem's copy of the initial field, #6 the estimate that misses it, and #80 the run record rewritten at every plane. None of them covers this path.
  • Why spectrum_to_optics exists: stored spectra have the optics convention, and that must not change.

Read, not run.

To do
  • Trace a plane from observation to store on native, for the file and the in-memory handlers, and remove the copies nothing mutates.
  • See if the conversion can run in place on a buffer the plane already owns.
  • Re-time a kept save on Linux on native and numba_cpu, and explain or close the gap.
  • Check peak memory at a plane against estimate_memory.

Stored fields stay bitwise equal, and a kept plane must not alias the live state.

Done when

On 2x Xeon Gold 6240 a saved plane of kerr_beam_384 costs at most half of the 3 s above, timed the same way, with bitwise-equal output and a test that a kept plane does not change when the run goes on. The kept save's ratio on the same machine is recorded, with its cause or a statement that it has gone.


Checked against commit 8a9f764. Takes over the roadmap's entry "The cost of a kept native save on Linux."

Lingua principale
Python
Stelle
3
Fork
3
Merge medio
6h 51m
PR unite (30g)
136

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.