-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into non-abelian_fusion
- Loading branch information
Showing
23 changed files
with
345 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "NDTensors" | ||
uuid = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" | ||
authors = ["Matthew Fishman <[email protected]>"] | ||
version = "0.3.13" | ||
version = "0.3.18" | ||
|
||
[deps] | ||
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" | ||
|
@@ -14,7 +14,6 @@ EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949" | |
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b" | ||
Folds = "41a02a25-b8f0-4f67-bc48-60067656b558" | ||
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196" | ||
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" | ||
HalfIntegers = "f0d1745a-41c9-11e9-1dd9-e5d34d218721" | ||
InlineStrings = "842dd82b-1e85-43dc-bf29-5d0ee9dffc48" | ||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
|
@@ -35,17 +34,19 @@ VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8" | |
[weakdeps] | ||
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" | ||
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" | ||
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" | ||
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" | ||
Metal = "dde4c033-4e86-420c-a63e-0dd931031962" | ||
Octavian = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4" | ||
TBLIS = "48530278-0828-4a49-9772-0f3830dfa1e9" | ||
cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1" | ||
|
||
[extensions] | ||
NDTensorsAMDGPUExt = "AMDGPU" | ||
NDTensorsCUDAExt = "CUDA" | ||
NDTensorsAMDGPUExt = ["AMDGPU","GPUArraysCore"] | ||
NDTensorsCUDAExt = ["CUDA","GPUArraysCore"] | ||
NDTensorsGPUArraysCoreExt = "GPUArraysCore" | ||
NDTensorsHDF5Ext = "HDF5" | ||
NDTensorsMetalExt = "Metal" | ||
NDTensorsMetalExt = ["GPUArraysCore", "Metal"] | ||
NDTensorsOctavianExt = "Octavian" | ||
NDTensorsTBLISExt = "TBLIS" | ||
NDTensorscuTENSORExt = "cuTENSOR" | ||
|
@@ -90,6 +91,7 @@ julia = "1.6" | |
[extras] | ||
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" | ||
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" | ||
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" | ||
HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" | ||
Metal = "dde4c033-4e86-420c-a63e-0dd931031962" | ||
Octavian = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
NDTensors/ext/NDTensorsGPUArraysCoreExt/NDTensorsGPUArraysCoreExt.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module NDTensorsGPUArraysCoreExt | ||
include("contract.jl") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
using Adapt: adapt | ||
using GPUArraysCore: AbstractGPUArray | ||
using NDTensors: NDTensors, DenseTensor, DiagTensor, contract!, dense, inds, Tensor | ||
using NDTensors.Expose: Exposed, expose, unexpose | ||
using NDTensors.TypeParameterAccessors: parenttype, set_ndims | ||
|
||
## In this function we convert the DiagTensor to a dense tensor and | ||
## Feed it back into contract | ||
function NDTensors.contract!( | ||
output_tensor::Exposed{<:AbstractGPUArray,<:DenseTensor}, | ||
labelsoutput_tensor, | ||
tensor1::Exposed{<:Number,<:DiagTensor}, | ||
labelstensor1, | ||
tensor2::Exposed{<:AbstractGPUArray,<:DenseTensor}, | ||
labelstensor2, | ||
α::Number=one(Bool), | ||
β::Number=zero(Bool), | ||
) | ||
tensor1 = unexpose(tensor1) | ||
## convert tensor1 to a dense | ||
## TODO this allocates on CPU first then moves over to GPU which could be slow | ||
tensor1 = adapt(set_ndims(parenttype(typeof(tensor2)), 1), dense(tensor1)) | ||
return contract!( | ||
output_tensor, | ||
labelsoutput_tensor, | ||
expose(tensor1), | ||
labelstensor1, | ||
tensor2, | ||
labelstensor2, | ||
α, | ||
β, | ||
) | ||
end | ||
|
||
function NDTensors.contract!( | ||
output_tensor::Exposed{<:AbstractGPUArray,<:DenseTensor}, | ||
labelsoutput_tensor, | ||
tensor1::Exposed{<:AbstractGPUArray,<:DenseTensor}, | ||
labelstensor1, | ||
tensor2::Exposed{<:Number,<:DiagTensor}, | ||
labelstensor2, | ||
α::Number=one(Bool), | ||
β::Number=zero(Bool), | ||
) | ||
return contract!( | ||
output_tensor, labelsoutput_tensor, tensor2, labelstensor2, tensor1, labelstensor1, α, β | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
NDTensors/src/lib/BlockSparseArrays/src/abstractblocksparsearray/arraylayouts.jl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
NDTensors/src/lib/BlockSparseArrays/src/abstractblocksparsearray/linearalgebra.jl
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.