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

Profiler regression on Windows #10444

Closed
dhoegh opened this issue Mar 8, 2015 · 7 comments
Closed

Profiler regression on Windows #10444

dhoegh opened this issue Mar 8, 2015 · 7 comments
Labels
system:windows Affects only Windows

Comments

@dhoegh
Copy link
Contributor

dhoegh commented Mar 8, 2015

The profiler results are better on 0.3.6 than on 0.4.0+3622 in the following test case.

function mynormInf{T}(A::AbstractMatrix{T})
    m,n = size(A)
    Tnorm = typeof(float(real(zero(T))))
    Tsum = promote_type(Float64,Tnorm)
    nrm::Tsum = 0
    @inbounds begin
        for i = 1:m
            nrmi::Tsum = 0
            for j = 1:n
                nrmi += abs(A[i,j]-ctranspose(A[j,i]))
            end
            nrm = max(nrm,nrmi)
        end
    end
    return convert(Tnorm, nrm)
end 

A=rand(10000,10000)
mynormInf(rand(10,10))
@profile mynormInf(A)
Profile.print()

The output on 0.3.6

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.6 (2015-02-17 22:12 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-w64-mingw32

julia> include("..\\hermitian.jl")
1156 task.jl; anonymous; line: 95
 1156 REPL.jl; eval_user_input; line: 53
  1156 loading.jl; include_from_node1; line: 128
   1156 boot.jl; include; line: 245
    1155 profile.jl; anonymous; line: 14
     1155 C:\Users\Hoegh\hermitian.jl; mynormInf; line: 10

on 0.4.0

```               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-dev+3622 (2015-02-27 03:37 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 32aee08* (9 days old master)
|__/                   |  x86_64-w64-mingw32

julia> include("..\\hermitian.jl")
929 task.jl; anonymous; line: 83
 929 REPL.jl; eval_user_input; line: 54
  929 loading.jl; include_from_node1; line: 128
   929 boot.jl; include; line: 249
    928 profile.jl; anonymous; line: 14

On master there is no line in the output which is inside the function I profile.

@tkelman tkelman added the system:windows Affects only Windows label Mar 8, 2015
@tkelman
Copy link
Contributor

tkelman commented Mar 8, 2015

This might have similar underlying cause as #9752 #9771 - I get better profiling results when I start with --inline=no.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Mar 9, 2015

given how many times i've had to re-write the backtraces on windows to get them to "work better", julia-0.3 and julia-0.4dev are very significantly different here

@dhoegh
Copy link
Contributor Author

dhoegh commented Mar 12, 2015

@vtjnash Thank you for your awesome work. I have just tried the latest master and the issue still seem to exist. This is the output from latest master on Windows:

174 task.jl; anonymous; line: 83
 174 REPL.jl; eval_user_input; line: 54
  174 loading.jl; include_from_node1; line: 129
   174 boot.jl; include; line: 249
    173 profile.jl; anonymous; line: 14

Also latest master under Ubuntu:

436 task.jl; anonymous; line: 83
 436 REPL.jl; eval_user_input; line: 54
  436 ./loading.jl; include_from_node1; line: 129
   436 ./boot.jl; include; line: 249
    436 profile.jl; anonymous; line: 14
     436 ...e/hoegh/hermitian.jl; mynormInf; line: 10

Which contains one more line, which is actually the most interesting.

@ihnorton
Copy link
Member

Looks better with LLVM3.6:

julia> include("hmt.jl")
386 .\task.jl; anonymous; line: 82
 386 .\REPL.jl; eval_user_input; line: 60
  386 <invalid>; include_from_node1; line: 0
   386 <invalid>; include; line: 0
    385 .\profile.jl; anonymous; line: 14
     385 ...\jl36-cyg\src\hmt.jl; mynormInf; line: 10
    1   <invalid>; typeinf_ext; line: 0
     1 <invalid>; typeinf; line: 0
      1 <invalid>; typeinf_uncached; line: 0
       1 <invalid>; abstract_eval_arg; line: 0
        1 <invalid>; abstract_eval; line: 0
         1 <invalid>; abstract_eval_call; line: 0
          1 <invalid>; abstract_call; line: 0
           1 <invalid>; abstract_call_gf; line: 0
            1 <invalid>; typeinf; line: 0
             1 <invalid>; typeinf; line: 0
              1 <invalid>; typeinf_uncached; line: 0
               1 <invalid>; abstract_eval_arg; line: 0
                1 <invalid>; abstract_eval; line: 0
                 1 <invalid>; abstract_eval_call; line: 0
                  1 <invalid>; abstract_call; line: 0
                   1 <invalid>; abstract_call_gf; line: 0
                    1 <invalid>; typeinf; line: 0
                     1 <invalid>; typeinf; line: 0
                      1 <invalid>; typeinf_uncached; line: 0
                       1 <invalid>; abstract_eval_arg; line: 0
                        1 <invalid>; abstract_eval; line: 0
                         1 <invalid>; abstract_eval_call; line: 0
                          1 <invalid>; abstract_call; line: 0
                           1 <invalid>; abstract_call_gf; line: 0
                            1 <invalid>; typeinf; line: 0
                             1 <invalid>; typeinf; line: 0
                              1 <invalid>; typeinf_uncached; line: 0
                               1 <invalid>; abstract_eval_arg; line: 0
                                1 <invalid>; abstract_eval; line: 0
                                 1 <invalid>; abstract_eval_call; line: 0
                                  1 <invalid>; abstract_eval_arg; line: 0
                                   1 <invalid>; abstract_eval; line: 0
                                    1 <invalid>; abstract_eval_call; line: 0
                                     1 <invalid>; abstract_call; line: 0
                                      1 <invalid>; abstract_call_gf; line: 0
                                       1 <invalid>; typeinf; line: 0
                                        1 <invalid>; typeinf; line: 0
                                     +1 1 <invalid>; typeinf_uncached; line: 0
                                     +2 1 <invalid>; ...act_interpret; line: 0
                                     +3 1 <invalid>; abstract_eval; line: 0
                                     +4 1 <invalid>; ...act_eval_call; line: 0
                                     +5 1 <invalid>; abstract_call; line: 0
                                     +6 1 <invalid>; abstract_call_gf; line: 0
                                     +7 1 <invalid>; typeinf; line: 0
                                     +8 1 <invalid>; typeinf; line: 0
                                     +9 1 <invalid>; typeinf_uncached; line: 0
                                    +10 1 <invalid>; ...act_interpret; line: 0
                                    +11 1 <invalid>; abstract_eval; line: 0
                                    +12 1 <invalid>; ...act_eval_call; line: 0
                                    +13 1 <invalid>; abstract_eval; line: 0
                                    +14 1 <invalid>; ...act_eval_call; line: 0
                                    +15 1 <invalid>; ...ract_eval_arg; line: 0
                                    +16 1 <invalid>; abstract_eval; line: 0
                                    +17 1 <invalid>; ...act_eval_call; line: 0

@dhoegh
Copy link
Contributor Author

dhoegh commented Jan 31, 2016

Just tested this issue on latest master and the issue is gone as llvm is upgraded to 3.7.1+.

@dhoegh dhoegh closed this as completed Jan 31, 2016
@tkelman
Copy link
Contributor

tkelman commented Jan 31, 2016

Great, thanks for testing! Do you think we can turn this into a unit test somehow?

@dhoegh
Copy link
Contributor Author

dhoegh commented Jan 31, 2016

This issue do not seem to exist on Julia 0.4.1 either and hence the issue was not fixed by the llvm upgrade. Tests for profiler at https://github.com/JuliaLang/julia/blob/master/test/profile.jl seem quite sparse. I do not exactly know how this could be turned into a unit test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:windows Affects only Windows
Projects
None yet
Development

No branches or pull requests

4 participants