From 40e97de9870577319b623762219bf97a24b12949 Mon Sep 17 00:00:00 2001 From: ZihengJiang Date: Wed, 6 Feb 2019 15:52:51 -0800 Subject: [PATCH] [BUGFIX] Fix for quantize. --- python/tvm/autotvm/task/relay_integration.py | 2 -- src/relay/pass/quantize.cc | 5 ++--- src/relay/pass/quantize.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/python/tvm/autotvm/task/relay_integration.py b/python/tvm/autotvm/task/relay_integration.py index 1d09d086757c..82350dcebea8 100644 --- a/python/tvm/autotvm/task/relay_integration.py +++ b/python/tvm/autotvm/task/relay_integration.py @@ -31,8 +31,6 @@ def extract_from_program(func, params, ops, target, target_host=None): The associated parameters of the program ops: List of relay op List of relay ops to be tuned - dtype: str or dict of str to str - The input types to the program target: tvm.target.Target The compilation target target_host: tvm.target.Target diff --git a/src/relay/pass/quantize.cc b/src/relay/pass/quantize.cc index 497f4a20dcd4..452744bec8b3 100644 --- a/src/relay/pass/quantize.cc +++ b/src/relay/pass/quantize.cc @@ -231,7 +231,7 @@ Expr QuantizeRealize(const Call& ref_call, return QRealizeIntExprNode::make(round_data, dom_scale, Float(32)); } -RELAY_REGISTER_OP("simulated_quantize") +RELAY_REGISTER_OP("relay.op.annotation.simulated_quantize") .set_attr("FQRealizeRewrite", QuantizeRealize); @@ -350,7 +350,6 @@ Array UnifyDTypeScale(const Array& args, Expr dom_scale = MakeConstantScalar(Float(32), s); for (size_t i = 0; i < ret.size(); ++i) { float cur_s = GetScalarFromConstant(nptrs[i]->dom_scale); - LOG(INFO) << "unify data scale from " << cur_s << " to " << s; ret.Set(i, MulAndDiv(ret[i], cur_s, s)); } @@ -504,7 +503,7 @@ void QConfig::ExitQConfigScope() { entry->context_stack.pop(); } -QConfig QConfig::Current() { +QConfig& QConfig::Current() { TVMQConfigThreadLocalEntry *entry = TVMQConfigThreadLocalStore::Get(); if (entry->context_stack.size() > 0) { return entry->context_stack.top(); diff --git a/src/relay/pass/quantize.h b/src/relay/pass/quantize.h index ef44bf3718eb..b1a15308d914 100644 --- a/src/relay/pass/quantize.h +++ b/src/relay/pass/quantize.h @@ -162,7 +162,7 @@ class QConfig : public NodeRef { * configuration if a BuildConfig scope has not been entered. * \return The configuration that is the current context. */ - static QConfig Current(); + static QConfig& Current(); using ContainerType = QConfigNode; };