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

Fix Memory Model and Internal TRSM failure #852

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

AGonzales-amd
Copy link
Contributor

This PR fixes the checkin_misc_MEMORY_MODEL.user_managed test failure when ROCSOLVER_USE_INTERNAL_BLAS is set and internal trsm is used for rocsolver_dgetrf_strided_batched.

@tfalders tfalders added the noOptimizations Disable optimized kernels for small sizes for some routines label Nov 21, 2024
@AGonzales-amd AGonzales-amd marked this pull request as ready for review December 11, 2024 20:26
Comment on lines +207 to +212
#ifndef USE_INTERNAL_TRSM
EXPECT_GT(size, 2000000);
#else
// internal trsm does not use scratch memory
EXPECT_LT(size, 2000000);
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @AGonzales-amd, those changes fix the failure, but I am afraid that they are not improving the test. The real problem is that this test is making assumptions about the implementation of getrf, and this is brittle: Unless it is absolutely necessary, we should not allow tests to make any assumptions about internal implementations. Implementations can change and render those assumptions redundant (which is exactly what is happening when getrf uses our TRSM).

A more appropriate solution would be to completely remove any calls to getrf that expect it to allocate an implementation dependent amount of memory, and make sure that the test itself sets everything it needs, explicitly.

#else
// internal trsm does not use scratch memory
EXPECT_EQ(status, rocblas_status_success);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor questions: Is there a rocsolver function so the user can know say 100MB will be sufficient for the dgetrf rocsolver call for a certain matrix size, or this is just trial-and-error or keep doubling the size until it works? Perhaps when using rocblas managed mode, there is a way to query the max memory pool size used? Perhaps the user can use rocblas managed mode, then later switch to user owned mode (but knowing the max pool size used in rocblas) for higher performance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
noOptimizations Disable optimized kernels for small sizes for some routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants