pymc-devs / pymc-devs/pymc

Problematic casting of integers in `convert_observed_data`

Open
#7,331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9.8k
Forks
2.3k
Avg merge
21h 39m
Merged PRs (30d)
5

Description

Description

When we use pytensor.config.floatX=="float32", integer data is downcast to "int16" which has a pretty limited range of 32k. For count-based likelihoods this is way too narrow. I am not sure we should be doing anything with integers to begin with. Why are PyTensor casting rules (and customization flags) not sufficient?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating convert_observed_data and tracing how integer observed data is converted when pytensor.config.floatX is set to float32. Review PyTensor's casting rules and customization flags before deciding whether integer conversion should occur. Done requires an agreed behavior that preserves an appropriate integer range for count-based likelihoods.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.