Giter VIP home page Giter VIP logo

Comments (3)

gramalingam avatar gramalingam commented on July 21, 2024

Another related feature is that of allowing potentially multiple function-definitions for the same op (in a code-base). It would be good if the underlying design enables this. It is also related to the notion of a "library" (a "LibProto" in serialized form) to represent a set of function-definitions bundled together. And to the ability to "link" a ModelProto against one or more libraries.

from onnxscript.

gramalingam avatar gramalingam commented on July 21, 2024

I suggest that we remove the embedded functions stored in the IR objects (for Stmt and Function), and instead make to_model_proto and to_graph_proto take a resolver object as a parameter, where a resolver is a dictionary-like object that, given a function-identifier (name, opset, version) returns a FunctionProto or None. The goal is to decouple the mechanism used to maintain a mapping from function-identifiers to their corresponding FunctionProto instead of hard-coding it into the IR itself. This will help address the key concerns, such as below:

The behavior of foo.to_model_proto() should be well-defined. As it exists today, assume that foo calls bar. If we do an import bar_def that has the effect of defining the body of bar, then foo_to_model_proto() will include the definition of bar as a model-local function, otherwise it won't. So, the behavior of to_model_proto ends up depending on hidden-state. It is better if the behavior is explicitly captured by an extra-parameter resolver of to_model_proto.

from onnxscript.

justinchuby avatar justinchuby commented on July 21, 2024

This would be nice 👍

from onnxscript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.