Skip to content

Commit

Permalink
support fp64 scale to improve accuracy
Browse files Browse the repository at this point in the history
  • Loading branch information
yunjing.lh committed Apr 27, 2020
1 parent 7a38125 commit 833c70d
Show file tree
Hide file tree
Showing 24 changed files with 224 additions and 1,426 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/dmlc-core
Submodule dmlc-core updated 54 files
+0 −38 .github/workflows/githubci.yml
+1 −0 .gitignore
+82 −0 .travis.yml
+31 −51 CMakeLists.txt
+13 −201 LICENSE
+1 −1 README.md
+6 −19 appveyor.yml
+0 −13 cmake/Modules/FindASan.cmake
+0 −13 cmake/Modules/FindLSan.cmake
+0 −13 cmake/Modules/FindTSan.cmake
+0 −13 cmake/Modules/FindUBSan.cmake
+0 −63 cmake/Sanitizer.cmake
+1 −4 cmake/build_config.h.in
+1 −1 cmake/gtest_cmake.in
+16 −1 doc/Doxyfile
+1 −16 include/dmlc/base.h
+1 −4 include/dmlc/build_config_default.h
+0 −4 include/dmlc/concurrency.h
+18 −18 include/dmlc/concurrentqueue.h
+2 −3 include/dmlc/json.h
+3 −20 include/dmlc/logging.h
+1 −1 include/dmlc/omp.h
+0 −10 include/dmlc/optional.h
+23 −106 include/dmlc/parameter.h
+3 −1 include/dmlc/thread_group.h
+2 −4 include/dmlc/thread_local.h
+46 −74 include/dmlc/threadediter.h
+2 −0 make/dmlc.mk
+2 −2 scripts/lint.py
+19 −12 scripts/packages.mk
+32 −0 scripts/setup_nvcc.sh
+0 −65 scripts/test_script.sh
+0 −0 scripts/travis/s390x/Dockerfile
+0 −0 scripts/travis/s390x/build_via_cmake.sh
+1 −1 scripts/travis/s390x/ci_build.sh
+0 −0 scripts/travis/s390x/entrypoint.sh
+3 −0 scripts/travis/travis_before_cache.sh
+9 −0 scripts/travis/travis_osx_install.sh
+57 −0 scripts/travis/travis_script.sh
+40 −0 scripts/travis/travis_setup_env.sh
+16 −0 src/build_config.cc
+3 −7 src/data/csv_parser.h
+1 −1 test/logging_test.cc
+0 −4 test/unittest/CMakeLists.txt
+1 −2 test/unittest/unittest_env.cc
+0 −30 test/unittest/unittest_param.cc
+56 −80 test/unittest/unittest_parser.cc
+1 −0 test/unittest/unittest_thread_group.cc
+2 −2 test/unittest/unittest_threaditer.cc
+15 −19 test/unittest/unittest_threaditer_exc_handling.cc
+0 −4 tracker/dmlc_tracker/launcher.py
+0 −7 tracker/dmlc_tracker/ssh.py
+0 −13 tracker/dmlc_tracker/util.py
+2 −4 tracker/dmlc_tracker/yarn.py
2 changes: 0 additions & 2 deletions include/tvm/ir/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,5 @@ TVM_DLL std::string PrettyPrint(const ObjectRef& node);
TVM_DLL std::string AsText(const ObjectRef& node,
bool show_meta_data = true,
runtime::TypedPackedFunc<std::string(ObjectRef)> annotate = nullptr);

TVM_DLL std::string AsGraph(const ObjectRef& node);
} // namespace tvm
#endif // TVM_IR_MODULE_H_
286 changes: 0 additions & 286 deletions include/tvm/tir/ir_pass.h

This file was deleted.

4 changes: 2 additions & 2 deletions python/tvm/driver/build_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def lower(sch,
tvm.tir.transform.InjectPrefetch(),
tvm.tir.transform.StorageFlatten(64, cfg.instrument_bound_checkers),
tvm.tir.transform.NarrowDataType(32),
tvm.tir.transform.Simplify(),
# tvm.tir.transform.Simplify(),
]
pass_list += lower_phase1

Expand All @@ -199,7 +199,7 @@ def lower(sch,

# Phase 3
pass_list += [
tvm.tir.transform.Simplify(),
#tvm.tir.transform.Simplify(),
tvm.tir.transform.RemoveNoOp(),
]

Expand Down
4 changes: 0 additions & 4 deletions python/tvm/ir/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ def astext(self, show_meta_data=True, annotate=None):
"""
return _ffi_api.AsText(self, show_meta_data, annotate)

def asgraph(self):
"""Get .dot graph format of the expression"""
return _ffi_api.AsGraph(self)

def __str__(self):
return _ffi_api.PrettyPrint(self)

Expand Down
12 changes: 0 additions & 12 deletions python/tvm/relay/data_dep_optimization/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,3 @@ def _run_opt_pass(expr, opt_pass):
mod = tvm.IRModule.from_expr(expr)
mod = opt_pass(mod)
return mod["main"]

def get_scalar_from_constant(expr):
""" Returns scalar value from Relay constant scalar. """
assert isinstance(expr, _expr.Constant) and not expr.data.shape, \
"Expr is not a constant scalar."
value = expr.data.asnumpy()
if value.dtype == np.dtype(np.int32):
return int(value)
if value.dtype == np.dtype(np.float32) or value.dtype == np.dtype(np.float64):
return float(value)
assert False, "Constant expr must be float32/int32"
return None # To suppress pylint
Loading

0 comments on commit 833c70d

Please sign in to comment.