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

snoopi_deep: Stop stripping function from slottypes #38143

Merged

Conversation

NHDaly
Copy link
Member

@NHDaly NHDaly commented Oct 22, 2020

This is a follow-up to #37749.

The slottypes in a MethodInstance specialization contains the generic
function object as the first argument in the array, which we were
previously stripping out to "not write redundant information".

But this actually makes the output harder to read, because the show()
for MethodInstances doesn't fully qualify the names of functions.

For example, before this commit (note that you might ask "Which
fpsort! is this? What module is it in?"):

 0.001485733 => Core.Compiler.Timings.InferenceFrameInfo(MethodInstance for fpsort!(::Vector{Float64}, ::Base.Sort.QuickSortAlg, ::Base.Order.ForwardOrdering), 0x0000000000007310, Any[], Any[Vector{Float64}, Core.Const(Base.Sort.QuickSortAlg()), Core.Const(Base.Order.ForwardOrdering())])

And after this commit (note that the fully qualified function is the
first item in the slottypes array -- it's Base.Sort.Float.fpsort!):

 0.001485733 => Core.Compiler.Timings.InferenceFrameInfo(MethodInstance for fpsort!(::Vector{Float64}, ::Base.Sort.QuickSortAlg, ::Base.Order.ForwardOrdering), 0x0000000000007310, Any[], Any[Core.Const(Base.Sort.Float.fpsort!), Vector{Float64}, Core.Const(Base.Sort.QuickSortAlg()), Core.Const(Base.Order.ForwardOrdering())])

While of course you could have gotten this information out of the
MethodInstance (which is why I left it out), it doesn't show up in the
output by default, which makes copy/pasting this output less useful.

The output is already quite large, so I don't think the "redundant
information" concern is very valid, since it's already quite big, so
it's better to include all the necessary information.

The `slottypes` in a MethodInstance specialization contains the generic
function object as the first argument in the array, which we were
previously stripping out to "not write redundant information".

But this actually makes the output harder to read, because the `show()`
for `MethodInstance`s doesn't fully qualify the names of functions.

For example, before this commit (note that you might ask "*Which*
`fpsort!` is this? What module is it in?"):
```julia
 0.001485733 => Core.Compiler.Timings.InferenceFrameInfo(MethodInstance for fpsort!(::Vector{Float64}, ::Base.Sort.QuickSortAlg, ::Base.Order.ForwardOrdering), 0x0000000000007310, Any[], Any[Vector{Float64}, Core.Const(Base.Sort.QuickSortAlg()), Core.Const(Base.Order.ForwardOrdering())])
```

And after this commit (note that the fully qualified function is the
first item in the slottypes array -- it's `Base.Sort.Float.fpsort!`):
```julia
 0.001485733 => Core.Compiler.Timings.InferenceFrameInfo(MethodInstance for fpsort!(::Vector{Float64}, ::Base.Sort.QuickSortAlg, ::Base.Order.ForwardOrdering), 0x0000000000007310, Any[], Any[Core.Const(Base.Sort.Float.fpsort!), Vector{Float64}, Core.Const(Base.Sort.QuickSortAlg()), Core.Const(Base.Order.ForwardOrdering())])
```

While of course you could have gotten this information out of the
`MethodInstance` (which is why I left it out), it doesn't show up in the
output by default, which makes copy/pasting this output less useful.

The output is already quite large, so I don't think the "redundant
information" concern is very valid, since it's already quite big, so
it's better to include all the necessary information.
Copy link
Member

@Sacha0 Sacha0 left a comment

Choose a reason for hiding this comment

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

Love it! Thanks Nathan! :)

@NHDaly
Copy link
Member Author

NHDaly commented Oct 22, 2020

@timholy - you might want to take a look too? :) Thanks!

@timholy timholy merged commit bd9abdc into JuliaLang:master Oct 23, 2020
@NHDaly NHDaly deleted the nhd-snoopi_deep-slottypes-methodinstance branch October 27, 2020 02:13
NHDaly added a commit to NHDaly/julia that referenced this pull request Oct 28, 2020
The slottypes array is reused and modified, so we need to make a copy of
it for each inference frame. This was a bug accidentally introduced in JuliaLang#38143
Sacha0 pushed a commit to Sacha0/julia that referenced this pull request Nov 9, 2020
The `slottypes` in a MethodInstance specialization contains the generic
function object as the first argument in the array, which we were
previously stripping out to "not write redundant information".

But this actually makes the output harder to read, because the `show()`
for `MethodInstance`s doesn't fully qualify the names of functions.

For example, before this commit (note that you might ask "*Which*
`fpsort!` is this? What module is it in?"):
```julia
 0.001485733 => Core.Compiler.Timings.InferenceFrameInfo(MethodInstance for fpsort!(::Vector{Float64}, ::Base.Sort.QuickSortAlg, ::Base.Order.ForwardOrdering), 0x0000000000007310, Any[], Any[Vector{Float64}, Core.Const(Base.Sort.QuickSortAlg()), Core.Const(Base.Order.ForwardOrdering())])
```

And after this commit (note that the fully qualified function is the
first item in the slottypes array -- it's `Base.Sort.Float.fpsort!`):
```julia
 0.001485733 => Core.Compiler.Timings.InferenceFrameInfo(MethodInstance for fpsort!(::Vector{Float64}, ::Base.Sort.QuickSortAlg, ::Base.Order.ForwardOrdering), 0x0000000000007310, Any[], Any[Core.Const(Base.Sort.Float.fpsort!), Vector{Float64}, Core.Const(Base.Sort.QuickSortAlg()), Core.Const(Base.Order.ForwardOrdering())])
```

While of course you could have gotten this information out of the
`MethodInstance` (which is why I left it out), it doesn't show up in the
output by default, which makes copy/pasting this output less useful.

The output is already quite large, so I don't think the "redundant
information" concern is very valid, since it's already quite big, so
it's better to include all the necessary information.
Sacha0 pushed a commit to Sacha0/julia that referenced this pull request Nov 9, 2020
The slottypes array is reused and modified, so we need to make a copy of
it for each inference frame. This was a bug accidentally introduced in JuliaLang#38143
NHDaly added a commit to NHDaly/julia that referenced this pull request Nov 13, 2020
The `slottypes` in a MethodInstance specialization contains the generic
function object as the first argument in the array, which we were
previously stripping out to "not write redundant information".

But this actually makes the output harder to read, because the `show()`
for `MethodInstance`s doesn't fully qualify the names of functions.

For example, before this commit (note that you might ask "*Which*
`fpsort!` is this? What module is it in?"):
```julia
 0.001485733 => Core.Compiler.Timings.InferenceFrameInfo(MethodInstance for fpsort!(::Vector{Float64}, ::Base.Sort.QuickSortAlg, ::Base.Order.ForwardOrdering), 0x0000000000007310, Any[], Any[Vector{Float64}, Core.Const(Base.Sort.QuickSortAlg()), Core.Const(Base.Order.ForwardOrdering())])
```

And after this commit (note that the fully qualified function is the
first item in the slottypes array -- it's `Base.Sort.Float.fpsort!`):
```julia
 0.001485733 => Core.Compiler.Timings.InferenceFrameInfo(MethodInstance for fpsort!(::Vector{Float64}, ::Base.Sort.QuickSortAlg, ::Base.Order.ForwardOrdering), 0x0000000000007310, Any[], Any[Core.Const(Base.Sort.Float.fpsort!), Vector{Float64}, Core.Const(Base.Sort.QuickSortAlg()), Core.Const(Base.Order.ForwardOrdering())])
```

While of course you could have gotten this information out of the
`MethodInstance` (which is why I left it out), it doesn't show up in the
output by default, which makes copy/pasting this output less useful.

The output is already quite large, so I don't think the "redundant
information" concern is very valid, since it's already quite big, so
it's better to include all the necessary information.
NHDaly added a commit to NHDaly/julia that referenced this pull request Nov 13, 2020
The slottypes array is reused and modified, so we need to make a copy of
it for each inference frame. This was a bug accidentally introduced in JuliaLang#38143
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.

3 participants