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

Build a Julia compatible plugin library #1

Merged
merged 1 commit into from
Sep 11, 2019
Merged

Build a Julia compatible plugin library #1

merged 1 commit into from
Sep 11, 2019

Conversation

vchuravy
Copy link
Member

@vchuravy vchuravy commented Sep 6, 2019

@wsmoses I didn't manage to build against LLVM 6.0, would 8.0 work?

FAILED: Enzyme/CMakeFiles/LLVMEnzyme.dir/Enzyme.cpp.o
ccache /opt/x86_64-linux-gnu/bin/x86_64-linux-gnu-g++ --sysroot=/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root/  -DGTEST_HAS_RTTI=0 -I/workspace/destdir/include -fPIC   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS  -fno-exceptions -fno-rtti -std=gnu++11 -MD -MT Enzyme/CMakeFiles/LLVMEnzyme.dir/Enzyme.cpp.o -MF Enzyme/CMakeFiles/LLVMEnzyme.dir/Enzyme.cpp.o.d -o Enzyme/CMakeFiles/LLVMEnzyme.dir/Enzyme.cpp.o -c Enzyme/Enzyme.cpp
Enzyme/Enzyme.cpp:26:37: fatal error: llvm/Analysis/PhiValues.h: No such file or directory
 #include "llvm/Analysis/PhiValues.h"
                                     ^

@wsmoses
Copy link
Member

wsmoses commented Sep 6, 2019

Right now this for sure works on LLVM 7 (as that's the base, let me remove that particular header and we can iterate to find what is needed for 6 and/or 8 compatibility).

@vchuravy vchuravy force-pushed the vc/shipit branch 2 times, most recently from e75c254 to e414d02 Compare September 6, 2019 22:55
@vchuravy
Copy link
Member Author

vchuravy commented Sep 9, 2019

Needs an update to LLVM.jl and of course it beautifully segfaults :)

(also should we move this code to Enzyme.jl? So that we can run travis?)

@wsmoses
Copy link
Member

wsmoses commented Sep 9, 2019

Yeah, I'd guess as much (there were some minor linking things when actually running on LLVM 6 -- currently working through those on /plugin branch [see https://github.com/wsmoses/Enzyme/runs/215845236 ].

Also I got github actions set up here for testing which is useful for ensuring Enzyme will be compatible against a range of LLVM.

Also yes, this likely makes sense to move to Enzyme.jl

@vchuravy
Copy link
Member Author

Ok moved everything to Enzyme.jl

➜  Enzyme.jl git:(master) ✗ ~/builds/julia-debug/julia -g0 --project=.
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.4.0-DEV.108 (2019-09-09)
 _/ |\__'_|_|_|\__'_|  |  Commit 2d4f4d26a0 (0 days old master)
|__/                   |

julia> using Enzyme
f
julia> f(x) = 1.0 + x
f (generic function with 1 method)

julia> g(x) = Enzyme.autodiff(f, x)
g (generic function with 1 method)

julia> g(1.0)
saw metadata for diffe_out
1.0

julia> @code_llvm g(1.0)

; Function Attrs: sspstrong
define double @julia_g_17047(double) #0 {
top:
  %1 = call { double } @diffejulia_f_1(double %0, double 1.000000e+00)
  %2 = extractvalue { double } %1, 0
  ret double %2
}

@vchuravy vchuravy marked this pull request as ready for review September 10, 2019 21:23
@vchuravy vchuravy merged commit 3961fe8 into plugin Sep 11, 2019
@vchuravy vchuravy deleted the vc/shipit branch September 11, 2019 19:37
@tgymnich tgymnich mentioned this pull request Sep 16, 2021
ZuseZ4 added a commit that referenced this pull request Feb 11, 2022
Use base path instead of build
@rem1A rem1A mentioned this pull request Sep 6, 2022
tgymnich pushed a commit that referenced this pull request Mar 23, 2023
Reduce CI to the minimally needed subset.
wsmoses pushed a commit that referenced this pull request May 16, 2023
* port to llvm-16 (not backward-compatible with older llvms), WIP

* wip, but probably not correct on may places

* rule out old PM on llvm 16 and above

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16
wsmoses pushed a commit that referenced this pull request May 18, 2023
* port to llvm-16 (not backward-compatible with older llvms), WIP

* wip, but probably not correct on may places

* rule out old PM on llvm 16 and above

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16
wsmoses pushed a commit that referenced this pull request May 21, 2023
* port to llvm-16 (not backward-compatible with older llvms), WIP

* wip, but probably not correct on may places

* rule out old PM on llvm 16 and above

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16
wsmoses added a commit that referenced this pull request May 21, 2023
* compiles with llvm-16 (old PM is gone so I could not run opt) (#1)

* port to llvm-16 (not backward-compatible with older llvms), WIP

* wip, but probably not correct on may places

* rule out old PM on llvm 16 and above

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16, WIP

* #if LLVM_VERSION_MAJOR >= 16

* Llvm 16 (#2)

* fix for argmemonly

* disabling old pm tests where new pm tests exist (#3)

* Disable old pm tests fix (#4)

* disabling old pm tests where new pm tests exist: fix typo

* fix build with llvm-16 (#5)

* fix build with llvm < 16 (#6)

* Attribute::Memory fixes (#7)

but still getting zeros instead of derivatives

* curly brace out of macro (#8)

* fix typo (#9)

* fix for llvm-16 (#10)

* fix typo

* fix

* Llvm 16 gha (#11)

* enable build with llvm 16

* enable llvm-16 once this gets to main (on both linux and mac os)

* docker run -it --rm --workdir /Enzyme -v /home/stp/go/src/github.com/stepasite/Enzyme/enzyme/Enzyme:/Enzyme clang-format-lint --clang-format-executable /clang-format/clang-format11 -r --exclude ./Enzyme/SCEV --style llvm --inplace true ./Enzyme

* forward mode vector: new pm tests, wip

* llvm-16: fixing tests, wip (#12)

* llvm-16 tests, WIP

* resolving latest test/ll commits (#13)

* Llvm 16 tests (#14)

* llvm-16 tests, WIP

* fix bug introduced in (FunctionUtils.cpp)

* llvm 16 tests, wip

* llvm tests, WIP (#15)

* continued test fixes

* fixup

* fix build

* fix

* cleanup

* fixes

* fix

* fix attr

* fix format

* fixup

* fix attrs

* fix

* fix

* fix

* fix sret

* fix

* add type analysis

* activity analysis

* fix ta

* fix

* fix

* fixes

* more tests

* more fixes

* 297

* more tests

* fix

* fix

* fix

* fix

* fix

---------

Co-authored-by: Pavel Stepanek <stepasite@gmail.com>
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.

None yet

2 participants