TuringLang / TuringLang/SSMProblems.jl

Mooncake extension silently loses gradients and rejects valid inputs

Open
#188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
11
Forks
7
PR merge metrics
No merged PRs in 30d

Description

MooncakeExt has several tangent-handling failures. Here, ll(μ) wraps kf_loglikelihood with fixed parameters:

  • ll(μ) + sum(μ): gradient 0.00486532; finite differences give 1.00486532.
  • ll(μ) + ll(μ): loses one gradient contribution.
  • Differentiating observations returns zero instead of −0.86780778.
  • Constant jitter=0.01 throws increment!!(::Float64, ::NoRData).
  • Plain-matrix priors, ScalMat, Float32 models, and mixed dense/static covariance storage also fail.

Accumulate existing tangents, handle forward/reverse components independently, and explicitly reject unsupported derivatives.

Verified with Julia 1.12.7, Mooncake 0.5.57, and PDMats 0.11.41.

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 locating MooncakeExt and the kf_loglikelihood wrapper, then reproduce the listed gradient and input failures on the stated Julia, Mooncake, and PDMats versions. Trace tangent accumulation and forward/reverse handling, and verify that supported derivatives preserve all contributions while unsupported derivatives are rejected explicitly.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.