-
Notifications
You must be signed in to change notification settings - Fork 69
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
Issues with Wishart
from Distributions.jl
#1081
Comments
What version of enzyme are you on? (the output of ] st`). This bug doesn't reproduce for me (and from the looks was fixed a long time ago). Reopen if it persists on current release/main |
Sorry, forgot to include the deps as I had already added it to my original comment in the PR. |
I can reproduce this bug on MacOS. (jl_V30byf) pkg> st
Status `/private/var/folders/m8/xtrwgfnd6n17xhdx98_9y5nc0000gn/T/jl_V30byf/Project.toml`
[31c24e10] Distributions v0.25.100
[7da242da] Enzyme v0.11.8
julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 20 × Apple M1 Ultra
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
Threads: 1 on 16 virtual cores Error: julia> using Distributions, Enzyme
julia> let dist = Wishart(7, [1 0.5; 0.5 1]), x = rand(dist), ∂f∂x = zero(x)
_, y = Enzyme.autodiff(Enzyme.ReverseWithPrimal, logpdf, Enzyme.Active,
Enzyme.Const(dist), Enzyme.Duplicated(x, ∂f∂x))
y, ∂f∂x
end
warning: didn't implement memmove, using memcpy as fallback which can result in errors
warning: didn't implement memmove, using memcpy as fallback which can result in errors
warning: didn't implement memmove, using memcpy as fallback which can result in errors
warning: didn't implement memmove, using memcpy as fallback which can result in errors
ERROR: LLVM error: broken gc calling conv fix
Range types must match instruction type!
call fastcc void @augmented_julia_chkuplofinite_4765({} addrspace(10)* nocapture noundef nonnull readonly align 16 dereferenceable(40) %0), !dbg !700, !range !166
; ModuleID = 'start'
source_filename = "start"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128-ni:10:11:12:13"
target triple = "arm64-apple-darwin22.4.0"
@_j_str5 = private unnamed_addr constant [11 x i8] c"typeassert\00"
@_j_const7 = private unnamed_addr constant [129 x [2 x double]] [[2 x double] zeroinitializer, [2 x double] [double 0x3F7FE02A6B200000, double 0xBD6F30EE07912DF9], [2 x double] [double 0x3F8FC0A8B1000000, double 0xBD5FE0E183092C59], [2 x double] [double 0x3F97B91B07D80000, double 0xBD62772AB6C0559C], [2 x double] [double 0x3F9F829B0E780000, double 0x3D2980267C7E09E4], [2 x double] [double 0x3FA39E87BA000000, double 0xBD642A056FEA4DFD], [2 x double] [double 0x3FA77458F6340000, double 0xBD62303B9CB0D5E1], [2 x double] [double 0x3FAB42DD71180000, double 0x3D671BEC28D14C7E], [2 x double] [double 0x3FAF0A30C0100000, double 0x3D662A6617CC9717], [2 x double] [double 0x3FB16536EEA40000, double 0xBD60A3E2F3B47D18], [2 x double] [double 0x3FB341D7961C0000, double 0xBD4717B6B33E44F8], [2 x double] [double 0x3FB51B073F060000, double 0x3D383F69278E686A], [2 x double] [double 0x3FB6F0D28AE60000, double 0xBD62968C836CC8C2], [2 x double] [double 0x3FB8C345D6320000, double 0xBD5937C294D2F567], [2 x double] [double 0x3FBA926D3A4A0000, double 0x3D6AAC6CA17A4554], [2 x double] ...... |
Let me try my Mac laptop to try to reproduce as well. |
If not I may ask to hop on a zoom or something to try to figure out the root cause. |
I can reproduce with the same error:
|
Looks like it was 1.9 specific. Fixed by the above PR. Note that this then goes hits an unimplemented lapack call:
|
@wsmoses I suggest that we always add a test to similar bugfix PRs, so avoid accidentally breaking these again. This is particularly useful, given that subtle Julia internal changes often affect Enzyme. |
I was happy when I saw that this issue was closed - but when checking the MWE I noticed that it still doesn't work and one runs into the BLAS issue mentioned in #1081 (comment). So maybe this issue should be kept open until the potrf! issue is fixed? |
So these are two separate issues, one of which is that we had the calling convention mismatch (here), the second of which is an implementation of potrf and/or cholesky, etc. I'd like to keep this issue just to the calling conv fix. You can open another for cholesky, though I think we may have ones for those already. In any case, it should be fixed by #1220 which I was just finishing up now and hopefully should be merged in a few mins. |
and @devmotion FYI cholesky support is now merged. If you retry turing back on main, that error should go away. The final remaining error is an issue that comes from Julia1.10/GPUCompiler causing an infinite recursion for |
fails with a stacktrace that is too long to paste, but here's the beginning of it:
The text was updated successfully, but these errors were encountered: