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

Make MicroContext and MicroGraph abstract #2202

Merged
merged 4 commits into from
Sep 11, 2023

Conversation

rascani
Copy link
Contributor

@rascani rascani commented Aug 30, 2023

MicroContext and MicroGraph serve as the primary API surface between the interpreter and the kernels. For interpreter-less execution, we need to be able to substitute different MicroContext and MicroGraph implementations. This PR makes MicroContext and MicroGraph abstract and moves their existing implementations to MicroInterpreterContext and MicroInterpreterGraph, respectively. This will allow us to substitute an inference-only implementation of each for codegen.

FakeMicroContext and MockMicroGraph were also updated to implement the base classes.

BUG=b/295174086

MicroContext and MicroGraph serve as the primary API surface between the
interpreter and the kernels. For interpreter-less execution, we need to
be able to substitute different MicroContext and MicroGraph
implementations. This PR makes MicroContext and MicroGraph abstract and
moves their existing implementations to MicroInterpreterContext and
MicroInterpreterGraph, respectively. This will allow us to substitute
an inference-only implementation of each for codegen.

FakeMicroContext and MockMicroGraph were also updated to implement the
base classes.

BUG=b/295174086
@rascani rascani requested a review from a team as a code owner August 30, 2023 22:25
This ensures that all fields are zero unless populated by the kernel.
@rascani rascani added the ci:run label Aug 31, 2023
@TFLM-bot TFLM-bot removed the ci:run label Aug 31, 2023
@rascani rascani requested a review from suleshahid September 1, 2023 18:35
Copy link
Collaborator

@suleshahid suleshahid left a comment

Choose a reason for hiding this comment

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

LGTM

@mergify mergify bot merged commit c3cfd34 into tensorflow:main Sep 11, 2023
28 checks passed
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.

3 participants