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

Suppress unnecessary warnings #245

Merged
merged 3 commits into from
Dec 13, 2023

Conversation

hwpang
Copy link
Contributor

@hwpang hwpang commented Dec 12, 2023

Attempting to disable this warning to show up as RMG-Py users freak out when seeing Julia error message.

┌ Warning: Error requiring `EnzymeCore` from `KernelAbstractions`
│   exception =
│    LoadError: UndefVarError: EnzymeRules not defined
│    Stacktrace:
│      [1] top-level scope
│        @ ~/.julia/packages/KernelAbstractions/SQ66B/ext/EnzymeExt.jl:7
│      [2] include(mod::Module, _path::String)
│        @ Base ./Base.jl:419
│      [3] include(x::String)
│        @ KernelAbstractions ~/.julia/packages/KernelAbstractions/SQ66B/src/KernelAbstractions.jl:1
│      [4] top-level scope
│        @ ~/.julia/packages/Requires/Z8rfN/src/Requires.jl:40
│      [5] eval
│        @ ./boot.jl:368 [inlined]
│      [6] eval
│        @ ~/.julia/packages/KernelAbstractions/SQ66B/src/KernelAbstractions.jl:1 [inlined]
│      [7] (::KernelAbstractions.var"#26#29")()
│        @ KernelAbstractions ~/.julia/packages/Requires/Z8rfN/src/require.jl:101
│      [8] macro expansion
│        @ timing.jl:382 [inlined]
│      [9] err(f::Any, listener::Module, modname::String, file::String, line::Any)
│        @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:47
│     [10] (::KernelAbstractions.var"#25#28")()
│        @ KernelAbstractions ~/.julia/packages/Requires/Z8rfN/src/require.jl:100
│     [11] withpath(f::Any, path::String)
│        @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:37
│     [12] (::KernelAbstractions.var"#24#27")()
│        @ KernelAbstractions ~/.julia/packages/Requires/Z8rfN/src/require.jl:99
│     [13] #invokelatest#2
│        @ ./essentials.jl:729 [inlined]
│     [14] invokelatest
│        @ ./essentials.jl:726 [inlined]
│     [15] foreach(f::typeof(Base.invokelatest), itr::Vector{Function})
│        @ Base ./abstractarray.jl:2774
│     [16] loadpkg(pkg::Base.PkgId)
│        @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:27
│     [17] #invokelatest#2
│        @ ./essentials.jl:729 [inlined]
│     [18] invokelatest
│        @ ./essentials.jl:726 [inlined]
│     [19] run_package_callbacks(modkey::Base.PkgId)
│        @ Base ./loading.jl:869
│     [20] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, sourcepath::String, depmods::Vector{Any})
│        @ Base ./loading.jl:944
│     [21] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt64)
│        @ Base ./loading.jl:1028
│     [22] _require(pkg::Base.PkgId)
│        @ Base ./loading.jl:1315
│     [23] _require_prelocked(uuidkey::Base.PkgId)
│        @ Base ./loading.jl:1200
│     [24] macro expansion
│        @ ./loading.jl:1180 [inlined]
│     [25] macro expansion
│        @ ./lock.jl:223 [inlined]
│     [26] require(into::Module, mod::Symbol)
│        @ Base ./loading.jl:1144
│     [27] include(fname::String)
│        @ Base.MainInclude ./client.jl:[476](https://github.com/ReactionMechanismGenerator/ReactionMechanismSimulator.jl/actions/runs/6866648766/job/19105591218#step:9:477)
│     [28] top-level scope
│        @ ~/work/ReactionMechanismSimulator.jl/ReactionMechanismSimulator.jl/src/rmstest.jl:37
│     [29] include(fname::String)
│        @ Base.MainInclude ./client.jl:476
│     [30] top-level scope
│        @ ~/work/ReactionMechanismSimulator.jl/ReactionMechanismSimulator.jl/test/runtests.jl:2
│     [31] include(fname::String)
│        @ Base.MainInclude ./client.jl:476
│     [32] top-level scope
│        @ none:6
│     [33] eval
│        @ ./boot.jl:368 [inlined]
│     [34] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:276
│     [35] _start()
│        @ Base ./client.jl:522
│    in expression starting at /home/runner/.julia/packages/KernelAbstractions/SQ66B/ext/EnzymeExt.jl:1
└ @ Requires ~/.julia/packages/Requires/Z8rfN/src/require.jl:51

@hwpang
Copy link
Contributor Author

hwpang commented Dec 12, 2023

This seems to be working -- package warnings are not shown anymore. The unit tests are failing due to the known adjoint sensitivity problem.

@hwpang hwpang self-assigned this Dec 12, 2023
JacksonBurns
JacksonBurns previously approved these changes Dec 12, 2023
Copy link
Contributor

@JacksonBurns JacksonBurns left a comment

Choose a reason for hiding this comment

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

LGTM! Aggressive solution I like it

@hwpang hwpang marked this pull request as draft December 12, 2023 19:04
@hwpang hwpang marked this pull request as ready for review December 12, 2023 19:05
@hwpang
Copy link
Contributor Author

hwpang commented Dec 12, 2023

Using Logging.disable_logging(Logging.Warn) doesn't work. Trying to switch to Julia 1.9.

@hwpang
Copy link
Contributor Author

hwpang commented Dec 12, 2023

I think this should work. There are multiple locations I need to add Logging.disable_logging(Logging.Warn).

@hwpang hwpang requested a review from JacksonBurns December 12, 2023 22:16
Copy link
Collaborator

@mjohnson541 mjohnson541 left a comment

Choose a reason for hiding this comment

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

I think this looks good. The warnings that are still in the log are ones we can fix if we take the time to go through them one-by-one.

Copy link
Contributor

@JacksonBurns JacksonBurns left a comment

Choose a reason for hiding this comment

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

Thanks, looks good!

@hwpang hwpang changed the title Attempt to disable warning Suppress unnecessary warnings Dec 13, 2023
@hwpang hwpang merged commit a3b22d5 into ReactionMechanismGenerator:main Dec 13, 2023
1 of 2 checks passed
@hwpang hwpang deleted the suppress_warning branch December 13, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suppressing Julia package warning to avoid freaking out users
3 participants