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

Commit

Permalink
feat: allow setting target_modules at runtime
Browse files Browse the repository at this point in the history
feat: allow setting target_modules at runtime
  • Loading branch information
avik-pal committed Jul 12, 2024
2 parents bae193e + ac4a567 commit d24bae7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.jl.*.cov
*.jl.mem
/Manifest.toml
Manifest-v*.toml
/deps/deps.jl
/docs/build
/docs/Manifest.toml
Expand Down
2 changes: 1 addition & 1 deletion 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.16"
version = "0.1.17"

[deps]
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
Expand Down
12 changes: 11 additions & 1 deletion src/LuxTestUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ module LuxTestUtils
using ComponentArrays, Optimisers, Preferences, LuxCore, LuxDeviceUtils, Test
using ForwardDiff, ReverseDiff, Tracker, Zygote, FiniteDifferences

const JET_TARGET_MODULES = @load_preference("target_modules", nothing)
const JET_TARGET_MODULES = Ref{Union{Nothing, Vector{String}}}(nothing)

function __init__()
JET_TARGET_MODULES[] = @load_preference("target_modules", nothing)
end

function jet_target_modules!(list::Vector{String})
JET_TARGET_MODULES[] = list
@info "JET_TARGET_MODULES set to $list"
return list
end

# JET Testing
try
Expand Down

2 comments on commit d24bae7

@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 updated: JuliaRegistries/General/109147

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.17 -m "<description of version>" d24bae7f0a69314a25f321ad2d1997a39bc94161
git push origin v0.1.17

Please sign in to comment.