-
Notifications
You must be signed in to change notification settings - Fork 213
Implement Principal Component Analysis (PCA) module #1086
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1086 +/- ##
==========================================
- Coverage 68.69% 68.60% -0.09%
==========================================
Files 393 394 +1
Lines 12720 12730 +10
Branches 1376 1376
==========================================
- Hits 8738 8734 -4
- Misses 3982 3996 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@JAi-SATHVIK the build fails happen because in the CMakeLists.txt for the stats module you need to add something like target_link_libraries(stats PUBLIC blas lapack) Also, in my previous comment regarding the kinds support, what I meant was: please enable all kinds, stdlib provids the backends. Linking against optimized libraries is optional and would increase performance for simple and double precision. But all kinds are supported. |
|
Thank you @jalvesz , for the clarification! I've made the following updates: CMakeLists.txt: The Documentation: Updated the inline comments in both |
|
New fails are happening because of the dependency on the sorting module. This exposes an issue with the modularization of the library. The sorting module being at the root of src is not visible by the stats module within its own independent folder... we might need to reconsider next steps. One idea would be to make this library (pca) not a submodule of stats but a module in itself at the root of src such that it can use easily any other module such as stats, blas/lapack and sorting. Or there might be another approach to think about |
In this case, add
However, I agree with that. When I was working on #1081, I started to get "faked" circular dependencies.
If the CMake file is correctly written, a submodule "pca" should not be a problem. |
|
Thank you @jalvesz @jvdp1 for the insights. Regarding the immediate build failure, I will try adding ../stdlib_sorting.fypp to the src/stats/CMakeLists.txt as suggested to resolve the visibility issue with the sorting module. Regarding the structural change: I'm open to moving PCA to a standalone module in src/ if that aligns better with the library's goals for modularity and reducing compilation overhead. Should I proceed with the CMake fix first to verify the current logic, or would you prefer I start refactoring it into its own module now? |
|
I'll suggest to go step by step: first try to fix "as is", then let's continue the discussion on what would be the best strategy. |
This reverts commit 7348faf.
|
Hi, @jvdp1 I've addressed the previous review comments (code cleanup, precision support, etc.), but I'm consistently hitting an Internal Compiler Error (Segmentation Fault) with the Intel I propose refactoring the remaining |
I am surprised about this, because |
|
Here is my take with respect to |
If I am correct, it is the case in the last commit. However there are still issues.
I agree with you regarding debugging. However I would hope that the compiler can better optimize this code: compared to (most likely resulting in a temporary array): Aynway, @JAi-SATHVIK , I suggest to use the second version, until the code pass successfully with |
| call pca_eigh_driver_${k1}$(x_centered, n, p, components, singular_values, err0) | ||
| case default | ||
| err0 = linalg_state_type("pca", LINALG_ERROR, "Unknown method: "//method_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JAi-SATHVIK : Commenting this line solves the issue with ifx on my computer. I will investigate the reason.
\cc @jalvesz
| call pca_eigh_driver_${k1}$(x_centered, n, p, components, singular_values, err0) | ||
| case default | ||
| err0 = linalg_state_type("pca", LINALG_ERROR, "Unknown method: "//method_) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| err0 = linalg_state_type("pca", LINALG_ERROR, "Unknown method: "//method_) | |
| err0 = linalg_state_type("pca", LINALG_ERROR, "Unknown method: ", method_) |
#1080