Skip to content

Change default cast_policy to numpy+floatX to fix float downcasting#1917

Draft
ayulockedin wants to merge 1 commit intopymc-devs:mainfrom
ayulockedin:fix-float-downcast
Draft

Change default cast_policy to numpy+floatX to fix float downcasting#1917
ayulockedin wants to merge 1 commit intopymc-devs:mainfrom
ayulockedin:fix-float-downcast

Conversation

@ayulockedin
Copy link
Contributor

Description

This PR changes the default cast_policy in configdefaults.py to numpy+floatX. This removes the older NumpyAutocaster machinery which was causing inconsistent float downcasting (e.g., downcasting 9.0 to float32 while keeping 8.9 and 9.1 as float64).

Opening this as a draft PR first to let the CI test suite evaluate the overall impact. Changing this core default will likely require updating type assertions across the broader test suite where the old downcasting behavior was explicitly expected.

Related Issue

Checklist

  • Checked that the pre-commit linting/style checks pass
  • Included tests that prove the fix is effective or that the new feature works
  • Added necessary documentation (docstrings and/or example notebooks)
  • If you are a pro: each commit corresponds to a relevant logical change

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

@ayulockedin
Copy link
Contributor Author

ayulockedin commented Feb 26, 2026

i have changed the default to see what the damage cuz i think all tests would also be relying on the old NumpyAutocaster here, lets see what the blast radius is

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.

Default casting to int8 leads to easy overflow errors

1 participant