Skip to content

Conversation

willtebbutt
Copy link
Contributor

istrans doesn't need to be differentiated through (as far as I'm aware). It's a little bit awkward in places at the minute, and adds a bit of overhead to Tapir.jl when it differentiates a Turing.jl model, so this method says "don't bother differentiating through it.

Comment on lines +14 to +15
Tapir.@is_primitive DefaultCtx Tuple{typeof(DynamicPPL.istrans), Vararg}
function Tapir.rrule!!(f::CoDual{typeof(DynamicPPL.istrans)}, x::Vararg{CoDual, N}) where {N}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
Tapir.@is_primitive DefaultCtx Tuple{typeof(DynamicPPL.istrans), Vararg}
function Tapir.rrule!!(f::CoDual{typeof(DynamicPPL.istrans)}, x::Vararg{CoDual, N}) where {N}
Tapir.@is_primitive DefaultCtx Tuple{typeof(DynamicPPL.istrans),Vararg}
function Tapir.rrule!!(f::CoDual{typeof(DynamicPPL.istrans)}, x::Vararg{CoDual,N}) where {N}

@@ -0,0 +1,9 @@
@testset "DynamicPPLTapirExt" begin
Tapir.TestUtils.test_rule(
Xoshiro(123), istrans, VarInfo();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
Xoshiro(123), istrans, VarInfo();
Xoshiro(123),
istrans,
VarInfo();

@yebai
Copy link
Member

yebai commented Sep 5, 2024

DynamicPPL master branch contains unreleased breaking changes; it’s easier to keep this extension inside Tapir for now.

@willtebbutt
Copy link
Contributor Author

https://github.com/compintell/Tapir.jl/

I'll move it there. Thanks for the info.

@willtebbutt willtebbutt closed this Sep 5, 2024
@yebai yebai deleted the wct/tapir-optimisation branch October 3, 2024 11:16
@yebai yebai restored the wct/tapir-optimisation branch October 3, 2024 11:16
@yebai yebai deleted the wct/tapir-optimisation branch October 3, 2024 11:16
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