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

[NDTensors] [ITensors] Update tests to use Julia version 1.10 and 1.11 #1539

Merged
merged 28 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f19f9ff
Update Jenkins to test 1.10 and 1.11
kmp5VT Oct 9, 2024
c47968c
Move tblis to extra because no tblis tests exist and its throwing an …
kmp5VT Oct 9, 2024
53abec0
Move 1.6 tests to 1.10
kmp5VT Oct 9, 2024
42d48a6
Bump Julia versions
kmp5VT Oct 9, 2024
08de5ec
Skip broken BlockSparseArrays tests in Julia 1.11
mtfishman Oct 10, 2024
6064e9d
Bump patch versions of NDTensors and ITensors
mtfishman Oct 10, 2024
0516662
Revert changing NDTensors compat entry in ITensors
mtfishman Oct 10, 2024
a2e2b5b
Fix ITensorMPS tests using StableRNGs
mtfishman Oct 10, 2024
97c42c4
Update Jenkins file
kmp5VT Oct 10, 2024
21b19ce
Fix GradedAxes test
mtfishman Oct 10, 2024
2f4a027
Update tests
kmp5VT Oct 10, 2024
55d7813
Use 1.10 instead of LTS
kmp5VT Oct 10, 2024
b32cc2e
Update jenkins/Jenkinsfile
mtfishman Oct 10, 2024
73d432f
Update jenkins/Jenkinsfile
mtfishman Oct 10, 2024
154d87f
Try to update docker file
kmp5VT Oct 11, 2024
0233c16
Dont force juliaup to be somewhere specifically
kmp5VT Oct 11, 2024
c71c0eb
Missing changes
kmp5VT Oct 11, 2024
ff0ca59
Seperate lines and use full path to juliaup. Also export the juila path
kmp5VT Oct 11, 2024
62b8d73
Seperate run lines
kmp5VT Oct 11, 2024
1f26d1b
Seperate lines and add Julia argument
kmp5VT Oct 11, 2024
f659b44
Update to jenkinsfile
kmp5VT Oct 11, 2024
9a55d67
Install to /usr/local instead of root for promission reason
kmp5VT Oct 11, 2024
145919e
Add command to make sure julia version is actually compiled on docker
kmp5VT Oct 11, 2024
517bf19
Merge branch 'main' into kmp5/debug/update_test_1_11
mtfishman Oct 12, 2024
f7bca6a
[NDTensors] Bump to v0.3.45
mtfishman Oct 12, 2024
63ca05f
Try to install juliaup in jenkins instead of docker
kmp5VT Oct 12, 2024
fd332dc
Remove julia and juliaup before going into jenkins
kmp5VT Oct 12, 2024
cb274bd
Revert Docker and Jenkins files.
kmp5VT Oct 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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
version:
- '1.6'
- '1.10'
- '1'
os:
# - windows-latest # windows tests are failing for an unknow reason, disable for now
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_itensormps_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
version:
- '1.6'
- '1.10'
- '1'
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_itensors_base_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
version:
- '1.6'
- '1.10'
- '1'
os:
- ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_ndtensors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
version:
- '1.6'
- '1.10'
- '1'
os:
- ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions NDTensors/Project.toml
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.43"
version = "0.3.44"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand Down Expand Up @@ -91,7 +91,7 @@ TimerOutputs = "0.5.5"
TupleTools = "1.2.0"
VectorInterface = "0.4.2"
cuTENSOR = "2"
julia = "1.6"
julia = "1.10"

[extras]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
Expand Down
51 changes: 34 additions & 17 deletions NDTensors/src/lib/BlockSparseArrays/test/test_basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -597,21 +597,31 @@ include("TestBlockSparseArraysUtils.jl")
c = @view b[4:8, 4:8]
@test c isa SubArray{<:Any,<:Any,<:BlockSparseArray}
@test size(c) == (5, 5)
@test block_nstored(c) == 2
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test block_nstored(c) == 2 broken = VERSION > v"1.11-"
@test blocksize(c) == (2, 2)
@test blocklengths.(axes(c)) == ([2, 3], [2, 3])
@test size(c[Block(1, 1)]) == (2, 2)
@test c[Block(1, 1)] == a[Block(2, 2)[2:3, 2:3]]
@test size(c[Block(2, 2)]) == (3, 3)
@test c[Block(2, 2)] == a[Block(1, 1)[1:3, 1:3]]
@test size(c[Block(2, 1)]) == (3, 2)
@test iszero(c[Block(2, 1)])
@test size(c[Block(1, 2)]) == (2, 3)
@test iszero(c[Block(1, 2)])
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test size(c[Block(1, 1)]) == (2, 2) broken = VERSION ≥ v"1.11-"
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test c[Block(1, 1)] == a[Block(2, 2)[2:3, 2:3]] broken = VERSION ≥ v"1.11-"
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test size(c[Block(2, 2)]) == (3, 3) broken = VERSION ≥ v"1.11-"
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test c[Block(2, 2)] == a[Block(1, 1)[1:3, 1:3]] broken = VERSION ≥ v"1.11-"
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test size(c[Block(2, 1)]) == (3, 2) broken = VERSION ≥ v"1.11-"
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test iszero(c[Block(2, 1)]) broken = VERSION ≥ v"1.11-"
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test size(c[Block(1, 2)]) == (2, 3) broken = VERSION ≥ v"1.11-"
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test iszero(c[Block(1, 2)]) broken = VERSION ≥ v"1.11-"

x = randn(elt, 3, 3)
c[Block(2, 2)] = x
@test c[Block(2, 2)] == x
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test c[Block(2, 2)] == x broken = VERSION ≥ v"1.11-"
@test a[Block(1, 1)[1:3, 1:3]] == x

a = BlockSparseArray{elt}([2, 3], [3, 4])
Expand All @@ -637,10 +647,13 @@ include("TestBlockSparseArraysUtils.jl")
@test copy(b) == a
@test blocksize(b) == (2, 2)
@test blocklengths.(axes(b)) == ([4, 4], [4, 4])
@test b[Block(1, 1)] == a[Block.(1:2), Block.(1:2)]
@test b[Block(2, 1)] == a[Block.(3:4), Block.(1:2)]
@test b[Block(1, 2)] == a[Block.(1:2), Block.(3:4)]
@test b[Block(2, 2)] == a[Block.(3:4), Block.(3:4)]
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
if VERSION < v"1.11-"
@test b[Block(1, 1)] == a[Block.(1:2), Block.(1:2)]
@test b[Block(2, 1)] == a[Block.(3:4), Block.(1:2)]
@test b[Block(1, 2)] == a[Block.(1:2), Block.(3:4)]
@test b[Block(2, 2)] == a[Block.(3:4), Block.(3:4)]
end
c = @view b[Block(2, 2)]
@test blocksize(c) == (1, 1)
@test c == a[Block.(3:4), Block.(3:4)]
Expand Down Expand Up @@ -669,13 +682,17 @@ include("TestBlockSparseArraysUtils.jl")
@test copy(b) == a[J, J]
@test blocksize(b) == (2, 2)
@test blocklengths.(axes(b)) == ([4, 4], [4, 4])
@test b[Block(1, 1)] == Array(a)[[7, 8, 5, 6], [7, 8, 5, 6]]
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test b[Block(1, 1)] == Array(a)[[7, 8, 5, 6], [7, 8, 5, 6]] broken =
VERSION ≥ v"1.11-"
c = @views b[Block(1, 1)][2:3, 2:3]
@test c == Array(a)[[8, 5], [8, 5]]
@test copy(c) == Array(a)[[8, 5], [8, 5]]
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test copy(c) == Array(a)[[8, 5], [8, 5]] broken = VERSION ≥ v"1.11-"
c = @view b[Block(1, 1)[2:3, 2:3]]
@test c == Array(a)[[8, 5], [8, 5]]
@test copy(c) == Array(a)[[8, 5], [8, 5]]
# TODO: Fix in Julia 1.11 (https://github.com/ITensor/ITensors.jl/pull/1539).
@test copy(c) == Array(a)[[8, 5], [8, 5]] broken = VERSION ≥ v"1.11-"
end

# TODO: Add more tests of this, it may
Expand Down
4 changes: 2 additions & 2 deletions NDTensors/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StridedViews = "4db3bf67-4bd7-4b4e-b153-31dc3fb37143"
TBLIS = "48530278-0828-4a49-9772-0f3830dfa1e9"
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
Expand All @@ -30,5 +29,6 @@ Metal = "1.1.0"
[extras]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
cuTENSOR = "011b41b2-24ef-40a8-b3eb-fa098493e9e1"
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
TBLIS = "48530278-0828-4a49-9772-0f3830dfa1e9"
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensors"
uuid = "9136182c-28ba-11e9-034c-db9fb085ebd5"
authors = ["Matthew Fishman <[email protected]>", "Miles Stoudenmire <[email protected]>"]
version = "0.6.19"
version = "0.6.20"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down Expand Up @@ -73,7 +73,7 @@ TupleTools = "1.2"
VectorInterface = "0.4"
Zeros = "0.3.0"
ZygoteRules = "0.2.2"
julia = "1.6"
julia = "1.10"

[extras]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
70 changes: 70 additions & 0 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ pipeline {
'''
}
}
stage('NDTensorsCUDAExt julia-1') {
options {
timeout(time: 45, unit: 'MINUTES')
}
agent {
dockerfile {
label 'gpu&&v100'
filename 'Dockerfile'
dir 'jenkins'
additionalBuildArgs '--build-arg JULIA=1'
args '--gpus "device=1"'
}
}
environment {
HOME = pwd(tmp:true)
OMP_NUM_THREADS = 4
JULIA_NUM_THREADS = 4
}
steps {
sh '''
julia -e 'using Pkg; Pkg.activate(temp=true); Pkg.Registry.update(); Pkg.update(); Pkg.develop(path="./NDTensors"); Pkg.develop(path="."); Pkg.test("NDTensors"; test_args=["cuda"])'
'''
}
}
stage('NDTensorscuTENSORExt julia-1.10') {
options {
timeout(time: 45, unit: 'MINUTES')
Expand All @@ -55,7 +79,52 @@ pipeline {
'''
}
}
stage('NDTensorscuTENSORExt julia-1') {
options {
timeout(time: 45, unit: 'MINUTES')
}
agent {
dockerfile {
label 'gpu&&v100'
filename 'Dockerfile'
dir 'jenkins'
additionalBuildArgs '--build-arg JULIA=1'
args '--gpus "device=1"'
}
}
environment {
HOME = pwd(tmp:true)
OMP_NUM_THREADS = 4
JULIA_NUM_THREADS = 4
}
steps {
sh '''
julia -e 'using Pkg; Pkg.activate(temp=true); Pkg.Registry.update(); Pkg.update(); Pkg.develop(path="./NDTensors"); Pkg.develop(path="."); Pkg.test("NDTensors"; test_args=["cutensor"])'
'''
}
}
stage('NDTensorsMetalExt Julia-1.10'){
options {
timeout(time: 45, unit: 'MINUTES')
}
agent {
label 'm1'
}
environment{
PATH="${env.HOME}/.juliaup/bin:${env.PATH}"
PLATFORM = 'macos'
}
steps{
sh '''
juliaup add 1.10
juliaup default 1.10
'''
sh '''
julia -e 'using Pkg; Pkg.activate(temp=true); Pkg.develop(path="./NDTensors"); Pkg.develop(path="."); Pkg.test("NDTensors"; test_args=["metal"])'
'''
}
}
stage('NDTensorsMetalExt Julia-1'){
options {
timeout(time: 45, unit: 'MINUTES')
}
Expand All @@ -69,6 +138,7 @@ pipeline {
steps{
sh '''
juliaup update
juliaup default release
'''
sh '''
julia -e 'using Pkg; Pkg.activate(temp=true); Pkg.develop(path="./NDTensors"); Pkg.develop(path="."); Pkg.test("NDTensors"; test_args=["metal"])'
Expand Down
1 change: 1 addition & 0 deletions src/lib/ITensorMPS/test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
OptimKit = "77e91f04-9b3b-57a6-a776-40b61faaebe0"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
1 change: 1 addition & 0 deletions src/lib/ITensorMPS/test/base/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ HDF5 = "f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
9 changes: 5 additions & 4 deletions src/lib/ITensorMPS/test/base/test_mpo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Combinatorics
using ITensors
using NDTensors: scalartype
using StableRNGs: StableRNG
using Test

include(joinpath(@__DIR__, "utils", "util.jl"))
Expand Down Expand Up @@ -812,11 +813,11 @@ end
N = 6
sites = [Index(2, "Site,n=$n") for n in 1:N]
seed = 623
mt = MersenneTwister(seed)
K = random_mps(mt, sites)
rng = StableRNG(seed)
K = random_mps(rng, sites)
L = MPO(K)
result = sample(mt, L)
@test result ≈ [1, 2, 1, 1, 2, 2]
result = sample(rng, L)
@test result ≈ [1, 1, 2, 1, 1, 1]
end

@testset "MPO+MPO sum (directsum)" begin
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ OptimKit = "77e91f04-9b3b-57a6-a776-40b61faaebe0"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"
Expand Down
Loading