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

Refactoring GPU extensions #1365

Merged
merged 66 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a36f446
Update the CUDA extension library move usings out of module name file
kmp5VT Mar 22, 2024
1962f6f
Merge commit 'b48b88168caa0bb66aee86116a932d4f71713658' into kmp5/ref…
kmp5VT Mar 27, 2024
b2a2490
format
kmp5VT Mar 27, 2024
7fe2013
Update adapt, checking on workstation
kmp5VT Mar 27, 2024
56a9209
format
kmp5VT Mar 27, 2024
d7fe3b3
Fix cuarray adaptor issue
kmp5VT Mar 27, 2024
bff4b16
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Mar 28, 2024
00dcb54
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Mar 28, 2024
2016ff7
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Mar 28, 2024
4a59610
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Mar 29, 2024
7690456
Update Fill so CUDA DMRG works
kmp5VT Mar 30, 2024
d158aef
Merge branch 'kmp5/refactor/update_gpu_backends' of github.com:kmp5VT…
kmp5VT Mar 30, 2024
7694636
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Mar 30, 2024
a3617c7
format
kmp5VT Mar 30, 2024
bad9b37
Remove an artifact of debugging
kmp5VT Mar 30, 2024
78a306e
Create CUDA append! function.
kmp5VT Mar 30, 2024
7bac7bb
add append to module
kmp5VT Mar 30, 2024
e2a65ff
Missing a using
kmp5VT Mar 30, 2024
4730c84
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Apr 1, 2024
e997c38
Create expose version of append! to use `@allowscalar`
kmp5VT Apr 1, 2024
d9c7d69
Merge branch 'kmp5/refactor/update_gpu_backends' of github.com:kmp5VT…
kmp5VT Apr 1, 2024
252c9c9
Don't test append! with Metal
kmp5VT Apr 1, 2024
caf124d
Streamline generic_zeros functions
kmp5VT Apr 1, 2024
cd53b01
Flatten the block_size variables
kmp5VT Apr 1, 2024
b1b0201
format
kmp5VT Apr 1, 2024
e5a7d74
Remove duplicate lines
kmp5VT Apr 1, 2024
aaf61af
cu and roc now works
kmp5VT Apr 1, 2024
fe2e8a2
Make append! for each GPU backend
kmp5VT Apr 1, 2024
6a60f90
Update comment
kmp5VT Apr 1, 2024
5f73d1e
remove append!!
kmp5VT Apr 1, 2024
5ed42b2
Allow any dimension for generic_randn instead of integer
kmp5VT Apr 1, 2024
4f7bb44
format
kmp5VT Apr 1, 2024
22532be
storage -> storagemode
kmp5VT Apr 2, 2024
a2783b7
Delete examples
kmp5VT Apr 2, 2024
790ba98
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Apr 2, 2024
83bb90c
remove usings from NDTensorsMetalExt module file
kmp5VT Apr 3, 2024
8e568d5
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Apr 3, 2024
5ffaf67
Update rest of Metal ext package
kmp5VT Apr 3, 2024
11200ab
Add metalarrayadaptor and cleanup
kmp5VT Apr 3, 2024
ebb3669
Merge branch 'kmp5/refactor/update_gpu_backends' of github.com:kmp5VT…
kmp5VT Apr 3, 2024
f290d79
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Apr 3, 2024
a0b2c0a
swapping NDTensors and ITensors dev should fix git tests
kmp5VT Apr 3, 2024
f66574a
Same error with CUDA and NDTensors so activate temp environment to fix
kmp5VT Apr 3, 2024
ed9866a
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Apr 3, 2024
eb52e6f
Add warning comments about append being slow
kmp5VT Apr 3, 2024
dab7098
Add a check for the dimensions
kmp5VT Apr 4, 2024
5710c81
Add comment about requireing Position of ndims to be defined
kmp5VT Apr 4, 2024
f00b810
Merge branch 'main' into kmp5/refactor/update_gpu_backends
kmp5VT Apr 4, 2024
d263d57
Update generic_randn for dense
kmp5VT Apr 4, 2024
ee8ba2e
format
kmp5VT Apr 4, 2024
511d434
Update fill
kmp5VT Apr 4, 2024
153295e
rename fill.jl to generic_array_constructors.jl
kmp5VT Apr 4, 2024
15dc0b2
Code review
kmp5VT Apr 5, 2024
e088096
Swap internal function
kmp5VT Apr 5, 2024
b61311d
remove functions
kmp5VT Apr 5, 2024
7eda284
move using to top
kmp5VT Apr 5, 2024
dd437d7
Bump NDTensors minor version
kmp5VT Apr 5, 2024
cd1eb24
Use ndims instead of type_parameter
kmp5VT Apr 5, 2024
4dfbbdb
update generic_randn function for dense
kmp5VT Apr 5, 2024
296f0da
Update
kmp5VT Apr 5, 2024
64f0778
format
kmp5VT Apr 5, 2024
57abe1f
Update tests to use temp project instead of monorepo for safety
kmp5VT Apr 5, 2024
1ca8c8b
Reverse the structure again
kmp5VT Apr 5, 2024
036bcb1
format
kmp5VT Apr 5, 2024
d212282
Update ITensors and NDTensors versions
kmp5VT Apr 12, 2024
a530e0b
Update function call
kmp5VT Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NDTensors/ext/NDTensorsAMDGPUExt/adapt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Adapt.adapt_storage(adaptor::ROCArrayAdaptor, xs::AbstractArray)
end

function NDTensors.adapt_storagetype(
adaptor::ROCArrayAdaptor, xs::Type{EmptyStorage{ElT,StoreT}}
adaptor::ROCArrayAdaptor, ::Type{EmptyStorage{ElT,StoreT}}
) where {ElT,StoreT}
roctype = set_type_parameters(
ROCVector, (eltype, storagemode), (ElT, storagemode(adaptor))
Expand Down
11 changes: 0 additions & 11 deletions NDTensors/ext/NDTensorsCUDAExt/NDTensorsCUDAExt.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
module NDTensorsCUDAExt

using NDTensors
using NDTensors.Expose
using Adapt
using Functors
using LinearAlgebra: LinearAlgebra, Adjoint, Transpose, mul!, svd
using CUDA
using CUDA.CUBLAS
using CUDA.CUSOLVER

include("imports.jl")
include("default_kwargs.jl")
include("copyto.jl")
include("set_types.jl")
Expand Down
30 changes: 16 additions & 14 deletions NDTensors/ext/NDTensorsCUDAExt/adapt.jl
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
using NDTensors.TypeParameterAccessors: TypeParameterAccessors
using NDTensors.GPUArraysCoreExtensions: storagemode
using Adapt: Adapt
using CUDA: CUDA, CuArray, CuVector
using Functors: fmap
using NDTensors: NDTensors, EmptyStorage, adapt_storagetype, emptytype
using NDTensors.CUDAExtensions: CUDAExtensions, CuArrayAdaptor
using NDTensors.GPUArraysCoreExtensions: storagemode
using NDTensors.TypeParameterAccessors:
TypeParameterAccessors, default_type_parameter, set_type_parameters, type_parameters

## TODO make this work for unified. This works but overwrites CUDA's adapt_storage. This fails for emptystorage...
function CUDAExtensions.cu(xs; unified::Bool=false)
return fmap(
x -> adapt(CuArrayAdaptor{unified ? Mem.UnifiedBuffer : Mem.DeviceBuffer}(), x), xs
)
function CUDAExtensions.cu(xs; storagemode=default_type_parameter(CuArray, storagemode))
return fmap(x -> adapt(CuArrayAdaptor{storagemode}(), x), xs)
end

## Could do this generically
function Adapt.adapt_storage(adaptor::CuArrayAdaptor, xs::AbstractArray)
ElT = eltype(xs)
BufT = storagemode(adaptor)
N = ndims(xs)
return isbits(xs) ? xs : adapt(CuArray{ElT,N,BufT}, xs)
params = (type_parameters(xs, (eltype, ndims))..., storagemode(adaptor))
cutype = set_type_parameters(CuArray, (eltype, ndims, storagemode), params)
return isbits(xs) ? xs : adapt(cutype, xs)
end

function NDTensors.adapt_storagetype(
adaptor::CuArrayAdaptor, xs::Type{EmptyStorage{ElT,StoreT}}
adaptor::CuArrayAdaptor, ::Type{EmptyStorage{ElT,StoreT}}
) where {ElT,StoreT}
BufT = storagemode(adaptor)
return NDTensors.emptytype(NDTensors.adapt_storagetype(CuVector{ElT,BufT}, StoreT))
cutype = set_type_parameters(CuVector, (eltype, storagemode), (ElT, storagemode(adaptor)))
return emptytype(adapt_storagetype(cutype, StoreT))
end
4 changes: 4 additions & 0 deletions NDTensors/ext/NDTensorsCUDAExt/copyto.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
using CUDA: CuArray
using NDTensors.Expose: Exposed, expose, parent, unexpose
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved
using LinearAlgebra: Adjoint

# Same definition as `MtlArray`.
function Base.copy(src::Exposed{<:CuArray,<:Base.ReshapedArray})
return reshape(copy(parent(src)), size(unexpose(src)))
Expand Down
3 changes: 3 additions & 0 deletions NDTensors/ext/NDTensorsCUDAExt/default_kwargs.jl
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
using CUDA: CuArray
using NDTensors: NDTensors

NDTensors.default_svd_alg(::Type{<:CuArray}, a) = "qr_algorithm"
3 changes: 0 additions & 3 deletions NDTensors/ext/NDTensorsCUDAExt/imports.jl

This file was deleted.

10 changes: 8 additions & 2 deletions NDTensors/ext/NDTensorsCUDAExt/indexing.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
using CUDA: CuArray
using GPUArraysCore: @allowscalar
using NDTensors: NDTensors
using NDTensors.Expose: Exposed, expose, parent, unexpose
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved

using GPUArraysCore: @allowscalar
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved
function Base.getindex(E::Exposed{<:CuArray})
return CUDA.@allowscalar unexpose(E)[]
return @allowscalar unexpose(E)[]
end

function Base.setindex!(E::Exposed{<:CuArray}, x::Number)
CUDA.@allowscalar unexpose(E)[] = x
@allowscalar unexpose(E)[] = x
return unexpose(E)
end

Expand Down
5 changes: 4 additions & 1 deletion NDTensors/ext/NDTensorsCUDAExt/iscu.jl
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
iscu(::Type{<:CuArray}) = true
using CUDA: CuArray
using NDTensors: NDTensors

NDTensors.iscu(::Type{<:CuArray}) = true
10 changes: 7 additions & 3 deletions NDTensors/ext/NDTensorsCUDAExt/linearalgebra.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
using Adapt: adapt
using CUDA: CUDA, CuMatrix
using LinearAlgebra: Adjoint, svd
using NDTensors: NDTensors
using NDTensors.Expose: Expose, expose, ql, ql_positive
using NDTensors.GPUArraysCoreExtensions: cpu
using NDTensors.TypeParameterAccessors: unwrap_array_type
function NDTensors.svd_catch_error(A::CuMatrix; alg::String="jacobi_algorithm")
if alg == "jacobi_algorithm"
alg = CUDA.CUSOLVER.JacobiAlgorithm()
Expand Down Expand Up @@ -42,9 +49,6 @@ function NDTensors.svd_catch_error(A::CuMatrix, ::CUDA.CUSOLVER.QRAlgorithm)
return USV
end

using NDTensors.GPUArraysCoreExtensions: cpu
using NDTensors.Expose: Expose, expose, ql, ql_positive
using NDTensors.TypeParameterAccessors: unwrap_array_type
## TODO currently AMDGPU doesn't have ql so make a ql function
function Expose.ql(A::Exposed{<:CuMatrix})
Q, L = ql(expose(cpu(A)))
Expand Down
4 changes: 4 additions & 0 deletions NDTensors/ext/NDTensorsCUDAExt/mul.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
using CUDA: CuArray
using LinearAlgebra: LinearAlgebra, mul!, transpose
using NDTensors.Expose: Exposed, expose, parent, unexpose
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved

# This was calling generic matrix multiplication.
# TODO: Raise an issue with `CUDA.jl`.
function LinearAlgebra.mul!(
Expand Down
3 changes: 3 additions & 0 deletions NDTensors/ext/NDTensorsCUDAExt/permutedims.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using CUDA: CuArray
using NDTensors.Expose: Exposed, expose, parent, unexpose

function Base.permutedims!(
Edest::Exposed{<:CuArray,<:Base.ReshapedArray}, Esrc::Exposed{<:CuArray}, perm
)
Expand Down
1 change: 1 addition & 0 deletions NDTensors/ext/NDTensorsCUDAExt/set_types.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# TypeParameterAccessors definitions
using CUDA: CUDA, CuArray
using NDTensors.TypeParameterAccessors: TypeParameterAccessors, Position
using NDTensors.GPUArraysCoreExtensions: storagemode

Expand Down
13 changes: 9 additions & 4 deletions NDTensors/src/blocksparse/blocksparsetensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ end
# Returns the offset of the new block added.
# XXX rename to insertblock!, no need to return offset
using .TypeParameterAccessors: unwrap_array_type
using .Expose: expose
function insertblock_offset!(T::BlockSparseTensor{ElT,N}, newblock::Block{N}) where {ElT,N}
newdim = blockdim(T, newblock)
newoffset = nnz(T)
Expand All @@ -264,7 +265,7 @@ function insertblock_offset!(T::BlockSparseTensor{ElT,N}, newblock::Block{N}) wh
new_data = generic_zeros(unwrap_array_type(T), newdim)
# TODO: `append!` is broken on `Metal` since `resize!`
# isn't implemented.
append!(data(T), new_data)
append!(expose(data(T)), new_data)
return newoffset
end

Expand Down Expand Up @@ -725,6 +726,7 @@ end
# <fermions>
permfactor(perm, block, inds) = 1

using .TypeParameterAccessors: set_type_parameters, parenttype
function permutedims!(
R::BlockSparseTensor{<:Number,N},
T::BlockSparseTensor{<:Number,N},
Expand All @@ -751,17 +753,20 @@ function permutedims!(
# Rblock doesn't exist
block_size = permute(size(Tblock), perm)
# TODO: Make GPU friendly.
Rblock = tensor(Dense(zeros(eltype(R), block_size)), block_size)
DenseT = set_type_parameters(Dense, (eltype, parenttype), (eltype(R), datatype(R)))
Rblock = tensor(generic_zeros(DenseT, block_size), block_size)
elseif !Tblock_exists
# Tblock doesn't exist
block_size = permute(size(Rblock), invperm(perm))
# TODO: Make GPU friendly.
Tblock = tensor(Dense(zeros(eltype(T), block_size)), block_size)
DenseT = set_type_parameters(Dense, (eltype, parenttype), (eltype(T), datatype(T)))
Tblock = tensor(generic_zeros(DenseT, block_size), block_size)
end
permutedims!(Rblock, Tblock, perm, f_fac)
if !Rblock_exists
# Set missing nonzero block
if !iszero(Rblock)
## To make sure no allowscalar issue grab the data
if !iszero(data(Rblock))
R[block] = Rblock
end
end
Expand Down
7 changes: 4 additions & 3 deletions NDTensors/src/blocksparse/linearalgebra.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using .TypeParameterAccessors: unwrap_array_type
using .Expose: expose
const BlockSparseMatrix{ElT,StoreT,IndsT} = BlockSparseTensor{ElT,2,StoreT,IndsT}
const DiagBlockSparseMatrix{ElT,StoreT,IndsT} = DiagBlockSparseTensor{ElT,2,StoreT,IndsT}
const DiagMatrix{ElT,StoreT,IndsT} = DiagTensor{ElT,2,StoreT,IndsT}
Expand Down Expand Up @@ -68,7 +69,7 @@ function svd(
# TODO: call this a function `diagonal`, i.e.:
# https://github.com/JuliaLang/julia/issues/30250
# or make `diag(::Tensor)` return a view by default.
append!(d, data(Sb))
append!(expose(d), data(Sb))
end

# Square the singular values to get
Expand Down Expand Up @@ -234,14 +235,14 @@ function LinearAlgebra.eigen(
Db, Vb = eigen(expose(blockT))
Ds = [Db]
Vs = [Vb]
append!(d, abs.(data(Db)))
append!(expose(d), abs.(data(Db)))
for (n, b) in enumerate(eachnzblock(T))
n == 1 && continue
blockT = blockview(T, b)
Db, Vb = eigen(expose(blockT))
push!(Ds, Db)
push!(Vs, Vb)
append!(d, abs.(data(Db)))
append!(expose(d), abs.(data(Db)))
end

dropblocks = Int[]
Expand Down
15 changes: 12 additions & 3 deletions NDTensors/src/dense/fill.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,27 @@ function generic_randn(StoreT::Type{<:Dense}, dim::Integer=0)
end

function generic_zeros(
StoreT::Type{<:Dense{ElT,DataT}}, dim::Integer=0
StoreT::Type{<:Dense{ElT,DataT}}, dim::Integer
) where {DataT<:AbstractArray,ElT}
@assert ElT == eltype(DataT)
data = generic_zeros(DataT, dim)
StoreT = set_datatype(StoreT, typeof(data))
return StoreT(data)
end

function generic_zeros(StoreT::Type{<:Dense{ElT}}, dim::Integer=0) where {ElT}
function generic_zeros(
StoreT::Type{<:Dense{ElT,DataT}}, dims
) where {DataT<:AbstractArray,ElT}
@assert ElT == eltype(DataT)
data = generic_zeros(DataT, dim(dims))
StoreT = set_datatype(StoreT, typeof(data))
return StoreT(data)
end
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved

function generic_zeros(StoreT::Type{<:Dense{ElT}}, dim) where {ElT}
return generic_zeros(default_storagetype(ElT), dim)
end
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved

function generic_zeros(StoreT::Type{<:Dense}, dim::Integer=0)
function generic_zeros(StoreT::Type{<:Dense}, dim)
return generic_zeros(default_storagetype(), dim)
end
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion NDTensors/src/imports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ for lib in [
:BaseExtensions,
:UnspecifiedTypes,
:TypeParameterAccessors,
:Expose,
:GPUArraysCoreExtensions,
:AMDGPUExtensions,
:CUDAExtensions,
:MetalExtensions,
:Expose,
:BroadcastMapConversion,
:RankFactorization,
:Sectors,
Expand Down
1 change: 1 addition & 0 deletions NDTensors/src/lib/Expose/src/Expose.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ include("import.jl")
## using that type
## Exposed based functions
include("functions/abstractarray.jl")
include("functions/append.jl")
include("functions/copyto.jl")
include("functions/linearalgebra.jl")
include("functions/mul.jl")
Expand Down
5 changes: 0 additions & 5 deletions NDTensors/src/lib/Expose/src/functions/abstractarray.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
using NDTensors.GPUArraysCoreExtensions: GPUArraysCoreExtensions, cpu

parent(E::Exposed) = parent(unexpose(E))

transpose(E::Exposed) = transpose(unexpose(E))

adjoint(E::Exposed) = adjoint(unexpose(E))

GPUArraysCoreExtensions.cpu(E::Exposed) = cpu(unexpose(E))

getindex(E::Exposed) = unexpose(E)[]

function setindex!(E::Exposed, x::Number)
Expand Down
3 changes: 3 additions & 0 deletions NDTensors/src/lib/Expose/src/functions/append.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function Base.append!(Ecollection::Exposed, collections...)
return append!(unexpose(Ecollection), collections...)
end
22 changes: 22 additions & 0 deletions NDTensors/src/lib/Expose/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ using LinearAlgebra:
using GPUArraysCore: @allowscalar
include(joinpath(pkgdir(NDTensors), "test", "NDTensorsTestUtils", "NDTensorsTestUtils.jl"))
using .NDTensorsTestUtils: devices_list
using NDTensors.GPUArraysCoreExtensions: cpu

@testset "Testing Expose $dev, $elt" for dev in devices_list(ARGS),
elt in (Float32, ComplexF32)
Expand Down Expand Up @@ -235,5 +236,26 @@ using .NDTensorsTestUtils: devices_list
zero(C)
mul!!(C, B, A, true, false)
@test cpu(C) ≈ Cp

##################################
### Add test for append! to address scalar indexing in GPUs

A = dev(randn(elt, 10))
Ap = copy(A)
B = randn(elt, 3)
C = append!(expose(A), B)

@test length(C) == 13
@test sum(C) ≈ sum(Ap) + sum(B)

A = Ap
B = dev(randn(elt, 29))
Bp = copy(B)
C = append!(expose(B), A)
@test length(C) == 39
@test sum(C) ≈ sum(Bp) + sum(Ap)
@allowscalar for i in 1:length(B)
C[i] == B[i]
end
end
end
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using GPUArraysCore: AbstractGPUArray, @allowscalar
using NDTensors.Expose: Exposed, unexpose
using NDTensors.TypeParameterAccessors:
TypeParameterAccessors, type_parameter, set_type_parameter

Expand All @@ -13,3 +15,9 @@ function set_storagemode(type::Type, param)
end

function cpu end

cpu(E::Exposed) = cpu(unexpose(E))

function Base.append!(Ecollection::Exposed{<:AbstractGPUArray}, collections...)
return @allowscalar append!(unexpose(Ecollection), collections...)
end
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions NDTensors/test/ITensors/TestITensorDMRG/TestITensorDMRG.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ is_broken(dev, elt::Type, conserve_qns::Val) = false

## Disable blocksparse GPU testing on CUDA, Metal and ROC backends.
## Currently Metal fails because we are waiting for `resize!` to be added. Should be in the next metal release
## CUDA fails because there is no defined `append!`.
## ROC fails because TODO determine again why roc fails.
is_broken(dev::typeof(cu), elt::Type, conserve_qns::Val{true}) = true

#is_broken(dev::typeof(cu), elt::Type, conserve_qns::Val{true}) = true
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved
is_broken(dev::typeof(mtl), elt::Type, conserve_qns::Val{true}) = true
is_broken(dev::typeof(roc), elt::Type, conserve_qns::Val{true}) = true

Expand Down
2 changes: 1 addition & 1 deletion src/imports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ import LinearAlgebra:
tr,
transpose

using ITensors.NDTensors.Expose: cpu
using ITensors.NDTensors.GPUArraysCoreExtensions: cpu
kmp5VT marked this conversation as resolved.
Show resolved Hide resolved

using ITensors.NDTensors:
Algorithm,
Expand Down
Loading