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

New TermInterface #584

Merged
merged 21 commits into from
Apr 21, 2024
Merged

New TermInterface #584

merged 21 commits into from
Apr 21, 2024

Conversation

0x0f0f0f
Copy link
Member

No description provided.

@shashi
Copy link
Member

shashi commented Mar 15, 2024

The way I implemented children is by making it return the operation and arguments together. The head for BasicSymbolics was basicsymbolic. See: https://github.com/JuliaSymbolics/SymbolicUtils.jl/compare/s/terminterface1?expand=1

@shashi
Copy link
Member

shashi commented Mar 23, 2024

@0x0f0f0f does that make sense? I wanna finish this up and try out MT on SU expressions

@0x0f0f0f
Copy link
Member Author

@0x0f0f0f does that make sense? I wanna finish this up and try out MT on SU expressions

This is up to you, if you think it makes more sense to have it implemented as such, please go ahead.

@0x0f0f0f
Copy link
Member Author

I'll have a call with @nmheim shortly, would you like to join?

@0x0f0f0f
Copy link
Member Author

@shashi adjusted with your proposal - CI passing now. documentation job is broken. disabled fuzzing tests as they segfault until JuliaMath/SpecialFunctions.jl#446 is fixed

@0x0f0f0f 0x0f0f0f requested a review from shashi March 25, 2024 20:55
@0x0f0f0f 0x0f0f0f marked this pull request as ready for review March 25, 2024 20:58
@0x0f0f0f
Copy link
Member Author

Why is Symbolics.jl integration test failing even tho it has a compact for SymbolicUtils = "1.4" and the version is set to 1.6 here?

src/types.jl Outdated
maketerm(typeof(t), f, args, _promote_symtype(f, args); metadata)
similarterm(t::BasicSymbolic, f, args, symtype; metadata=nothing) =
maketerm(typeof(t), f, args, symtype; metadata=metadata)
maketerm(T::Type{<:Symbolic}, f, args, symtype; metadata=nothing) =
Copy link
Member

Choose a reason for hiding this comment

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

Arrays are also <: Symbolic so maybe just make it BasicSymbolic?

Merge branch 's/terminterface1' into ale/terminterface-new
Copy link
Contributor

github-actions bot commented Apr 10, 2024

Benchmark Results

master ed97a96... master/ed97a96a8864c5...
overhead/acrule/a+2 0.724 ± 0.018 μs 0.715 ± 0.017 μs 1.01
overhead/acrule/a+2+b 0.723 ± 0.022 μs 0.71 ± 0.018 μs 1.02
overhead/acrule/a+b 0.271 ± 0.01 μs 0.257 ± 0.0097 μs 1.05
overhead/acrule/noop:Int 25 ± 0.05 ns 25.9 ± 0.05 ns 0.965
overhead/acrule/noop:Sym 0.0339 ± 0.004 μs 0.0339 ± 0.0044 μs 1
overhead/rule/noop:Int 0.0378 ± 0.00042 μs 0.0377 ± 0.001 μs 1
overhead/rule/noop:Sym 0.0421 ± 0.0016 μs 0.042 ± 0.0013 μs 1
overhead/rule/noop:Term 0.0427 ± 0.0016 μs 0.0426 ± 0.0014 μs 1
overhead/ruleset/noop:Int 0.123 ± 0.002 μs 0.121 ± 0.0021 μs 1.02
overhead/ruleset/noop:Sym 0.14 ± 0.0038 μs 0.142 ± 0.0032 μs 0.988
overhead/ruleset/noop:Term 3.38 ± 0.17 μs 6.54 ± 0.41 μs 0.517
overhead/simplify/noop:Int 0.154 ± 0.002 μs 0.145 ± 0.0036 μs 1.06
overhead/simplify/noop:Sym 0.171 ± 0.003 μs 0.153 ± 0.0027 μs 1.12
overhead/simplify/noop:Term 0.0392 ± 0.0022 ms 0.0448 ± 0.0025 ms 0.874
overhead/simplify/randterm (+, *):serial 0.118 ± 0.002 s 0.135 ± 0.0064 s 0.878
overhead/simplify/randterm (+, *):thread 0.0739 ± 0.025 s 0.0837 ± 0.024 s 0.883
overhead/simplify/randterm (/, *):serial 0.224 ± 0.0077 ms 0.272 ± 0.01 ms 0.823
overhead/simplify/randterm (/, *):thread 0.256 ± 0.0089 ms 0.317 ± 0.011 ms 0.806
overhead/substitute/a 0.06 ± 0.0015 ms 0.12 ± 0.0032 ms 0.5
overhead/substitute/a,b 0.0523 ± 0.0014 ms 0.101 ± 0.0029 ms 0.518
overhead/substitute/a,b,c 16.4 ± 0.7 μs 16.9 ± 0.68 μs 0.972
polyform/easy_iszero 0.0317 ± 0.0017 ms 0.0551 ± 0.0024 ms 0.575
polyform/isone 2.79 ± 0.01 ns 2.79 ± 0.01 ns 1
polyform/iszero 1.77 ± 0.039 ms 5.53 ± 0.1 ms 0.32
polyform/simplify_fractions 2.36 ± 0.047 ms 3.38 ± 0.057 ms 0.697
time_to_load 4.58 ± 0.028 s 4.04 ± 0.016 s 1.13

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@0x0f0f0f
Copy link
Member Author

Downstream MTK Failing due to deprecation warnings

 Discrete System: Test Failed at /cache/build/builder-amdci5-1/julialang/julia-release-1-dot-10/usr/share/julia/stdlib/v1.10/Test/src/Test.jl:903
  Expression: isempty(stderr_content)
   Evaluated: isempty("WARNING: ModelingToolkit.istree is deprecated, use TermInterface.iscall instead.\n  likely near /home/runner/work/SymbolicUtils.jl/SymbolicUtils.jl/downstream/test/discrete_system.jl:267\nin collect_var_to_name! at /home/runner/work/SymbolicUtils.jl/SymbolicUtils.jl/downstream/src/utils.jl\n")

I suggested to remove deprecation warnings and do a major release bump

@0x0f0f0f
Copy link
Member Author

I suggested to remove deprecation warnings and do a major release bump

Ok, there was already a major version bump, shouldn't downstream CI not be executed?

@0x0f0f0f
Copy link
Member Author

@shashi any news on the state of this?

@shashi
Copy link
Member

shashi commented Apr 19, 2024

I think we can release it as a major release and update downstream. The errors are all because of the depwarn. Some packages are testing the if stderr is empty.

@shashi
Copy link
Member

shashi commented Apr 19, 2024

I'll make the relevant PRs to Symbolics and MTK today.

@shashi shashi merged commit 6713fa0 into master Apr 21, 2024
6 of 11 checks passed
@shashi shashi deleted the ale/terminterface-new branch April 21, 2024 15:26
@devmotion
Copy link
Contributor

Shouldn't this have been a breaking major release? It completely broke my project (that due to Catalyst still has to use MTK v8) when running Pkg.update().


See more on the interface [here](/interface)

All the expression types support the [TermInterface.jl](https://github.com/0x0f0f0f/TermInterface.jl) interface.
Copy link
Member

Choose a reason for hiding this comment

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

@0x0f0f0f
Copy link
Member Author

Shouldn't this have been a breaking major release? It completely broke my project (that due to Catalyst still has to use MTK v8) when running Pkg.update().

@shashi I think this should have been a major breaking release. It has also been reported by a colleague of mine. Lots of deprecation warnings. I think we should just do a major release and drop similarterm alltogether and use maketerm

shashi added a commit that referenced this pull request May 14, 2024
…-new"

This reverts commit 6713fa0, reversing
changes made to 8d8db32.
shashi added a commit that referenced this pull request May 17, 2024
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.

5 participants