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

add a subtyping fast path for tuple of Unions <: Vararg #33353

Merged
merged 1 commit into from
Sep 23, 2019

Conversation

JeffBezanson
Copy link
Member

fixes #33337

Replacement for #33345 that improves subtyping instead of reverting.

@JeffBezanson JeffBezanson added performance Must go faster types and dispatch Types, subtyping and method dispatch labels Sep 21, 2019
@Keno
Copy link
Member

Keno commented Sep 21, 2019

Test?

@JeffBezanson JeffBezanson added this to the 1.3 milestone Sep 21, 2019
@KristofferC KristofferC mentioned this pull request Sep 22, 2019
18 tasks
@JeffBezanson JeffBezanson merged commit 4f17558 into master Sep 23, 2019
@JeffBezanson JeffBezanson deleted the jb/fix33337_2 branch September 23, 2019 16:31
@@ -1049,6 +1049,10 @@ static int subtype_tuple_tail(struct subtype_tuple_env *env, int8_t R, jl_stenv_
yi = jl_tparam0(jl_unwrap_unionall(env->vty));
if (!env->vvx && yi == (jl_value_t*)jl_any_type)
goto done; // if y ends in `Vararg{Any}` skip checking everything
// var T in Vararg{T} is diagonal; an abstract type can't be a subtype of it,
// so avoid exponential blowup when xi is a Union.
if (jl_is_typevar(yi) && jl_is_uniontype(xi) && !jl_has_free_typevars(xi))
Copy link
Member

@vtjnash vtjnash Sep 22, 2019

Choose a reason for hiding this comment

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

There’s also a concrete_min (which does this for obvious-subtype). But we discovered this was false, I thought, because T wasn’t know to be diagonal

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, ok, I can patch that up.

JeffBezanson added a commit that referenced this pull request Oct 1, 2019
JeffBezanson added a commit that referenced this pull request Oct 2, 2019
KristofferC pushed a commit that referenced this pull request Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inference performance regression vs 1.2 (NeuralNetDiffEq)
4 participants