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

adjustments to the latest inlining interface changes #1350

Merged
merged 5 commits into from
Sep 13, 2024

Conversation

aviatesk
Copy link
Contributor

Still needs to adjust to JuliaLang/julia#52415.

@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 62.50000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 74.95%. Comparing base (7a51e00) to head (a1fac3e).

Files Patch % Lines
src/compiler/interpreter.jl 62.50% 9 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1350      +/-   ##
==========================================
- Coverage   75.38%   74.95%   -0.43%     
==========================================
  Files          35       35              
  Lines       10683    10660      -23     
==========================================
- Hits         8053     7990      -63     
- Misses       2630     2670      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vchuravy vchuravy force-pushed the avi/adjustment branch 2 times, most recently from 883263e to a1fac3e Compare March 19, 2024 13:48
@wsmoses
Copy link
Member

wsmoses commented Jun 28, 2024

@vchuravy is this now subsumed by recent 1.11 stuff?

@vchuravy
Copy link
Member

No I haven't touched any of that

@wsmoses
Copy link
Member

wsmoses commented Sep 3, 2024

@vchuravy can you take a look at this. I think this is the next pending thing for 1.11 support (with the incoming jll bump:
JuliaPackaging/Yggdrasil#9354

@aviatesk aviatesk force-pushed the avi/adjustment branch 2 times, most recently from 61c009e to 66d6444 Compare September 3, 2024 09:46
@aviatesk
Copy link
Contributor Author

aviatesk commented Sep 3, 2024

I tried updating it, but it seems we might need a fix in Base. Specifically, because of JuliaLang/julia/#52064, the inlining_policy in Base no longer requires mi, so mi isn't being passed to inlining_policy anymore. However, Enzyme's inlining rule still needs it. Since we can't accurately recover mi from info or src, a change to Base might be necessary.

@aviatesk
Copy link
Contributor Author

aviatesk commented Sep 3, 2024

When does this error usually occur?

Error During Test at /Users/aviatesk/julia/packages/Enzyme/test/abi.jl:4
  Got exception outside of a @test
  
  No augmented forward pass found for julia.gc_loaded
   at context:   %37 = call {} addrspace(10)* addrspace(13)* @julia.gc_loaded({} addrspace(10)* noundef %17, {} addrspace(10)** noundef %36) #12, !dbg !39
  
  Stacktrace:
   [1] getindex
     @ ./essentials.jl:916
   [2] squareRetArray
     @ ~/julia/packages/Enzyme/test/abi.jl:86
  
  
  Stacktrace:
    [1] getindex
      @ ./essentials.jl:916 [inlined]
    [2] squareRetArray
      @ ~/julia/packages/Enzyme/test/abi.jl:86 [inlined]
    [3] diffejulia_squareRetArray_29137wrap
      @ ~/julia/packages/Enzyme/test/abi.jl:0
    [4] macro expansion
      @ ~/julia/packages/Enzyme/src/compiler.jl:7179 [inlined]
    [5] enzyme_call
      @ ~/julia/packages/Enzyme/src/compiler.jl:6788 [inlined]
    [6] CombinedAdjointThunk
      @ ~/julia/packages/Enzyme/src/compiler.jl:6665 [inlined]
    [7] autodiff
      @ ~/julia/packages/Enzyme/src/Enzyme.jl:320 [inlined]
    [8] autodiff(mode::ReverseMode{false, FFIABI, false, false}, f::var"#squareRetArray#28", ::Type{Const}, args::Duplicated{Vector{Float64}})
      @ Enzyme ~/julia/packages/Enzyme/src/Enzyme.jl:332
    [9] macro expansion
      @ ~/julia/packages/Enzyme/test/abi.jl:91 [inlined]
   [10] macro expansion
      @ ~/julia/julia5/usr/share/julia/stdlib/v1.11/Test/src/Test.jl:1700 [inlined]
   [11] top-level scope
      @ ~/julia/packages/Enzyme/test/abi.jl:6
   [12] include(fname::String)
      @ Main ./sysimg.jl:38
   [13] top-level scope
      @ ~/julia/packages/Enzyme/test/runtests.jl:85
   [14] include(fname::String)
      @ Main ./sysimg.jl:38
   [15] top-level scope
      @ none:6
   [16] eval
      @ ./boot.jl:430 [inlined]
   [17] exec_options(opts::Base.JLOptions)
      @ Base ./client.jl:291
   [18] _start()
      @ Base ./client.jl:526

@wsmoses
Copy link
Member

wsmoses commented Sep 3, 2024

That is fixed by the jll bump -- which presently seems trapped in yggdrassil hell: JuliaPackaging/Yggdrasil#9354

cc @vchuravy @staticfloat @giordano

@wsmoses
Copy link
Member

wsmoses commented Sep 4, 2024

@aviatesk okay a jll should now be available

@aviatesk aviatesk changed the title wip: adjustments to the latest inlining interface changes adjustments to the latest inlining interface changes Sep 4, 2024
@aviatesk
Copy link
Contributor Author

aviatesk commented Sep 4, 2024

I have switched to an approach using the new CallInfo. This now should work without any changes on the Base side. However, I have noticed the following error occurring in the assertion build (though I am not sure if it is caused by this PR):

Test Summary:    | Pass  Total  Time
Persistent tasks |    1      1  9.0s
Assertion failed: ((IsIntAttr || Attribute::isEnumAttrKind(Kind)) && "Not an enum or int attribute"), function get, file /workspace/srcdir/llvm-project/llvm/lib/IR/Attributes.cpp, line 95.

[18495] signal 6: Abort trap: 6
in expression starting at /Users/aviatesk/julia/packages/Enzyme/test/abi.jl:4
__pthread_kill at /usr/lib/system/libsystem_kernel.dylib (unknown line)
Allocations: 151710873 (Pool: 151707636; Big: 3237); GC: 101

@wsmoses
Copy link
Member

wsmoses commented Sep 6, 2024

That feels unrelated (and likely on me to fix other misc 1.11 stuff)

@wsmoses
Copy link
Member

wsmoses commented Sep 6, 2024

This generally looks good to me, but seems to break 1.10 (which should pass atm — the lower versions have a Yggdrasil issue rn which shouldn’t block this landing)

@wsmoses
Copy link
Member

wsmoses commented Sep 12, 2024

@aviatesk I rebased this [now with all the 1.11 JLL issues remedied, and I must have done something improper as 1.10 fails.

Is it possible to get some help (and sorry about that)

src/compiler/interpreter.jl Outdated Show resolved Hide resolved
@aviatesk
Copy link
Contributor Author

Ok, I think the failure has been fixed.

@wsmoses wsmoses merged commit e63c1b7 into EnzymeAD:main Sep 13, 2024
9 of 24 checks passed
@aviatesk aviatesk deleted the avi/adjustment branch September 14, 2024 01:11
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.

4 participants