-
Notifications
You must be signed in to change notification settings - Fork 21
Skip broken Zygote tests in Julia v1.12 #161
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
Conversation
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/test/ext/ITensorMPSChainRulesCoreExt/test_chainrules.jl b/test/ext/ITensorMPSChainRulesCoreExt/test_chainrules.jl
index b563f08..10e3635 100644
--- a/test/ext/ITensorMPSChainRulesCoreExt/test_chainrules.jl
+++ b/test/ext/ITensorMPSChainRulesCoreExt/test_chainrules.jl
@@ -293,49 +293,49 @@ Random.seed!(1234)
@test f(y) ≈ g(y_itensor)
@test contract(f'(y)) ≈ g'(y_itensor)
- # These tests are broken in Julia v1.12. See:
- # https://github.com/ITensor/ITensorMPS.jl/pull/161
- # https://github.com/JuliaLang/julia/issues/59138
- # https://github.com/FluxML/Zygote.jl/issues/1580
- if VERSION ≤ v"1.12-"
- f =
- x ->
- inner(replaceprime(contract(x, y), 2 => 1), replaceprime(contract(x, y), 2 => 1))
- g =
- x -> inner(
- replaceprime(contract(x, y_itensor), 2 => 1),
- replaceprime(contract(x, y_itensor), 2 => 1),
- )
- @test f(x) ≈ g(x_itensor)
- @test contract(f'(x)) ≈ g'(x_itensor)
-
- f =
- y ->
- inner(replaceprime(contract(x, y), 2 => 1), replaceprime(contract(x, y), 2 => 1))
- g =
- y -> inner(
- replaceprime(contract(x_itensor, y), 2 => 1),
- replaceprime(contract(x_itensor, y), 2 => 1),
- )
- @test f(y) ≈ g(y_itensor)
- @test contract(f'(y)) ≈ g'(y_itensor)
-
- f = x -> inner(replaceprime(*(x, y), 2 => 1), replaceprime(*(x, y), 2 => 1))
- g =
- x -> inner(
- replaceprime(*(x, y_itensor), 2 => 1), replaceprime(*(x, y_itensor), 2 => 1)
- )
- @test f(x) ≈ g(x_itensor)
- @test contract(f'(x)) ≈ g'(x_itensor)
-
- f = y -> inner(replaceprime(*(x, y), 2 => 1), replaceprime(*(x, y), 2 => 1))
- g =
- y -> inner(
- replaceprime(*(x_itensor, y), 2 => 1), replaceprime(*(x_itensor, y), 2 => 1)
- )
- @test f(y) ≈ g(y_itensor)
- @test contract(f'(y)) ≈ g'(y_itensor)
- end
+ # These tests are broken in Julia v1.12. See:
+ # https://github.com/ITensor/ITensorMPS.jl/pull/161
+ # https://github.com/JuliaLang/julia/issues/59138
+ # https://github.com/FluxML/Zygote.jl/issues/1580
+ if VERSION ≤ v"1.12-"
+ f =
+ x ->
+ inner(replaceprime(contract(x, y), 2 => 1), replaceprime(contract(x, y), 2 => 1))
+ g =
+ x -> inner(
+ replaceprime(contract(x, y_itensor), 2 => 1),
+ replaceprime(contract(x, y_itensor), 2 => 1),
+ )
+ @test f(x) ≈ g(x_itensor)
+ @test contract(f'(x)) ≈ g'(x_itensor)
+
+ f =
+ y ->
+ inner(replaceprime(contract(x, y), 2 => 1), replaceprime(contract(x, y), 2 => 1))
+ g =
+ y -> inner(
+ replaceprime(contract(x_itensor, y), 2 => 1),
+ replaceprime(contract(x_itensor, y), 2 => 1),
+ )
+ @test f(y) ≈ g(y_itensor)
+ @test contract(f'(y)) ≈ g'(y_itensor)
+
+ f = x -> inner(replaceprime(*(x, y), 2 => 1), replaceprime(*(x, y), 2 => 1))
+ g =
+ x -> inner(
+ replaceprime(*(x, y_itensor), 2 => 1), replaceprime(*(x, y_itensor), 2 => 1)
+ )
+ @test f(x) ≈ g(x_itensor)
+ @test contract(f'(x)) ≈ g'(x_itensor)
+
+ f = y -> inner(replaceprime(*(x, y), 2 => 1), replaceprime(*(x, y), 2 => 1))
+ g =
+ y -> inner(
+ replaceprime(*(x_itensor, y), 2 => 1), replaceprime(*(x_itensor, y), 2 => 1)
+ )
+ @test f(y) ≈ g(y_itensor)
+ @test contract(f'(y)) ≈ g'(y_itensor)
+ end
end
@testset "Calling apply multiple times (ITensors #924 regression test)" begin
n = 1 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #161 +/- ##
=======================================
Coverage 90.28% 90.28%
=======================================
Files 54 54
Lines 3583 3583
=======================================
Hits 3235 3235
Misses 348 348
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Some Zygote AD tests are segfaulting in Julia v1.12. I'd still like to narrow down which tests are leading to segfaults so we can still run the other ones.
Maybe related to: