Code Monkey home page Code Monkey logo

Comments (4)

ChijinZ avatar ChijinZ commented on July 29, 2024 2

Hi @ganler , thank you so much for your detailed answer. The explanations and examples are very clear to me, so I close this issue.

BTW, most of NNSmith's code is well-designed and self-explanatory, nice job!

from nnsmith.

ganler avatar ganler commented on July 29, 2024

Hi Chijin, your understanding is basically correct! There are a few more details / resources that can be helpful:

Adding an operator requires a specification. You can learn about the concept of an operator specification/rule via:

Regarding implementation of op spec, you can find the quick tutorial in https://github.com/ise-uiuc/nnsmith/blob/main/doc/concept.md and various examples in:

Once you are done with defining an operator specification. You can materialize the operator in https://github.com/ise-uiuc/nnsmith/blob/main/nnsmith/materialize/torch/forward.py (for PyTorch) or https://github.com/ise-uiuc/nnsmith/blob/main/nnsmith/materialize/tensorflow/forward.py (for TF).

from nnsmith.

ganler avatar ganler commented on July 29, 2024

As a reference, you may find this PR a helpful example: https://github.com/ise-uiuc/nnsmith/pull/98/files

from nnsmith.

ganler avatar ganler commented on July 29, 2024

In your case of Split, please note that the modeling of operators in NNSmith requires the number of inputs/outputs to be fixed. A typical split operator could variadic outputs (https://pytorch.org/docs/stable/generated/torch.split.html). Nonetheless, you can still implement multiple versions of Split, say Split1 (only one output), Split2 (2 outputs, etc)... You follow how Concat is implemented for reference: https://github.com/ise-uiuc/nnsmith/blob/main/nnsmith/abstract/op.py#L1904

Let me know if you have more questions. Sorry for the incomplete documents -- will enhance it as long as I have time at hand. For now please feel free to submit an issue and ping me for any undocument questions! Thanks!

from nnsmith.

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.