Alternatively, we can automatically create a wrapped module class using the type key. Automatically create wrapper type via type_key
#GMOD FILE SAVING MODULE FULL#
The full power of the module is always available as the raw API. Note that the main purpose of the wrapper API is to provideĬlear documentation for the most common usecases. Gmod = graph_runtime.create(lib, ctx=tvm.cpu(0)) The wrapper API using a constructor/create function. The first way is to ask the users to directly construct To make life easier for our users, we can still do a minimum wrappings around the raw API. Most of the above discussions are for the raw APIs. D4: Do you like the new way of packaging, or is it fine to continue use the old graph rt API.Under the restriction that PackedFunc only takes positional argument. D3: runtime argument specification convention for multiple contexts in the hetrogenous env.While get_output keep things simple and minimum. predict forces us to enable runtime tuple support in the case of multiple output,.predict is a more high level user friendly API, note that we still want toĪllow destination passing style(pass out) to allow more flexibility.run is useful to do fine grained benchmarking.set interface is useful to allow users to set parameters during runtime.Or shall we take the alternative API specialization approach. Shall we always require a model name field (and allow “default”), We can have a different levels of interface sharing H4: Depending on what interface we encourage (set/run/get).To generate a logic that runs the graph runtime, but use the same This interface brings some future benefits – e.g. That means the create function only have to take a context parameter.
# Alternative API 2: directly key constructor by model name. # Alternative API 1: select the model then construct # The first argument is a key that helps to solve R3 # Having this additional factory create step solves R1 # Call into the factory module to create a graph runtime We start the discussion by a strawman’s proposal using the raw module interface. Given that all the additional wrapping boils down to the raw module interface. However, it is hard to agree on “the interface convention” for TVM’s ML model packaging.Īs a basic principle, we directly make use of the current Module system to build a convention on top.Īn important thing to keep in mind is that we hope to let the users learn as little as possible. It is not hard to propose a few interfaces to “solve” the above challenges.
#GMOD FILE SAVING MODULE CODE#
Our most commonly used interface is the graph runtime, whose mechanism is a bit differentįrom low-level code loading (not as simple as module.load).
#GMOD FILE SAVING MODULE HOW TO#
However, we are still facing a challenge on how to have a common deployment #include "winlite.h" #undef _UNICODE #include #include "icvar.h" #include "convar.h" #include "detours.h" #include "GMLuaModule.The module interface works great for deploying the generated operator libraries in TVM.