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

Compare TUV-X Tridiagonal Solver Code with LAPACKE's implementation #97

Merged
merged 58 commits into from
Jul 16, 2024

Conversation

AdityaDendukuri
Copy link
Collaborator

@AdityaDendukuri AdityaDendukuri commented Jun 24, 2024

  1. Tests involved generating random matrices in both single and double precision across various sizes (ranging from 1000 to 10,000,000).
  2. Added a benchmarking directory in the project that uses google benchmark for evaluating runtimes for solver code.

Closes #91

Copy link
Contributor

@K20shores K20shores left a comment

Choose a reason for hiding this comment

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

The uni tests for the tridiagonal solver seem to contain benchmarking code. I don't think that belongs in the unit tests. I also question if we really want all of the stuff added in tool. It's good work, but maybe it belongs in a separate repository

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
cmake/test_util.cmake Outdated Show resolved Hide resolved
include/tuvx/linear_algebra/linear_algebra.inl Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
test/unit/linear_algebra/test_lapacke.cpp Outdated Show resolved Hide resolved
benchmark/benchmark_tridiagonal_solver.cpp Outdated Show resolved Hide resolved
benchmark/benchmark_tridiagonal_solver.cpp Outdated Show resolved Hide resolved
docker/Dockerfile Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

We are fine to include and distribute this if we need to.

To do so, we need to include in our release notes and anytime we mention our licensing that most of tuvx is licensed under Apache 2.0 with copyright attributed to NCAR, except for this specific file.

@mattldawson @sjsprecious @AdityaDendukuri

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for figuring it out. That seems fine to me.

cmake/test_util.cmake Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

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

Thank you for addressing the comments! I commented about the comment style. Could you review the style in the comments in this PR and make adjustments if you need? Thank you!

include/tuvx/linear_algebra/linear_algebra.hpp Outdated Show resolved Hide resolved
Copy link
Contributor

@boulderdaze boulderdaze left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments!

Copy link
Collaborator

@mattldawson mattldawson left a comment

Choose a reason for hiding this comment

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

looks great to me! just a couple minor suggestions

@@ -6,6 +6,7 @@ include(FetchContent)

find_package(BLAS)
find_package(LAPACK)
find_package(LAPACKE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this go inside the if (TUVX_ENABLE_BENCHMARK) block? Is it only needed for the benchmarking tests?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mattldawson @sjsprecious @K20shores LAPACKE is also used in tests. Since LAPACKE does its own tests when included in CMAKE, is it a good idea to remove the unit tests I wrote for LAPACKE?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's fine to include your tests - the find_pacakge() doesn't need to be in the if (TUVX_ENABLE_BENCHMARK) block. I just thought if it was only used for the benchmarking, it could be in that block, but it's ok where it as, too (in my opinion).

src/CMakeLists.txt Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
test/unit/linear_algebra/CMakeLists.txt Outdated Show resolved Hide resolved
AdityaDendukuri and others added 2 commits July 9, 2024 09:22
Co-authored-by: Kyle Shores <[email protected]>
Co-authored-by: Kyle Shores <[email protected]>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.27%. Comparing base (48f3aa5) to head (38e9903).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #97      +/-   ##
==========================================
+ Coverage   79.21%   79.27%   +0.06%     
==========================================
  Files         133      134       +1     
  Lines       11193    11284      +91     
==========================================
+ Hits         8866     8945      +79     
- Misses       2327     2339      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mwaxmonsky mwaxmonsky left a comment

Choose a reason for hiding this comment

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

Great work @AdityaDendukuri! Just a few questions/recommendations but otherwise looks good to me!

Comment on lines +34 to +38
&& cmake \
-D TUVX_ENABLE_TESTS=OFF \
-D TUVX_ENABLE_BENCHMARK=OFF \
-D TUVX_BUILD_DOCS=ON \
/tuv-x \
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be reverted since TUVX_ENABLE_BENCHMARK is defaulted to OFF?

Comment on lines -32 to +37
run: cmake --build build --parallel
run: cmake --build build
Copy link
Contributor

Choose a reason for hiding this comment

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

I may have missed this part of the conversation so my apologies in advanced but is --parallel not possible to use with lapacke

Comment on lines -26 to +36
COPY . /tuv-x/
RUN mkdir /build \
&& cd /build \
COPY . /tuv-x
RUN cd /tuv-x \
&& mkdir build \
&& cd build \
&& cmake -D CMAKE_BUILD_TYPE=release \
-D TUVX_INSTALL_INCLUDE_DIR=/usr/local/include \
-D TUVX_INSTALL_MOD_DIR=/usr/local/include \
/tuv-x \
.. \
&& make install -j 8

WORKDIR /build
WORKDIR /tuv-x/build
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these changes be reverted to match the rest of the Dockerfile's or is this change still needed?

src/CMakeLists.txt Outdated Show resolved Hide resolved
Co-authored-by: mwaxmonsky <[email protected]>
Copy link
Collaborator

@sjsprecious sjsprecious left a comment

Choose a reason for hiding this comment

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

Thanks @AdityaDendukuri for working on this PR and addressing all the comments.

@mattldawson mattldawson merged commit 9b48b5d into main Jul 16, 2024
10 checks passed
@mattldawson mattldawson deleted the lapacke_debug branch July 16, 2024 15:50
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.

Compare the correctness and performance of the C++ tridiagonal solver code with LAPACKE
7 participants