Skip to content

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Jan 8, 2026

This is an attempt to get rid of the scalar-indexing oriented approach, and instead do more global operations.
Definitely still WIP, and on CPU there are definitely various optimizations that can be applied if needed.
I do wonder about the performance a bit, as I would actually expect that for a large number of sectors this might just be faster.

Some possible optimizations:

  • for UniqueFusion, finding the nth value is simply partialsortperm(values, n; by, rev), avoiding the need to allocate the full permutation vector
  • for CPU, cumsum + findlast can be replaced by a loop to avoid some intermediate allocations

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 91.56627% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tensors/sectorvector.jl 50.00% 4 Missing ⚠️
src/factorizations/adjoint.jl 75.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
ext/TensorKitCUDAExt/TensorKitCUDAExt.jl 100.00% <ø> (ø)
ext/TensorKitCUDAExt/truncation.jl 100.00% <100.00%> (ø)
src/factorizations/diagonal.jl 72.72% <100.00%> (+6.06%) ⬆️
src/factorizations/truncation.jl 94.83% <100.00%> (+6.90%) ⬆️
src/factorizations/adjoint.jl 73.07% <75.00%> (-1.35%) ⬇️
src/tensors/sectorvector.jl 40.57% <50.00%> (-7.81%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Jutho
Copy link
Member

Jutho commented Jan 12, 2026

I think that implementation is very clean. Not sure I can explain all the errors. Some seem to originate from the eigenvectors of a DiagonalTensorMap also being diagonal, which is being changed, right? But other errors I cannot directly explain without running the code locally.

@lkdvos
Copy link
Member Author

lkdvos commented Jan 12, 2026

I will have a look later, I have a local branch to fix the diagonal implementations already, we'll see what remains after.
I'll also try if it actually works on GPU, and get a similar implementation going for the truncerror version.

@kshyatt kshyatt force-pushed the ld-truncation branch 2 times, most recently from 499360d to 77f0ffa Compare January 20, 2026 10:27
@kshyatt
Copy link
Member

kshyatt commented Jan 22, 2026

I think this one still needs a little work to get it over the finish line, but then we should be able to really try CUDA with the TNR and PEPS stuff

@github-actions
Copy link
Contributor

github-actions bot commented Jan 22, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

@lkdvos
Copy link
Member Author

lkdvos commented Jan 22, 2026

wait please don't I'm working on this 😆

@kshyatt
Copy link
Member

kshyatt commented Jan 22, 2026

I'll stop I just wanted to fix formatting and rebase!!!

@lkdvos
Copy link
Member Author

lkdvos commented Jan 22, 2026

Hahah but the rebase screws up the git history, now I gotta see how much git magic I know to fix my local branch

@kshyatt
Copy link
Member

kshyatt commented Jan 22, 2026

Oh no I'm sorry!

@lkdvos lkdvos linked an issue Jan 22, 2026 that may be closed by this pull request
1 task
@lkdvos lkdvos marked this pull request as ready for review January 23, 2026 12:58
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.

GPU + truncation support collation issue

4 participants