[Pytorch Edge] Runtime ops compatibility api (#57570)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/57570

Move runtime ops compatibility api to OSS and introduce schema information
ghstack-source-id: 128789159

Test Plan: unit test and manually ran it for a runtime with all (non custom) ops, and the bixray models unittest {P412728176}

Reviewed By: raziel

Differential Revision: D28203104

fbshipit-source-id: 432a7d0247bccfb2e1ce90e8d41f81596efa3d67
This commit is contained in:
Jacob Szwejbka
2021-05-13 10:19:28 -07:00
committed by Facebook GitHub Bot
parent 2294fd61c6
commit 1de9f51782
3 changed files with 54 additions and 0 deletions

View File

@ -721,6 +721,13 @@ TEST(LiteInterpreterTest, BackPortByteCodeModelAllVersions) {
caffe2::serialize::kProducedBytecodeVersion);
}
TEST(LiteInterpreterTest, GetRuntimeOpsAndInfo) {
auto runtime_ops = _get_runtime_ops_and_info();
// Ballpark estimate of the minimal number of ops; just used to
// verify API returns a reasonably large number.
AT_ASSERT(runtime_ops.size() > 2900);
}
// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
TEST(LiteInterpreterTest, SequentialModuleInfo) {
Module a("A");