Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make compute_average_normalized_field vacuum flag actually skip the plasma field calculation #1576

Merged
merged 6 commits into from
Feb 13, 2025

Conversation

dpanici
Copy link
Collaborator

@dpanici dpanici commented Feb 7, 2025

This saves about 10 seconds per call to the function for vacuum equilibria, which is like 20 seconds for the notebook

…acuum calculation for the compute_Bnormal call
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@dpanici dpanici added the easy Short and simple to code or review label Feb 7, 2025
@dpanici dpanici requested review from a team, rahulgaur104, f0uriest, ddudt, sinaatalay, unalmis and YigitElma and removed request for a team February 7, 2025 20:20
Copy link

review-notebook-app bot commented Feb 8, 2025

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2025-02-08T17:25:36Z
----------------------------------------------------------------

I assume this numerical difference comes from other changes and not this one?


f0uriest commented on 2025-02-10T18:28:08Z
----------------------------------------------------------------

This is likely the effect of analytically removing the plasma field (by only computing the vacuum field) vs keeping it, knowing it is numerically small

Copy link

review-notebook-app bot commented Feb 8, 2025

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2025-02-08T17:25:36Z
----------------------------------------------------------------

These differences are due to changes we made to other parts of the code since the last notebook update, right?


dpanici commented on 2025-02-11T15:31:50Z
----------------------------------------------------------------

yea I did not realize it got this worse. I will redo the weights rn to see if can make it better

Copy link

review-notebook-app bot commented Feb 8, 2025

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2025-02-08T17:25:37Z
----------------------------------------------------------------

This difference is easier to see


Copy link

review-notebook-app bot commented Feb 9, 2025

View / edit / reply to this conversation on ReviewNB

YigitElma commented on 2025-02-09T02:43:44Z
----------------------------------------------------------------

Can you add these here too? I added them to each notebook except this one in #1539.

If you have access to a GPU, uncomment the following two lines before any DESC or JAX related imports. You should see about an order of magnitude speed improvement with only these two lines of code!

# from desc import set_device
# set_device("gpu")

As mentioned in [DESC Documentation on performance tips](https://desc-docs.readthedocs.io/en/latest/performance_tips.html), one can use compilation cache directory to reduce the compilation overhead time. Note: One needs to create jax-caches folder manually.

# import jax

# jax.config.update("jax_compilation_cache_dir", "../jax-caches")
# jax.config.update("jax_persistent_cache_min_entry_size_bytes", -1)
# jax.config.update("jax_persistent_cache_min_compile_time_secs", 0)

Copy link
Collaborator

@YigitElma YigitElma left a comment

Choose a reason for hiding this comment

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

can you add cache stuff here

@dpanici dpanici changed the title Make compute_average_normalized_field vacuum flag actually skip the vacuum calculation Make compute_average_normalized_field vacuum flag actually skip the plasma field calculation Feb 9, 2025
Copy link
Member

This is likely the effect of analytically removing the plasma field (by only computing the vacuum field) vs keeping it, knowing it is numerically small


View entire conversation on ReviewNB

f0uriest
f0uriest previously approved these changes Feb 10, 2025
@unalmis unalmis added this to the next pip release milestone Feb 11, 2025
Copy link
Collaborator Author

dpanici commented Feb 11, 2025

yea I did not realize it got this worse. I will redo the weights rn to see if can make it better


View entire conversation on ReviewNB

@dpanici dpanici merged commit f4cb154 into master Feb 13, 2025
23 checks passed
@dpanici dpanici deleted the dp/coil-notebook-vac-flag branch February 13, 2025 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Short and simple to code or review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants