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] Unwrap module for dispatching on unwrapped types #1220

Merged
merged 93 commits into from
Nov 1, 2023

Conversation

kmp5VT
Copy link
Collaborator

@kmp5VT kmp5VT commented Oct 26, 2023

Description

In this PR I attempt to address issues we are having with generic programming. This issue is that wrapped arrays can become too complicated for Julia to parse correctly for dispatch and as a result, incorrect functions are called which in turn slows down the code. Here I am creating a simple Expose type which will determine the base unwrapped type and launch the appropriate kernels based on this type.

This will fix #1193 (we should confirm that before merging).

Checklist:

  • Create Expose type and function to create type.
  • Replace NDTensors code where we implicitly unwrap code (through parent_leaftype) and instead dispatch on the expose struct
  • Ensure that all tests still pass in NDTensors and ITensors
  • Fix scalar indexing issues in GPU SVD code
  • address merge conflicts

@kmp5VT kmp5VT requested a review from mtfishman October 26, 2023 15:17
@kmp5VT kmp5VT marked this pull request as draft October 26, 2023 15:17
@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2023

Codecov Report

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

Comparison is base (70967cd) 82.87% compared to head (356c451) 54.54%.

❗ Current head 356c451 differs from pull request most recent head 130d4f7. Consider uploading reports for the commit 130d4f7 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    #1220       +/-   ##
===========================================
- Coverage   82.87%   54.54%   -28.34%     
===========================================
  Files          89       88        -1     
  Lines        8440     8392       -48     
===========================================
- Hits         6995     4577     -2418     
- Misses       1445     3815     +2370     
Files Coverage Δ
src/mps/dmrg.jl 0.00% <0.00%> (-79.11%) ⬇️
src/set_types.jl 0.00% <0.00%> (ø)

... and 36 files with indirect coverage changes

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

@mtfishman mtfishman changed the title Create Unwraped folder and move most of the iswrappedarray function… [NDTensors] Unwrap module for dispatching on unwrapped types Oct 27, 2023
@mtfishman
Copy link
Member

@kmp5VT I fixed the merge conflicts.

This looks good to go from my end, is this ready from your end? Any more scalar indexing issues you wanted to address?

@mtfishman
Copy link
Member

Ah looks like some tests are failing, I introduced code into main that uses leaf_parenttype and parenttype which needs to get updated.

@kmp5VT
Copy link
Collaborator Author

kmp5VT commented Nov 1, 2023

Ah looks like some tests are failing, I introduced code into main that uses leaf_parenttype and parenttype which needs to get updated.

Yeah I found those areas and fixed them

@kmp5VT
Copy link
Collaborator Author

kmp5VT commented Nov 1, 2023

@mtfishman Okay this PR should be good now. Thanks!

@mtfishman mtfishman marked this pull request as ready for review November 1, 2023 17:02
@mtfishman mtfishman merged commit 66f5d39 into ITensor:main Nov 1, 2023
7 checks passed
@kmp5VT kmp5VT deleted the kmp5/enhancements/unwrap branch April 15, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants