Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Performance optimization

Aperta
#138 4 commenti 2 reazioni 0 assegnatari Vedi su GitHub

@BSchilperoort ci sta già lavorando.

Dal 16/10/2026.

  • #139 di @BSchilperoort — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
12/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
python
Ambito
performance

Direzione di ricerca

This is an open proposal, not a concrete task: the author asks whether maintainers want performance changes such as running totals for leaf classes, deferred end-of-day condition checks, and compiled step functions. The payload names no files or tests in diffWOFOST. Start by reading the thread and the linked mGV issue, then wait for a maintainer decision. Done would mean a maintainer has agreed on scope and the work is split into smaller issues.

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

Descrizione

I have performed some performance benchmarks, and found that diffWOFOST main performs similarly at large vector sizes (e.g., many crops simulated at once under different weather conditions) to the non-vectorized WOFOST C port.

However, for coupling WOFOST to the hydrological model we are developing, this performance is likely insufficient compared to mGV and MODFLOW 6. To avoid this bottleneck we would require either diffWOFOST to be more performant, or write our own WOFOST implementation in Julia. Of course we would prefer to tag along with the developments of diffWOFOST.

With an LLM I was able to get diffWOFOST performant enough (WOFOST-72 at least) that there was only a minor difference between diffWOFOST and an optimized Julia GPU port.

The main performance improvements stemmed from:

  • Keeping leaf classes as running totals, instead of computing a cumulative sum every time step
  • Defer condition checking to end-of-day, instead of mid-step so they can be computed with only a single host-device sync (Carbon-balance, partitioning, latitude and vernalisation checks currently queue a device-side flag)
  • Stop traitlets comparing every assigned tensor (Every state assignment ran bool(old == new). On a multi-element tensor this launches a comparison kernel and then fails silently; on one-element tensors it forces a sync)
  • Move sets of operations into a single function, and compile these functions (e.g. in root_dynamics move computation of calc_rates into a separate compilable function)

For the tests I did add a copy to/from the device to simulate exchanging variables every time step in a coupled model setup.

Would you be interested in (at some point) improving the performance of diffWOFOST with these strategies, or is this out of scope for the current work?

Lingua principale
Python
Stelle
25
Fork
7
Merge medio
14g 3h
PR unite (30g)
1

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 WUR-AI/diffWOFOST

Tutte le issue di WUR-AI/diffWOFOST

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.