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

Use stedc instead of sterf in syevd #901

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

Conversation

tfalders
Copy link
Collaborator

Performance numbers reveal that running syevd with stedc is orders of magnitude faster than with sterf, so this PR changes syevd to use stedc instead of sterf.

To preserve access to the numerical properties of sterf, syevd will still use sterf if hybrid sterf is enabled, since the performance difference there is much less.

@tfalders tfalders added the noOptimizations Disable optimized kernels for small sizes for some routines label Feb 26, 2025
EXPECT_ROCBLAS_STATUS(rocsolver_get_alg_mode(handle, rocsolver_function_sterf, &alg_mode),
rocblas_status_success);

EXPECT_EQ(alg_mode, rocsolver_alg_mode_hybrid);
Copy link
Contributor

Choose a reason for hiding this comment

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

Just double checking whether if alg_mode is set, it must be hybrid mode.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Currently, alg_mode only has two valid values - hybrid (1) or not hybrid (0) - but you make a good point. To future proof it, I should probably check that it is actually equal to 1.

@@ -103,11 +105,19 @@ class SYEVD_HEEVD : public ::TestWithParam<syevd_heevd_tuple>
}
};

class SYEVD : public SYEVD_HEEVD
class SYEVD : public SYEVD_HEEVD<0>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just double checking whether "MODE" is an enum value such as rocsolver_alg_mode_hybrid. If so, perhaps it might be clearer to use the enum name. Just a thought.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmmmm, it might be worth revisiting. IIRC, I made it 0 and 1 instead of an enum because it comes into rocsolver-bench that way, and also because other arguments in rocsolver_arguments.hpp are int types. Which aren't particularly compelling reasons to keep it that way.

@@ -184,7 +177,7 @@ rocblas_status rocsolver_syevd_heevd_template(rocblas_handle handle,
strideE, tau, n, batch_count, scalars, (T*)work1,
(T*)work2, tmptau_W, workArr);

if(evect != rocblas_evect_original)
if(sterf_mode == rocsolver_alg_mode_hybrid && evect != rocblas_evect_original)
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor comment: do we need more enum option values for the new algorithm? Just a thought.

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.

2 participants