[Relay][VM] Memory planner (part 1) (#5144)
authorJared Roesch <jroesch@octoml.ai>
Fri, 15 May 2020 04:46:21 +0000 (21:46 -0700)
committerGitHub <noreply@github.com>
Fri, 15 May 2020 04:46:21 +0000 (21:46 -0700)
commit674f58aea51504d0bc6dce071ac3e2e5172501d3
treecc99ea6d81c2f27930c9732b150c9c4e8ded88cb
parenta400f825281f3c6f0688e8b16deea4ba12ee6bb5
[Relay][VM] Memory planner (part 1) (#5144)

* Start on memory planning

WIP

Move to test_memory_passes.py

Work on memory planning

Post-rebase and VM changes

Plumb through the offsets

Basic tests all pass, fix offset to data buffer.

Fix compile errors

Fix ws

Apply suggestions from code review

Co-Authored-By: Haichen Shen <shenhaichen@gmail.com>
Address CR

Update src/runtime/vm/vm.cc

Co-Authored-By: Haichen Shen <shenhaichen@gmail.com>
Fix another comment

Fix lint

Fix

Fix

Fix

Lint is done?

Fix

More fix

Trying to debug

No clue

Fix lint

* Fix docs

* Disable aggressive constant eval

* It works

* Fix lint

* Found issue with dynamic

* Fix the pass, but runtime segfaults

* fix scalar tensor, test_any_elemwise passes

* Fix split pass

* Fix 0-rank issues

* Fix

* debug

* apply Haichen's patch and clean up

* lintgit add .

* fix serializer and test_tyck_alloc_tensor test

* Fix the constant lift pass in presence of closures

* Restore old finder

* Fix rebase issues

* Fix

* Fix

* Fix issue coercing the shapes incorrectly from i64 to i32

* Fix linting

* Fix clang format

* Format memory.cc

* Fix 0-rank case

* Add fix for (0,) shape

* Ignore shapes for now

* Apply suggestions from code review

Co-authored-by: Zhi <5145158+zhiics@users.noreply.github.com>
* Update src/runtime/vm/executable.cc

Co-authored-by: Zhi <5145158+zhiics@users.noreply.github.com>
* Fix

* lint

Co-authored-by: Zhi Chen <chzhi@amazon.com>
Co-authored-by: Zhi <5145158+zhiics@users.noreply.github.com>
16 files changed:
include/tvm/runtime/ndarray.h
include/tvm/runtime/vm.h
python/tvm/relay/__init__.py
python/tvm/relay/expr.py
python/tvm/relay/op/memory/memory.py
python/tvm/relay/transform/__init__.py
python/tvm/relay/transform/memory_alloc.py
python/tvm/relay/transform/memory_plan.py [new file with mode: 0644]
src/relay/backend/vm/compiler.cc
src/relay/op/memory/memory.cc
src/runtime/ndarray.cc
src/runtime/vm/executable.cc
src/runtime/vm/memory_manager.cc
src/runtime/vm/vm.cc
tests/python/frontend/onnx/test_forward.py
tests/python/relay/test_memory_passes.py [moved from tests/python/relay/test_pass_memory_alloc.py with 62% similarity]