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

LLVM error: function failed verification (4) on truncated Beta distribution #1996

Closed
mhauru opened this issue Oct 22, 2024 · 3 comments
Closed

Comments

@mhauru
Copy link
Contributor

mhauru commented Oct 22, 2024

MWE:

julia> import Enzyme; using Distributions

julia> func = (a, b, α, β, x) -> logpdf(truncated(Beta(α, β), a, b), x)
#25 (generic function with 1 method)

julia> args = (0.1, 0.9, 1.1, 1.3, 0.4)
(0.1, 0.9, 1.1, 1.3, 0.4)

julia> Enzyme.gradient(Enzyme.Reverse, Enzyme.Const(func), args...)
PHI nodes not grouped at top of basic block!
  %_tmpcacheB = phi fast double , !dbg !34842
label %L25
; Function Attrs: mustprogress willreturn
define internal fastcc "enzyme_type"="{[-1]:Float@double}" double @preprocess_julia_rgammax_189530(double "enzyme_type"="{[-1]:Float@double}" "enzymejl_parmtype"="4766342096" "enzymejl_parmtype_ref"="0" %0, double "enzyme_type"="{[-1]:Float@double}" "enzymejl_parmtype"="4766342096" "enzymejl_parmtype_ref"="0" %1) unnamed_addr #289 !dbg !20938 {
top:
  %2 = call {}*** @julia.get_pgcstack() #339
  %ptls_field4 = getelementptr inbounds {}**, {}*** %2, i64 2
  %3 = bitcast {}*** %ptls_field4 to i64***
  %ptls_load56 = load i64**, i64*** %3, align 8, !tbaa !249
  %4 = getelementptr inbounds i64*, i64** %ptls_load56, i64 2
  %safepoint = load i64*, i64** %4, align 8, !tbaa !253
  fence syncscope("singlethread") seq_cst
  call void @julia.safepoint(i64* %safepoint) #339, !dbg !20939
  fence syncscope("singlethread") seq_cst
  %5 = fcmp une double %1, 0.000000e+00, !dbg !20940
  br i1 %5, label %L4, label %common.ret, !dbg !20941

[... BLAHBLAHBLAH maaaaany lines of logs ...]

ERROR: LLVM error: function failed verification (4)
Stacktrace:
 [1] handle_error(reason::Cstring)
   @ LLVM ~/.julia/packages/LLVM/joxPv/src/core/context.jl:194

Full log here: https://gist.github.com/mhauru/319698728b5994421aa42b7072fba121

julia> versioninfo()
Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

Enzyme version is the main branch from a couple of days ago: 72763e9

@wsmoses
Copy link
Member

wsmoses commented Oct 22, 2024

hopefully fixed by pending jll

@wsmoses
Copy link
Member

wsmoses commented Oct 23, 2024

@mhauru so the jll has landed, can you confirm this is resolved?

@mhauru
Copy link
Contributor Author

mhauru commented Oct 23, 2024

On current main, with Enzyme_jll v0.0.157+0, instead of the above error now getting this with the same MWE: #2010

@mhauru mhauru closed this as completed Oct 23, 2024
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

No branches or pull requests

2 participants