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

EOSPAC vector implementations #177

Merged
merged 23 commits into from
Feb 23, 2023
Merged

EOSPAC vector implementations #177

merged 23 commits into from
Feb 23, 2023

Conversation

rbberger
Copy link
Collaborator

@rbberger rbberger commented Sep 1, 2022

PR Summary

PR Checklist

  • Adds a test for any bugs fixed. Adds tests for new features.
  • Format your changes by using the make format command after configuring with cmake.
  • Document any new features, update documentation for changes made.
  • Make sure the copyright notice on any files you modified is up to date.
  • After creating a pull request, note it in the CHANGELOG.md file

Copy link
Collaborator

@jhp-lanl jhp-lanl left a comment

Choose a reason for hiding this comment

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

I think this looks really good! I don't think the underlying math and thermodynamics you copied over from the existing code has been thoroughly vetted, but that's beyond the scope of this MR. There may be additional performance improvements we can add, but those can be done later.

The only changes I would ask for would be a simple function to provide a required scratch size and a simple test. There are multiple scratch sizes needed though so this requires some discussion I think. For the test, I would just pick one of these methods and make a test for the chunk version and the full array version and make sure the result agrees with a for loop over scalar lookups. We can expand the test later as part of vetting the underlying logic and math.

singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

This is a draft, so not approving or requesting changes. A little bit of feedback below.

singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
@Yurlungur
Copy link
Collaborator

Also thanks for putting in the work to prototype this! I like both the "scatch" and "chunk" approaches. But I think we should be a little thoughtful of GPU performance in both cases. I don't think any of this code will run on GPU as-is.

@rbberger rbberger force-pushed the rberger_eospac_vectorized branch 2 times, most recently from b9afe6f to d4eef73 Compare September 7, 2022 17:21
@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from ac4e0b8 to b67321c Compare September 24, 2022 00:44
@rbberger
Copy link
Collaborator Author

@Yurlungur @jhp-lanl I've updated all scratch and chunk versions to use EOSPAC options to minimize copies and do unit conversions. I've also expanded the profiling to include more methods and made it part of CTest. Below are timings I've generated per method on skylake-platinum nodes on Darwin:
EOSPAC_vectorization_time

EOSPAC_vectorization_throughput

@rbberger rbberger force-pushed the rberger_eospac_vectorized branch 2 times, most recently from 6b54d26 to 644a3e0 Compare October 11, 2022 00:16
@jhp-lanl
Copy link
Collaborator

Great work @rbberger ! I'm excited especially that this work is part of CTest so that we can have a baseline and look for ways to improve. We should discuss this more at the meeting tomorrow!

@rbberger
Copy link
Collaborator Author

@jhp-lanl yeah, having it part of CTest already pays off. I'm having weird failures on power9 that need further investigation. 😄

@Yurlungur
Copy link
Collaborator

Nice work @rbberger ! I second @jhp-lanl 's comments.

@Yurlungur
Copy link
Collaborator

Peanut gallery says we go to scratch and drop lambdas and chunks

@rbberger
Copy link
Collaborator Author

@Yurlungur @jhp-lanl Issue #187 blocks me from doing any meaningful GPU tests on the CI.

@rbberger rbberger force-pushed the rberger_eospac_vectorized branch 2 times, most recently from a8a922d to 159f465 Compare October 19, 2022 23:27
@jhp-lanl
Copy link
Collaborator

@Yurlungur @jhp-lanl Issue #187 blocks me from doing any meaningful GPU tests on the CI.

I seem to recall that the accessible EOSPAC spackage isn't up-to-date and I'm not quite sure what the best way to get 6.5 is. I'll ping Daniel Sheppard.

@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from 159f465 to 0f5fde3 Compare October 21, 2022 03:39
@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from 0f5fde3 to 8f82ef6 Compare October 21, 2022 04:02
@rbberger rbberger changed the title Draft: EOSPAC vector implementations EOSPAC vector implementations Oct 21, 2022
@rbberger
Copy link
Collaborator Author

@Yurlungur ready for review.

Copy link
Collaborator

@jhp-lanl jhp-lanl left a comment

Choose a reason for hiding this comment

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

I'm nominally approving this because most of my comments are questions rather than critiques and I can be convinced out of any code changes.

@rbberger feel free to resolve any of my questions as you answer them or make code changes to address them.

eospac-wrapper/eospac_wrapper.cpp Show resolved Hide resolved
python/module.cpp Outdated Show resolved Hide resolved
python/module.hpp Show resolved Hide resolved
singularity-eos/eos/eos_base.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
test/CMakeLists.txt Show resolved Hide resolved
test/profile_eospac.cpp Show resolved Hide resolved
test/CMakeLists.txt Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

Sorry I left this so long @rbberger it slipped my mind. Overall this looks very good. A few nitpicks below.

eospac-wrapper/eospac_wrapper.cpp Show resolved Hide resolved
eospac-wrapper/eospac_wrapper.cpp Show resolved Hide resolved
singularity-eos/eos/eos_base.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
singularity-eos/eos/eos_eospac.hpp Outdated Show resolved Hide resolved
test/CMakeLists.txt Show resolved Hide resolved
Once we use C++17 this could be replaced with [[maybe_unused]]
@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from 134f642 to 80a6b03 Compare January 11, 2023 18:12
@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from 791e78e to 59a2e74 Compare January 11, 2023 20:44
@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from 6d56ed6 to 50ef5a3 Compare January 11, 2023 21:00
@rbberger rbberger force-pushed the rberger_eospac_vectorized branch 3 times, most recently from 8b1907b to b184e19 Compare January 11, 2023 23:11
@rbberger
Copy link
Collaborator Author

@Yurlungur @jhp-lanl except the point about the modifiers and GPUs, this PR should be done. It also passes on re-git. Let me know if the documentation is sufficient.

@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from b184e19 to 72a6287 Compare January 11, 2023 23:45
Copy link
Collaborator

@jhp-lanl jhp-lanl left a comment

Choose a reason for hiding this comment

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

This looks really good @rbberger ! Thanks for all the effort on this!

@jhp-lanl
Copy link
Collaborator

I'll wait for the Darwin tests to pass before we merge.

Copy link
Collaborator

@Yurlungur Yurlungur left a comment

Choose a reason for hiding this comment

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

Looks good. 👍 Let's merge as soon as Darwin tests pass

@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from 6e1ed15 to 72a6287 Compare January 12, 2023 01:19
@jhp-lanl
Copy link
Collaborator

@rbberger is there anything holding this up? To me it looks like you can merge in master (and resolve conflicts) and we can merge this.

@rbberger
Copy link
Collaborator Author

@rbberger is there anything holding this up? To me it looks like you can merge in master (and resolve conflicts) and we can merge this.

No. It kind of got stuck because we were looking at why GPU builds being so slow (in general, not just this), but I'll fix this one up again so we can merge it.

@jhp-lanl
Copy link
Collaborator

@rbberger is there anything holding this up? To me it looks like you can merge in master (and resolve conflicts) and we can merge this.

No. It kind of got stuck because we were looking at why GPU builds being so slow (in general, not just this), but I'll fix this one up again so we can merge it.

Let us know if you need any support getting this pushed 👍

@rbberger rbberger force-pushed the rberger_eospac_vectorized branch from ef4fe7b to 7829ece Compare February 22, 2023 22:02
@rbberger
Copy link
Collaborator Author

@Yurlungur re-git pipeline successful. feel free to merge.

@Yurlungur Yurlungur merged commit fd3e233 into main Feb 23, 2023
@Yurlungur Yurlungur deleted the rberger_eospac_vectorized branch February 23, 2023 00:14
@Yurlungur
Copy link
Collaborator

Thanks for all your hard work on this @rbberger ! At some point we should check to see what is necessary to pull this through for GPU implementations and modifiers. But for now I think we can celebrate speeding up the EOSPAC calls.

@jhp-lanl
Copy link
Collaborator

Yes indeed! Thanks for all the hard work @rbberger !

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.

3 participants