JuliaDiff / JuliaDiff/DifferentiationInterface.jl

copy method for prep objects

Open
#858 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backend core
Dominant language
Julia
Stars
313
Forks
35
PR merge metrics
No merged PRs in 30d

Description

Please add copy method for prep objects if that is feasible.

Rationale: no need to invoke prepare_... methods again, which require (at least the type of) the original x which would then need to be kept, for no other reason.

Specifically, I want to use it in LogDensityProblemsAD.jl, our current implementation is not thread-safe since copy falls back to a no-op.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the prep-object implementations and the prepare_... methods, then inspect ext/LogDensityProblemsADDifferentiationInterfaceExt.jl in the linked LogDensityProblemsAD implementation. Determine how copying is currently handled and what preparation state must be independent for thread safety; done means prep objects can be copied without rerunning preparation or falling back to a no-op.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.