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.

The main point is to take all the singular/eigen values at the same time, and sort them in their entirety.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 91.26214% with 9 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 ⚠️
ext/TensorKitCUDAExt/truncation.jl 96.77% 1 Missing ⚠️
src/factorizations/truncation.jl 98.03% 1 Missing ⚠️
Files with missing lines Coverage Δ
ext/TensorKitCUDAExt/TensorKitCUDAExt.jl 100.00% <ø> (ø)
src/factorizations/diagonal.jl 72.72% <100.00%> (+6.06%) ⬆️
ext/TensorKitCUDAExt/truncation.jl 96.77% <96.77%> (ø)
src/factorizations/truncation.jl 94.37% <98.03%> (+6.44%) ⬆️
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!

kshyatt
kshyatt previously approved these changes Jan 27, 2026

function MatrixAlgebraKit.findtruncated(
values::CuSectorVector, strategy::MatrixAlgebraKit.TruncationByError
)
Copy link
Member

@Jutho Jutho Jan 27, 2026

Choose a reason for hiding this comment

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

This probably needs to be special cased for p == Inf, if we want to support this. That in itself should be quite an easy case.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just checked, and at least in MatrixAlgebraKit we are currently not supporting this. While I don't necessarily have any strong opinions in favor or against this, I will for now simply add a check and leave this as TBA?

@lkdvos
Copy link
Member Author

lkdvos commented Jan 28, 2026

@kshyatt Do you have any clue why the CUDA tests could be giving segfaults? Is this something I caused or are we running into a different issue?

Otherwise I think this PR is ready to get merged, would be great to get this done.

@lkdvos lkdvos requested review from Jutho and kshyatt January 28, 2026 16:01
@kshyatt
Copy link
Member

kshyatt commented Jan 28, 2026

CUDA 12 sometimes freaks out due to bad LLVM, I retried the build

@lkdvos lkdvos enabled auto-merge (squash) January 28, 2026 17:42
@lkdvos lkdvos merged commit 25372cb into main Jan 28, 2026
42 checks passed
@lkdvos lkdvos deleted the ld-truncation branch January 28, 2026 17:49
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