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

[NDTensors] Some fixes for element type promotion and conversion #1244

Merged
merged 8 commits into from
Nov 10, 2023

Conversation

mtfishman
Copy link
Member

@mtfishman mtfishman commented Nov 9, 2023

This fixes a few issues with element type promotion and conversion, such as mixed element type contractions of block sparse tensors on GPU as well as better element type preservation when the noise term is enabled in DMRG.

I also extended the new DMRG tests on GPU introduced in #1236 to the case of QN conservation/block sparse tensors, which pass locally for me using a Metal backend.

  • Add a test for an eigendecomposition of a complex Hermitian matrix, testing that the eigenvalues are real.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@codecov-commenter
Copy link

codecov-commenter commented Nov 9, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (b7119d6) 85.44% compared to head (c5c8175) 54.81%.
Report is 1 commits behind head on main.

❗ Current head c5c8175 differs from pull request most recent head 5a20441. Consider uploading reports for the commit 5a20441 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1244       +/-   ##
===========================================
- Coverage   85.44%   54.81%   -30.63%     
===========================================
  Files          89       88        -1     
  Lines        8400     8348       -52     
===========================================
- Hits         7177     4576     -2601     
- Misses       1223     3772     +2549     
Files Coverage Δ
src/mps/dmrg.jl 0.00% <0.00%> (-84.04%) ⬇️

... and 36 files with indirect coverage changes

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

@mtfishman
Copy link
Member Author

@kmp5VT so interestingly the new tests I added for block sparse DMRG pass on CPU and Metal (I checked locally) but seem to be failing with CUDA.

@kmp5VT
Copy link
Collaborator

kmp5VT commented Nov 10, 2023

@kmp5VT so interestingly the new tests I added for block sparse DMRG pass on CPU and Metal (I checked locally) but seem to be failing with CUDA.

That is interesting, I can look into what is going on later today!

@mtfishman
Copy link
Member Author

Thanks! I've marked the tests as broken for now so I can merge this fix.

@mtfishman
Copy link
Member Author

@kmp5VT I noticed some of the tests you wrote in #1236 used arrays with uninitialized memory (i.e. Vector{Float64}(undef, 4)) and then used those in algebra operations. In general that is not a good idea since then you can randomly get elements with NaN or Inf which don't play nicely when doing algebra. Better to allocate them to something random, like randn(Float64, 4).

@mtfishman mtfishman merged commit 7eb2e30 into main Nov 10, 2023
9 checks passed
@mtfishman mtfishman deleted the NDTensors_eltype_fixes branch November 10, 2023 16:48
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.

3 participants