Skip to content

Conversation

aseyboldt
Copy link
Member

See https://discourse.pymc.io/t/nutpie-panel-data-events-moving/17046/5 for more details

Shared variables (ie pm.Data) that were non-contiguous could lead to incorrect results in the pymc numba
backend.
We now ensure that they are always c-contiguous by copying if they are not.

@aseyboldt aseyboldt force-pushed the fix-numba-fortran-order branch from 4a731c0 to 27d69da Compare May 28, 2025 12:42
Shared variables (ie pm.Data) that were non-contiguous
could lead to incorrect results in the pymc numba
backend.
We now ensure that they are always c-contiguous by
copying if they are not.
@aseyboldt aseyboldt force-pushed the fix-numba-fortran-order branch from 27d69da to 18e5a07 Compare May 28, 2025 12:57
@aseyboldt aseyboldt merged commit bb5a866 into pymc-devs:main May 28, 2025
8 checks passed
if val.name in shared_data and val not in seen:
raise ValueError(f"Shared variables must have unique names: {val.name}")
shared_data[val.name] = val.get_value()
shared_data[val.name] = np.array(val.get_value(), order="C", copy=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're copying anyway you can do get_value(borrow=True) to avoid doing 2 copies

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