Skip to content

Delete cuTensor #965

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

Merged
merged 2 commits into from
Jul 22, 2025
Merged

Delete cuTensor #965

merged 2 commits into from
Jul 22, 2025

Conversation

wilfonba
Copy link
Contributor

@wilfonba wilfonba commented Jul 21, 2025

User description

Description

Delete cuTensor and the code for riemann_flat and weno_flat that hasn't existed for years.

Type of change

  • Something else

Scope

  • This PR comprises a set of related changes with a common goal

PR Type

Other


Description

  • Remove cuTensor library support from MFC

  • Delete compiler checks for cuTensor availability

  • Remove cuTensor-based tensor reshaping operations

  • Simplify WENO scheme to use standard GPU loops


Diagram Walkthrough

flowchart LR
  A["cuTensor Support"] -- "remove" --> B["Standard GPU Loops"]
  C["CMake Configuration"] -- "delete" --> D["Simplified Build"]
  E["Compiler Checks"] -- "remove" --> F["Cleaner Validation"]
Loading

File Walkthrough

Relevant files
Configuration changes
m_checker.fpp
Remove cuTensor compiler validation                                           

src/simulation/m_checker.fpp

  • Remove compiler check for cuTensor library availability
  • Delete MFC_cuTENSOR preprocessor condition
+0/-5     
Enhancement
m_weno.fpp
Replace cuTensor with standard GPU loops                                 

src/simulation/m_weno.fpp

  • Remove cuTensor-based tensor reshaping operations
  • Replace with standard GPU parallel loops
  • Simplify WENO characteristic field projections
  • Delete cuTensorEx module usage
+15/-52 
Dependencies
CMakeLists.txt
Remove cuTensor build configuration                                           

CMakeLists.txt

  • Remove cuTensor package finding logic
  • Delete cuTensor library linking
  • Remove MFC_cuTENSOR compile definition
+0/-11   

@Copilot Copilot AI review requested due to automatic review settings July 21, 2025 15:58
@wilfonba wilfonba requested review from a team as code owners July 21, 2025 15:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes cuTensor support from MFC by eliminating all cuTensor-related code, build configurations, and conditional compilation blocks. The changes simplify the WENO implementation by removing GPU-accelerated tensor reshape operations and their associated fallback logic.

Key changes:

  • Removal of cuTensor conditional compilation blocks and reshape operations in WENO routines
  • Elimination of cuTensor build system integration and compiler checks
  • Simplification of control flow by removing cuTensor-specific code paths

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/simulation/m_weno.fpp Removes cuTensor conditional blocks and GPU tensor reshape operations for y and z directions
src/simulation/m_checker.fpp Eliminates cuTensor compiler availability check
CMakeLists.txt Removes cuTensor library detection, linking, and build configuration
Comments suppressed due to low confidence (1)

src/simulation/m_weno.fpp:1165

  • [nitpick] This appears to be an unintentional blank line addition. Consider removing it to maintain consistent spacing in the code.
                        do k = is1_weno%beg - weno_polyn, is1_weno%end + weno_polyn

Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Logic Change

The removal of cuTensor conditional logic may change computational behavior. The standard GPU loops replace tensor reshaping operations which could have different performance characteristics or numerical precision. Verify that the replacement logic produces equivalent results.

    $:GPU_PARALLEL_LOOP(collapse=4)
    do j = 1, v_size
        do q = is3_weno%beg, is3_weno%end
            do l = is2_weno%beg, is2_weno%end
                do k = is1_weno%beg - weno_polyn, is1_weno%end + weno_polyn
                    v_rs_ws_y(k, l, q, j) = v_vf(j)%sf(l, k, q)
                end do
            end do
        end do
    end do
end if

! Reshaping/Projecting onto Characteristic Fields in z-direction
if (p == 0) return

if (weno_dir == 3) then
    $:GPU_PARALLEL_LOOP(collapse=4)
    do j = 1, v_size
        do q = is3_weno%beg, is3_weno%end
            do l = is2_weno%beg, is2_weno%end
                do k = is1_weno%beg - weno_polyn, is1_weno%end + weno_polyn
                    v_rs_ws_z(k, l, q, j) = v_vf(j)%sf(q, l, k)
                end do
            end do
        end do
    end do
end if
Missing Validation

The removal of the cu_tensor parameter validation check means users can still set cu_tensor=T but it will no longer be validated or functional. This could lead to silent failures or unexpected behavior.

    impure subroutine s_check_inputs_compilers
#if !defined(MFC_OpenACC) && !(defined(__PGI) || defined(_CRAYFTN))
        @:PROHIBIT(rdma_mpi, "Unsupported value of rdma_mpi for the current compiler")
#endif
    end subroutine s_check_inputs_compilers

Copy link

qodo-merge-pro bot commented Jul 21, 2025

PR Code Suggestions ✨

No code suggestions found for the PR.

@sbryngelson
Copy link
Member

@wilfonba
Copy link
Contributor Author

a couple of stragglers?

github.com/search?q=repo%3Awilfonba%2FMFC-Wilfong+cutensor+OR+repo%3Awilfonba%2FMFC-Wilfong++cu_tensor&type=code

I think this is a search of the master branch on my fork? These are all of the lines that I removed.

@sbryngelson
Copy link
Member

nvm. will merge when tests pass (which i'm sure they will)

Copy link

codecov bot commented Jul 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.06%. Comparing base (f2ef560) to head (58dcc9b).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #965      +/-   ##
==========================================
- Coverage   44.08%   44.06%   -0.02%     
==========================================
  Files          69       69              
  Lines       19573    19568       -5     
  Branches     2428     2430       +2     
==========================================
- Hits         8628     8623       -5     
  Misses       9444     9444              
  Partials     1501     1501              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sbryngelson sbryngelson merged commit c933e72 into MFlowCode:master Jul 22, 2025
33 checks passed
@wilfonba wilfonba deleted the cuTensorDelete branch July 22, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy