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

Test master #538

Closed
wants to merge 2 commits into from
Closed

Test master #538

wants to merge 2 commits into from

Conversation

ChrisRackauckas
Copy link
Member

No description provided.

@ChrisRackauckas
Copy link
Member Author

@wsmoses caught this in a downstream test today.

Enzyme Derivative Rules: Error During Test at /home/runner/.julia/packages/SafeTestsets/raUNr/src/SafeTestsets.jl:30
  Got exception outside of a @test
  LoadError: Constant memory is stored (or returned) to a differentiable variable.
  As a result, Enzyme cannot provably ensure correctness and throws this error.
  This might be due to the use of a constant variable as temporary storage for active memory (https://enzyme.mit.edu/julia/stable/faq/#Activity-of-temporary-storage).
  If Enzyme should be able to prove this use non-differentable, open an issue!
  To work around this issue, either:
   a) rewrite this variable to not be conditionally active (fastest, but requires a code change), or
   b) set Enzyme.API.runtimeActivity!(true) immediately after loading Enzyme (which maintains correctness, but may slightly reduce performance).
  Mismatched activity for:   %.fca.0.insert = insertvalue { {} addrspace(10)*, {} addrspace(10)* } poison, {} addrspace(10)* %1, 0, !dbg !19 const val: {} addrspace(10)* %1
   value=Unknown object of type Matrix{Float64}
   llvalue={} addrspace(10)* %1
  
  Stacktrace:
   [1] LinearProblem
     @ ~/.julia/packages/SciMLBase/FfEKU/src/problems/linear_problems.jl:0
  
  Stacktrace:
    [1] LinearProblem
      @ ~/.julia/packages/SciMLBase/FfEKU/src/problems/linear_problems.jl:0 [inlined]

Is there a change to Enzyme I can look at to help me orient around what changed?

@wsmoses
Copy link
Contributor

wsmoses commented Sep 2, 2024

we realized we we'rent throwing errors for llvm insert instructions that were runtime active [aka storing, via an insert instruction, a contant pointer, into a differentiable data structure]

@ChrisRackauckas
Copy link
Member Author

So it should've errored before and it just didn't? 😅

@ChrisRackauckas
Copy link
Member Author

I guess like the others, LinearProblem might need to be mutable?

@ChrisRackauckas
Copy link
Member Author

Bump, the question is:

I guess like the others, LinearProblem might need to be mutable?

@wsmoses
Copy link
Contributor

wsmoses commented Sep 11, 2024

@ChrisRackauckas can you mark

A = rand(n, n);
as const A

The issue yells that

prob = LinearProblem(A, b)
is type unstable, and uses a constant variable (A) being stored into a differentiable LinearProblem. Marking it as const/type stable may optimize out the linear problem, solving the issue

@ChrisRackauckas
Copy link
Member Author

Fixing the type stability and marking things constant didn't seem to effect it.

@ChrisRackauckas ChrisRackauckas deleted the ChrisRackauckas-patch-2 branch September 27, 2024 02:38
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.

2 participants