Skip to content

Very basic CUDA support#66

Closed
kshyatt wants to merge 1 commit intomainfrom
ksh/cu
Closed

Very basic CUDA support#66
kshyatt wants to merge 1 commit intomainfrom
ksh/cu

Conversation

@kshyatt
Copy link
Member

@kshyatt kshyatt commented Feb 6, 2026

Add support for passing array types instead of just element types as well as CUDA-compatible operator builders. For some of these it may make more sense to just turn the ops into CuTensorMaps at the end, rather than using @allowscalar.

@kshyatt kshyatt requested a review from lkdvos February 6, 2026 10:34
Copy link
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

I think I agree with your assessment that this is probably not entirely what we want, and we should simply provide adapt functionality for operators in MPSKit.
My main motivation here is that:

  1. I am not sure if we really have to support being able to swap out every part of the pipeline to run on GPU. As I don't think this is typically a bottleneck, I would much rather reduce the amount of code and avoid having to add extensions and dependencies here that we also have to maintain.
  2. Given the @allowscalar calls I don't think this is any more efficient than simply constructing everything on CPU and then sending it over.
  3. In principle all of this code for creating the tensors should eventually be replaced by the TensorKitTensors.jl implementations, but that just hasn't happened yet. Therefore I would prefer to not have to add this here, if that would work?

@kshyatt
Copy link
Member Author

kshyatt commented Feb 6, 2026

Well, not having this is completely blocking a lot of the PEPSKit and MPSKit examples from working... we could get rid of the @allowscalars for now, just copy everything to GPU after construction, and then delete all this (the extension) after that other package is ready?

@lkdvos
Copy link
Member

lkdvos commented Feb 6, 2026

Is there a reason not to change the GPU examples to simply have the workflow of using Adapt.jl? Since this already works for TensorMap, this should just be a matter of defining these functions on the higher-level structures, which arguably might be a lot less code (and something we need anyways)?

@kshyatt kshyatt closed this Feb 9, 2026
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.

2 participants