This is an archive of the discontinued LLVM Phabricator instance.

[MLGO] Make TFLiteUtils throw an error if some features haven't been passed to the model
ClosedPublic

Authored by aidengrossman on Sep 7 2022, 1:41 PM.

Details

Summary

In the Tensorflow C lib utilities, an error gets thrown if some features
haven't gotten passed into the model (due to differences in ordering
which now don't exist with the transition to TFLite). However, this is
not currently the case when using TFLiteUtils. This patch makes some
minor changes to throw an error when not all inputs of the model have
been passed, which when not handled will result in a seg fault within
TFLite.

Diff Detail

Event Timeline

aidengrossman created this revision.Sep 7 2022, 1:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2022, 1:41 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
aidengrossman requested review of this revision.Sep 7 2022, 1:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 7 2022, 1:41 PM

Ah, good catch. Can you add a test, perhaps TFUtilsTest.cpp?

Add unit test to ensure that the Evaluator is invalid if an evaluation is made
where there is a feature that is missing.

mtrofin accepted this revision.Sep 7 2022, 5:08 PM
This revision is now accepted and ready to land.Sep 7 2022, 5:08 PM