Skip to content
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

[runtime][python] Should DeviceArray.to_host() use a cache? #18870

Open
sogartar opened this issue Oct 22, 2024 · 1 comment
Open

[runtime][python] Should DeviceArray.to_host() use a cache? #18870

sogartar opened this issue Oct 22, 2024 · 1 comment

Comments

@sogartar
Copy link
Contributor

DeviceArray's to_host() method would reuse a cached result. In the mean time the contents of the array may have changed and subsequent calls to to_host will return the cached value, which at this point is wrong.
Is this the intended behavior? My expectation is that it should not cache anything and copy it every time if the array is not mappable to the host.

@stellaraccident
Copy link
Collaborator

Yes, that design is problematic. This was originally written to make some porting easier and includes too much implicit behavior. I would be fine removing those lines you reference. We could also add an option to force or something, but it is better to not add more weird behavior.

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

No branches or pull requests

2 participants