Skip to content

Conversation

@penelopeysm
Copy link
Member

@penelopeysm penelopeysm commented Aug 18, 2025

This PR modifies LibtaskExt to allow sampling from Turing models with keyword arguments with SMC or PG. See TuringLang/Turing.jl#2660 for usage.

It's obviously quite ugly, the problem is that even though Turing is the only library that subtypes the abstract type, the abstract type has to be defined in AdvancedPS so that the LibtaskExt can dispatch on it. Ideally, that abstract type + any relevant methods inside LibtaskExt should just be shifted into Turing proper. That's for another time.

@yebai
Copy link
Member

yebai commented Aug 19, 2025

Yes, we'd like to merge the AdvancedPS code to Turing.jl. Libtask was holding us back; now, it is ready.

@penelopeysm penelopeysm marked this pull request as ready for review December 12, 2025 17:16
@yebai yebai requested a review from sunxd3 December 12, 2025 17:18
@github-actions
Copy link
Contributor

AdvancedPS.jl documentation for PR #118 is available at:
https://TuringLang.github.io/AdvancedPS.jl/previews/PR118/

@penelopeysm penelopeysm force-pushed the py/kwargs branch 2 times, most recently from cf3da3f to 28c9e2e Compare December 12, 2025 17:32
@penelopeysm
Copy link
Member Author

Hi @yebai, sorry just tidying this up before I go away :)

I am happy to try to work on upstreaming the necessary parts to Turing next year, but that might take more time, and this PR will unblock keyword arguments on SMC/PG on Turing (TuringLang/Turing.jl#2660). So I think it makes sense to merge this first. I tested locally and it all works as intended, so happy for it to be reviewed now (cc also @mhauru).

@penelopeysm penelopeysm changed the title Pass kwargs on to Libtask Allow passing kwargs on to Libtask (when it's an AbstractTuringLibtaskModel...) Dec 12, 2025
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@e100352). Learn more about missing BASE report.

Files with missing lines Patch % Lines
ext/AdvancedPSLibtaskExt.jl 42.85% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #118   +/-   ##
=======================================
  Coverage        ?   95.41%           
=======================================
  Files           ?        8           
  Lines           ?      436           
  Branches        ?        0           
=======================================
  Hits            ?      416           
  Misses          ?       20           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants