Skip to content

Commit

Permalink
fix: minor test fixes (#98)
Browse files Browse the repository at this point in the history
* fix: minor test fixes

* chore: bump Zygote version
  • Loading branch information
avik-pal authored Jan 24, 2025
1 parent f4e89a4 commit 29c21ff
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Boltz"
uuid = "4544d5e4-abc5-4dea-817f-29e4c205d9c8"
authors = ["Avik Pal <[email protected]> and contributors"]
version = "1.1.0"
version = "1.1.1"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down Expand Up @@ -70,5 +70,5 @@ Static = "1.1.1"
Statistics = "1.10"
Tracker = "0.2.34"
WeightInitializers = "1"
Zygote = "0.6.70"
Zygote = "0.6.70, 0.7"
julia = "1.10"
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ DynamicExpressions = "0.16, 0.17, 0.18, 0.19, 1"
Literate = "2"
Lux = "1"
Random = "1.10"
Zygote = "0.6.70"
Zygote = "0.6.70, 0.7"
4 changes: 3 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ using ForwardDiff: ForwardDiff
using GPUArraysCore: AnyGPUArray
using Statistics: mean

using MLDataDevices: get_device_type, get_device, CPUDevice, CUDADevice
using MLDataDevices: MLDataDevices, get_device_type, get_device, CPUDevice, CUDADevice

is_extension_loaded(::Val) = false

Expand Down Expand Up @@ -88,4 +88,6 @@ struct DataTransferBarrier{V}
val::V
end

MLDataDevices.isleaf(::DataTransferBarrier) = true

end
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ ReTestItems = "1.24.0"
Reexport = "1.2.2"
StableRNGs = "1.0.2"
Test = "1.10"
Zygote = "0.6.70"
Zygote = "0.6.70, 0.7"
2 changes: 1 addition & 1 deletion test/layer_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

__f = (x, ps) -> sum(abs2, first(model(x, ps, st)))
@test_gradients(__f, x, ps; atol=1e-3, rtol=1e-3,
soft_fail=[AutoFiniteDiff()])
soft_fail=[AutoFiniteDiff()], enzyme_set_runtime_activity=true)
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions test/vision_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ end

for (mode, aType, dev, ongpu) in MODES, depth in [18, 34, 50, 101, 152]
@testset for pretrained in [false, true]
pretrained && pkgversion(Metalhead) > v"0.9.4" && continue

model = Vision.ResNet(depth; pretrained)
ps, st = Lux.setup(Random.default_rng(), model) |> dev
st = Lux.testmode(st)
Expand All @@ -130,6 +132,7 @@ end
(50, 32, 4), (101, 32, 8), (101, 64, 4), (152, 64, 4)]
@testset for pretrained in [false, true]
depth == 152 && pretrained && continue
pretrained && pkgversion(Metalhead) > v"0.9.4" && continue

model = Vision.ResNeXt(depth; pretrained, cardinality, base_width)
ps, st = Lux.setup(Random.default_rng(), model) |> dev
Expand All @@ -155,6 +158,7 @@ end
for (mode, aType, dev, ongpu) in MODES, depth in [50, 101, 152]
@testset for pretrained in [false, true]
depth == 152 && pretrained && continue
pretrained && pkgversion(Metalhead) > v"0.9.4" && continue

model = Vision.WideResNet(depth; pretrained)
ps, st = Lux.setup(Random.default_rng(), model) |> dev
Expand Down

2 comments on commit 29c21ff

@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/123661

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 v1.1.1 -m "<description of version>" 29c21ff2f973aac2405b77ea5fe033c6df8f9508
git push origin v1.1.1

Please sign in to comment.