Skip to content

Re-introduce Numba to face area computations - #794

Merged
philipc2 merged 2 commits into
mainfrom
philipc2/numba-area
May 18, 2024
Merged

philipc2 merged 2 commits into
mainfrom
philipc2/numba-area

Conversation

@philipc2

@philipc2 philipc2 commented May 17, 2024 •

Copy link
Copy Markdown
Member

Closes #793

The removal of Numba in #748 severely degraded the performance of the face area computations. The removal was initially due to the removal of Numba in favor of vectorization with the coordinate conversion functions (since _normalize_xyz can't use numba in it's current state).

This performance can be observed in our ASV benchmark.

However, _lonlat_rad_to_xyz(), which is used by the face area computations, can be optimized using Numba.

@philipc2 philipc2 self-assigned this May 17, 2024
@philipc2 philipc2 added this to the Scalability & Performance milestone May 17, 2024
@philipc2

philipc2 commented May 17, 2024 •

Copy link
Copy Markdown
Member Author

Benchmark Before:

[50.00%] ··· Running (mpas_ocean.Integrate.time_integrate--).
[100.00%] ··· mpas_ocean.Integrate.time_integrate ok
[100.00%] ··· ============ ============
resolution
------------ ------------
480km 1.21±0.01s
120km 19.4±0.2s
============ ============

Benchmark After (the changes in this PR):

[50.00%] ··· Running (mpas_ocean.Integrate.time_integrate--).
[100.00%] ··· mpas_ocean.Integrate.time_integrate ok
[100.00%] ··· ============ ============
resolution
------------ ------------
480km 18.8±0.3ms
120km 285±0.8ms
============ ============

@philipc2
philipc2 requested a review from rajeeja May 17, 2024 20:48
@philipc2

Copy link
Copy Markdown
Member Author

@erogluorhan

Is this codecov bot new?

@philipc2
philipc2 requested a review from erogluorhan May 17, 2024 20:51
@rajeeja

rajeeja commented May 17, 2024

Copy link
Copy Markdown
Contributor

Thanks, I was guessing this to be the case. Your plots of speedup (in PR #748 ) didn't cover area calculation.

@philipc2

Copy link
Copy Markdown
Member Author

Thanks, I was guessing this to be the case. Your plots of speedup (in PR #748 ) didn't cover area calculation.

Yeah, they were isolated examples.

@rajeeja rajeeja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be working.
Thanks for putting this together.

@philipc2
philipc2 merged commit 93cf4d9 into main May 18, 2024
@erogluorhan
erogluorhan deleted the philipc2/numba-area branch December 2, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Significant performance degradation after remove Numba from face area computation

2 participants