You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/02/12 16:15:53 UTC
[GitHub] [incubator-tvm] zhiics commented on a change in pull request #4868:
[doc][VM] Update the vm doc
zhiics commented on a change in pull request #4868: [doc][VM] Update the vm doc
URL: https://github.com/apache/incubator-tvm/pull/4868#discussion_r378356522
##########
File path: docs/dev/virtual_machine.rst
##########
@@ -284,40 +297,76 @@ Dispatch Loop
~~~~~~~~~~~~~
A critical piece of a VM is the dispatch loop. The dispatch loop usually dominates the execution time of a
virtual machine, but we have experimentally found this not to be the case for Relay. We have just implemented
-a simple `switch`/`goto` dispatch loop which dispatches based on instruction op code.
+a simple ``switch``/``goto`` dispatch loop which dispatches based on instruction op code.
-This loop is implemented by `VirtualMachine::Run()`.
+This loop is implemented by ``VirtualMachine::Run()``.
VM Compiler
~~~~~~~~~~~
An important part of this infrastructure is a compiler from Relay's full IR into a sequence of bytecode.
-The VM compiler transforms a `tvm::relay::Module` into a `tvm::relay::vm::VirtualMachine`. The virtual
-machine contains a set of compiled functions, the compiled functions are contained in `tvm::relay::vm::Function`. The functions contain metadata about the the function as well as its compiled bytecode. For full definitions of the data structures see `vm.h`.
+The VM compiler transforms a ``tvm::relay::Module`` into a ``tvm::relay::vm::Executable``. The executable
+contains a set of compiled functions, the compiled functions are contained in ``tvm::relay::vm::Function``. The functions contain metadata about the the function as well as its compiled bytecode. The emitted executable object then can be loaded and run by a ``tvm::relay::vm::VirtualMachine`` object. For full definitions of the data structures, please see `include/tvm/runtime/vm.h`_.
Optimizations
~~~~~~~~~~~~~
-There are quite a few optimizations required by the VM compiler.
-
-We have implemented them in the old pass style, but plan to port them to
-the new pass manager (#2546) before merging.
+There are quite a few optimizations required by the VM compiler. Each of them
+is implemented as a pass which is managed by the Relay pass manager.
Optimizations marked with `TODO` are not implemented yet.
- A-Normal Form
-- Lambda Lift (see `src/relay/vm/lambda_lift.cc`)
-- Inline Primitives (see `src/relay/vm/inline_primitives.cc`)
-- Inliner (see `src/relay/pass/inliner.cc`)
-- Constant Pool Layout (see `src/relay/backend/vm/compiler.cc`)
-- ADT Tag Allocation (see `src/relay/backend/vm/compiler.cc`)
+- Lambda Lift (see `src/relay/vm/lambda_lift.cc`_)
+- Inline Primitives (see `src/relay/vm/inline_primitives.cc`_)
+- Constant Pool Layout (see `src/relay/backend/vm/compiler.cc`_)
+- ADT Tag Allocation (see `src/relay/backend/vm/compiler.cc`_)
Review comment:
Yeah, it was from the old version. We need to remove it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services