Skip to content

Add ADVI float32 test to test_vi_float_precision (#5678)#8236

Open
anandraj095 wants to merge 1 commit intopymc-devs:v6from
anandraj095:add_vi_float32_test
Open

Add ADVI float32 test to test_vi_float_precision (#5678)#8236
anandraj095 wants to merge 1 commit intopymc-devs:v6from
anandraj095:add_vi_float32_test

Conversation

@anandraj095
Copy link
Copy Markdown

This PR adds a parameterized test for Variational Inference (ADVI) under float32 precision.
It ensures VI does not break when using float32, complementing the existing float64 tests.

  • Parameterized test using pytest.mark.parametrize for float32 and float64
  • Overrides pytensor.config.floatX within the test
  • Asserts that posterior samples (mu and sigma) have the correct dtype

Closes #5678.

@read-the-docs-community
Copy link
Copy Markdown

Documentation build overview

📚 pymc | 🛠️ Build #32061614 | 📁 Comparing 1b27943 against latest (0f5c0ca)


🔍 Preview build

Show files changed (24 files in total): 📝 24 modified | ➕ 0 added | ➖ 0 deleted
File Status
glossary.html 📝 modified
contributing/developer_guide.html 📝 modified
_modules/pymc/pytensorf.html 📝 modified
_modules/pymc/testing.html 📝 modified
api/generated/pymc.draw.html 📝 modified
api/generated/pymc.icdf.html 📝 modified
api/generated/pymc.logcdf.html 📝 modified
api/generated/pymc.logp.html 📝 modified
api/generated/pymc.sample_posterior_predictive.html 📝 modified
api/generated/pymc.sample_prior_predictive.html 📝 modified
_modules/pymc/distributions/continuous.html 📝 modified
_modules/pymc/distributions/distribution.html 📝 modified
_modules/pymc/distributions/shape_utils.html 📝 modified
_modules/pymc/logprob/basic.html 📝 modified
_modules/pymc/model/core.html 📝 modified
_modules/pymc/ode/ode.html 📝 modified
_modules/pymc/sampling/forward.html 📝 modified
_modules/pymc/variational/approximations.html 📝 modified
_modules/pymc/variational/operators.html 📝 modified
_modules/pymc/variational/opvi.html 📝 modified
_modules/pytensor/tensor/basic.html 📝 modified
_modules/pytensor/tensor/math.html 📝 modified
api/distributions/generated/classmethods/pymc.SymbolicRandomVariable.update.html 📝 modified
api/model/generated/classmethods/pymc.model.core.Model.compile_fn.html 📝 modified

@anandraj095
Copy link
Copy Markdown
Author

anandraj095 commented Mar 31, 2026

Hi, CI is currently failing because test_vi_float.py appears to be completely ignored.

It seems this file might not be included in the CI test matrix.
Would you prefer that I add it to tests.yml, or should these tests be integrated into an existing file?

Thanks!

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v6@bca2b1e). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##             v6    #8236   +/-   ##
=====================================
  Coverage      ?   91.70%           
=====================================
  Files         ?      124           
  Lines         ?    19856           
  Branches      ?        0           
=====================================
  Hits          ?    18209           
  Misses        ?     1647           
  Partials      ?        0           
🚀 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add VI to float32 test suit

1 participant