Skip to content

Allow specifying context in AD testing #935

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

Merged
merged 2 commits into from
May 23, 2025
Merged

Conversation

penelopeysm
Copy link
Member

This is necessary for TuringLang/Turing.jl#2307 because AD in sampling is run with a SamplingContext, not a DefaultContext. Thus to properly test AD there we need to be able to specify a context.

Copy link
Contributor

github-actions bot commented May 23, 2025

Benchmark Report for Commit 73ed741

Computer Information

Julia Version 1.11.5
Commit 760b2e5b739 (2025-04-14 06:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × AMD EPYC 7763 64-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)

Benchmark Results

|                 Model | Dimension |  AD Backend |      VarInfo Type | Linked | Eval Time / Ref Time | AD Time / Eval Time |
|-----------------------|-----------|-------------|-------------------|--------|----------------------|---------------------|
| Simple assume observe |         1 | forwarddiff |             typed |  false |                  9.8 |                 1.5 |
|           Smorgasbord |       201 | forwarddiff |             typed |  false |                708.7 |                37.6 |
|           Smorgasbord |       201 | forwarddiff | simple_namedtuple |   true |                415.6 |                44.3 |
|           Smorgasbord |       201 | forwarddiff |           untyped |   true |               1208.9 |                27.1 |
|           Smorgasbord |       201 | forwarddiff |       simple_dict |   true |               3267.4 |                23.5 |
|           Smorgasbord |       201 | reversediff |             typed |   true |               1423.1 |                29.7 |
|           Smorgasbord |       201 |    mooncake |             typed |   true |                937.2 |                 5.3 |
|    Loop univariate 1k |      1000 |    mooncake |             typed |   true |               5440.9 |                 4.1 |
|       Multivariate 1k |      1000 |    mooncake |             typed |   true |               1011.2 |                 8.8 |
|   Loop univariate 10k |     10000 |    mooncake |             typed |   true |              61060.9 |                 3.7 |
|      Multivariate 10k |     10000 |    mooncake |             typed |   true |               8631.0 |                10.0 |
|               Dynamic |        10 |    mooncake |             typed |   true |                129.1 |                12.3 |
|              Submodel |         1 |    mooncake |             typed |   true |                 14.0 |                 6.3 |
|                   LDA |        12 | reversediff |             typed |   true |                444.4 |                 5.6 |

Copy link

codecov bot commented May 23, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.91%. Comparing base (0b6e364) to head (73ed741).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/test_utils/ad.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #935   +/-   ##
=======================================
  Coverage   82.91%   82.91%           
=======================================
  Files          36       36           
  Lines        3962     3962           
=======================================
  Hits         3285     3285           
  Misses        677      677           

☔ 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.

@coveralls
Copy link

coveralls commented May 23, 2025

Pull Request Test Coverage Report for Build 15210817349

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 83.08%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/test_utils/ad.jl 0 2 0.0%
Totals Coverage Status
Change from base Build 15185827322: 0.0%
Covered Lines: 3285
Relevant Lines: 3954

💛 - Coveralls

Copy link
Contributor

DynamicPPL.jl documentation for PR #935 is available at:
https://TuringLang.github.io/DynamicPPL.jl/previews/PR935/

@penelopeysm penelopeysm removed the request for review from mhauru May 23, 2025 14:14
@penelopeysm penelopeysm merged commit 2fd1897 into main May 23, 2025
18 of 20 checks passed
@penelopeysm penelopeysm deleted the py/adtest-with-ctx branch May 23, 2025 14:14
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