Skip to content

Commit

Permalink
Remove quantize_op from qconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
vinx13 committed Apr 25, 2019
1 parent c50a375 commit 7f7dbdf
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 11 deletions.
4 changes: 0 additions & 4 deletions python/tvm/relay/quantize/_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ def conv2d_rewrite(ref_call, new_args, ctx):
"""Rewrite function for conv2d. Lhs of conv will be quantized to
input field, and rhs of conv will be quantized to weight field.
Output would be in activation field"""
if ref_call.op not in current_qconfig().quantize_op:
return None
cnt = _conv_counter()
if cnt < current_qconfig().skip_k_conv:
_set_conv_counter(cnt + 1)
Expand All @@ -177,8 +175,6 @@ def conv2d_rewrite(ref_call, new_args, ctx):
def dense_rewrite(ref_call, new_args, ctx):
"""Rewrite function for dense. Lhs of dense will be quantized to input field, and rhs of
dense will be quantized to weight field. Output would be in activation field."""
if ref_call.op not in current_qconfig().quantize_op:
return None
cnt = _conv_counter()
if cnt < current_qconfig().skip_k_conv:
return None
Expand Down
4 changes: 0 additions & 4 deletions python/tvm/relay/quantize/quantize.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class QConfig(NodeBase):
"store_lowbit_output": True,
"debug_enabled_ops": None,
"use_stop_fusion": True,
"quantize_op": [_op.get("nn.conv2d"), _op.get("nn.dense")]
}

# pylint: disable=no-member
Expand Down Expand Up @@ -151,9 +150,6 @@ def qconfig(**kwargs):
Whether add stop_fusion when casting to dtype_activation. stop_fusion forces lowbit
results to be stored in memory.
quantize_op: list/tuple of relay.Op
Operators to quantize.
Returns
-------
config: QConfig
Expand Down
1 change: 0 additions & 1 deletion src/relay/pass/quantize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
p->stream << "store_lowbit_output==" << op->store_lowbit_output << ", ";
p->stream << "debug_enabled_ops==" << op->debug_enabled_ops << ", ";
p->stream << "use_stop_fusion==" << op->use_stop_fusion << ", ";
p->stream << "quantize_op==" << op->quantize_op;
p->stream << ")";
});

Expand Down
2 changes: 0 additions & 2 deletions src/relay/pass/quantize.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ class QConfigNode : public Node {
bool store_lowbit_output = true;
Array<Expr> debug_enabled_ops = Array<Expr>(NodePtr<Node>(nullptr));
bool use_stop_fusion = true;
Array<Op> quantize_op = NullValue<Array<Op>>();

void VisitAttrs(AttrVisitor* v) final {
v->Visit("nbit_input", &nbit_input);
Expand All @@ -145,7 +144,6 @@ class QConfigNode : public Node {
v->Visit("store_lowbit_output", &store_lowbit_output);
v->Visit("debug_enabled_ops", &debug_enabled_ops);
v->Visit("use_stop_fusion", &use_stop_fusion);
v->Visit("quantize_op", &quantize_op);
}

static constexpr const char* _type_key = "relay.quantize.QConfig";
Expand Down

0 comments on commit 7f7dbdf

Please sign in to comment.