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 and test for issue 100 #103

Merged
merged 5 commits into from
Nov 13, 2024
Merged

Fix and test for issue 100 #103

merged 5 commits into from
Nov 13, 2024

Conversation

lkdvos
Copy link
Collaborator

@lkdvos lkdvos commented Nov 12, 2024

This is a more conservative approach to using the multithreaded kernels, which could even be reenabled by users by overloading the _use_multithreaded_array_kernel.

Fixes #100

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.49%. Comparing base (1b175b7) to head (e2d0299).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #103      +/-   ##
==========================================
+ Coverage   85.37%   85.49%   +0.11%     
==========================================
  Files          30       30              
  Lines        3268     3274       +6     
==========================================
+ Hits         2790     2799       +9     
+ Misses        478      475       -3     

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

@lkdvos lkdvos requested a review from Jutho November 12, 2024 14:26
@@ -62,6 +62,19 @@ LinearAlgebra.mul!(y, b::OrthonormalBasis, x::AbstractVector) = unproject!!(y, b

const BLOCKSIZE = 4096

# helper function to determine if a multithreaded approach should be used
# this uses functionality beyond VectorInterface, but can be faster
_use_multithreaded_array_kernel(y) = false
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe, in order to avoid duplication of cases:

_use_multithreaded_array_kernel(y) = _use_multithreaded_array_kernel(typeof(y))
_use_multithreaded_array_kernel(::Type) = false
function _use_multithreaded_array_kernel(::Type{<:Array{T}}) where {T<:Number}
     return isbitstype(T) && get_num_threads() > 1
 end
 function _use_multithreaded_array_kernel(::Type{<:OrthonormalBasis{T}}) where {T}
     return _use_multithreaded_array_kernel(T)
 end

@Jutho
Copy link
Owner

Jutho commented Nov 13, 2024

Looks good. Could you also check if this is the only reason why GPUArraysCore.jl was introduced as dependency, and if so, remove it from Project.toml?

src/orthonormal.jl Outdated Show resolved Hide resolved
@@ -1,10 +1,9 @@
name = "KrylovKit"
uuid = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
authors = ["Jutho Haegeman"]
version = "0.8.2"
version = "0.8.3"
Copy link
Owner

Choose a reason for hiding this comment

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

With the new functionality of the other PR, I would probably go to 0.9. Unless you need this as quickly as possible (I guess the other one would take a few more changes and one more CI run) and want to already tag this right now. I can then also change to 0.9 after merging #105 .

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it would be convenient for me if it was 0.8.3, since the RecursiveVec thing broke things... In the end, it does not matter too much, I changed this here to test it out with MPSKit

@Jutho
Copy link
Owner

Jutho commented Nov 13, 2024

Feel free to merge when you see fit.

@lkdvos lkdvos merged commit 7e91607 into master Nov 13, 2024
11 of 12 checks passed
@Jutho Jutho deleted the ld-issue100 branch January 17, 2025 11:10
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.

AbstractArray vector subtypes get wrongly handled
2 participants