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

Demonstrate backtraces using the juliaojit #863

Merged
merged 2 commits into from
Jul 13, 2023

Conversation

gbaraldi
Copy link
Contributor

A change like this together with JuliaLang/julia#49858 and JuliaLLVM/LLVM.jl#346 lets us get something like

julia> function foo(x)
       if x > 3
           error("eyy")
       else
           return x

       end
       end
foo (generic function with 1 method)

julia> Enzyme.autodiff(Forward, foo, Duplicated(3.5, 1.0))
ERROR: eyy
Stacktrace:
  [1] error
    @ ./error.jl:35
  [2] foo
    @ ./REPL[2]:3 [inlined]
  [3] foo
    @ ./REPL[2]:0 [inlined]
  [4] fwddiffejulia_foo_1563_inner_1wrap
    @ ./REPL[2]:0
  [5] macro expansion
    @ Enzyme.Compiler ~/.julia/dev/Enzyme/src/compiler.jl:9508 [inlined]
  [6] enzyme_call(::Val{false}, fptr::Ptr{Nothing}, ::Type{Enzyme.Compiler.ForwardModeThunk}, ::Type{Val{1}}, ::Val{false}, tt::Type{Tuple{Duplicated{Float64}}}, rt::Type{DuplicatedNoNeed{Float64}}, fn::Const{typeof(foo)}, ::Type{Nothing}, args::Duplicated{Float64})
    @ Enzyme.Compiler ~/.julia/dev/Enzyme/src/compiler.jl:9200 [inlined]
  [7] (::Enzyme.Compiler.ForwardModeThunk{Const{typeof(foo)}, DuplicatedNoNeed{Float64}, Tuple{Duplicated{Float64}}, Val{1}, Val{false}()})(fn::Const{typeof(foo)}, args::Duplicated{Float64})
    @ Enzyme.Compiler ~/.julia/dev/Enzyme/src/compiler.jl:9166 [inlined]
  [8] autodiff(::EnzymeCore.ForwardMode, f::Const{typeof(foo)}, ::Type{DuplicatedNoNeed{Float64}}, args::Duplicated{Float64})
    @ Enzyme ~/.julia/dev/Enzyme/src/Enzyme.jl:322 [inlined]
  [9] autodiff(mode::EnzymeCore.ForwardMode, f::Const{typeof(foo)}, args::Duplicated{Float64})
    @ Enzyme ~/.julia/dev/Enzyme/src/Enzyme.jl:228 [inlined]
 [10] autodiff(mode::EnzymeCore.ForwardMode, f::typeof(foo), args::Duplicated{Float64})
    @ Enzyme ~/.julia/dev/Enzyme/src/Enzyme.jl:214
 [11] top-level scope
    @ REPL[3]:1

@gbaraldi gbaraldi changed the title Demonstrate backtraces using juliajit Demonstrate backtraces using the juliaojit May 22, 2023
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2023

Codecov Report

Patch coverage: 41.93% and no project coverage change.

Comparison is base (b4c6ec6) 76.95% compared to head (53b7566) 76.95%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #863   +/-   ##
=======================================
  Coverage   76.95%   76.95%           
=======================================
  Files          19       19           
  Lines        8496     8502    +6     
=======================================
+ Hits         6538     6543    +5     
- Misses       1958     1959    +1     
Impacted Files Coverage Δ
src/compiler.jl 77.94% <0.00%> (ø)
src/compiler/orcv2.jl 68.14% <43.33%> (+0.70%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@wsmoses
Copy link
Member

wsmoses commented Jul 12, 2023

@gbaraldi mind rebasing this now that the dependencies have landed?

@wsmoses wsmoses force-pushed the juliajit-example branch from 1a136e2 to 4fa3207 Compare July 12, 2023 23:31
@wsmoses wsmoses force-pushed the juliajit-example branch from 4fa3207 to 5ab46cc Compare July 13, 2023 18:23
@wsmoses wsmoses force-pushed the juliajit-example branch from 5ab46cc to 53b7566 Compare July 13, 2023 18:39
@wsmoses wsmoses marked this pull request as ready for review July 13, 2023 19:09
@wsmoses wsmoses merged commit 82b12a7 into EnzymeAD:main Jul 13, 2023
michel2323 pushed a commit that referenced this pull request Nov 7, 2023
* Demonstrate backtraces using juliajit

* Fix

---------

Co-authored-by: William S. Moses <[email protected]>
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