Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Hotfix jet failures
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Feb 5, 2024
1 parent 68dd2c4 commit 589c150
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
matrix:
version:
- "1"
- "1.6"
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LuxTestUtils"
uuid = "ac9de150-d08f-4546-94fb-7472b5760531"
authors = ["Avik Pal <[email protected]>"]
version = "0.1.13"
version = "0.1.14"

[deps]
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
Expand All @@ -25,15 +25,15 @@ ComponentArrays = "0.13, 0.14, 0.15"
FiniteDifferences = "0.12"
ForwardDiff = "0.10"
Functors = "0.4"
JET = "0.4, 0.5, 0.6, 0.7, 0.8"
JET = "0.8"
LuxCore = "0.1"
LuxDeviceUtils = "0.1"
Optimisers = "0.2, 0.3"
Preferences = "1"
ReverseDiff = "1"
Tracker = "0.2"
Zygote = "0.6"
julia = "1.6"
julia = "1.9"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
18 changes: 7 additions & 11 deletions src/LuxTestUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ const JET_TARGET_MODULES = @load_preference("target_modules", nothing)
try
using JET
global JET_TESTING_ENABLED = true

import JET: JETTestFailure, get_reports
catch
@warn "JET not not precompiling. All JET tests will be skipped!!" maxlog=1
global JET_TESTING_ENABLED = false
end

import Test: Error, Broken, Pass, Fail, get_testset

"""
@jet f(args...) call_broken=false opt_broken=false
Expand Down Expand Up @@ -56,7 +60,7 @@ end
```
"""
macro jet(expr, args...)
@static if VERSION >= v"1.7" && JET_TESTING_ENABLED
if JET_TESTING_ENABLED
all_args, call_extras, opt_extras = [], [], []
target_modules_set = false
for kwexpr in args
Expand Down Expand Up @@ -316,19 +320,11 @@ function __test_gradient_pair_check(__source__, orig_expr, v1, v2, name1, name2;
end

function __test_pass(test_type, orig_expr, source)
@static if VERSION >= v"1.7"
return Test.Pass(test_type, orig_expr, nothing, nothing, source)
else
return Test.Pass(test_type, orig_expr, nothing, nothing)
end
return Test.Pass(test_type, orig_expr, nothing, nothing, source)
end

function __test_fail(test_type, orig_expr, source)
@static if VERSION >= v"1.9.0-rc1"
return Test.Fail(test_type, orig_expr, nothing, nothing, nothing, source, false)
else
return Test.Fail(test_type, orig_expr, nothing, nothing, source)
end
return Test.Fail(test_type, orig_expr, nothing, nothing, nothing, source, false)
end

function __test_error(test_type, orig_expr, source)
Expand Down

2 comments on commit 589c150

@avik-pal
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/100300

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.14 -m "<description of version>" 589c150993db5d5ab74188c4310b31d813dbb238
git push origin v0.1.14

Please sign in to comment.