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

initialize/set backend in runKernelFunc #4485

Merged
merged 4 commits into from
Jan 5, 2021
Merged

Conversation

tafsiri
Copy link
Contributor

@tafsiri tafsiri commented Jan 5, 2021

Fixes #4480

Initialize backend in runKernelFunc if its not already initialized/set.

It manifests in the bug above because linspace no longer calls other ops which would initialize the backend (usually by creating some tensor). It also affects op like range which call runKernel before doing any tensor creation or anything else. The bug will only appear if linspace or range is the first op called, and no any other action that would cause the lazy setting of a backend to have completed (like tensor creation).

To see the logs from the Cloud Build CI, please join either our discussion or announcement mailing list.


This change is Reviewable

@google-cla google-cla bot added the cla: yes label Jan 5, 2021
Copy link
Contributor

@annxingyuan annxingyuan left a comment

Choose a reason for hiding this comment

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

Interesting! Thanks Yannick. Could you add a bit more context to the comment - e.g. mention that certain ops don't cause backend initialization anymore?

@tafsiri
Copy link
Contributor Author

tafsiri commented Jan 5, 2021

@annxingyuan Thanks. I've updated the comment to mention lazy backend initialization and how that interacts with ops/kernels broadly, I didn't want the comment to be too tied to the ops mentioned in this PR description to keep it as relevant as possible 6 months+ from now, so I tried to find a general way to express it.

@tafsiri tafsiri merged commit d022649 into master Jan 5, 2021
@tafsiri tafsiri deleted the backend-init-runKernelFunc branch January 5, 2021 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error running LinSpace
3 participants