Skip to content

Commit

Permalink
to #24765941 set opt_level=2 disable foldaxis pass
Browse files Browse the repository at this point in the history
  • Loading branch information
yunjing.lh committed Mar 16, 2020
1 parent 709e032 commit adfdd30
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/ir/transform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,6 @@ IRModule SequentialNode::operator()(const IRModule& module,
for (const Pass& pass : passes) {
CHECK(pass.defined()) << "Found undefined pass for optimization.";
const PassInfo& pass_info = pass->Info();
LOG(INFO) << "Executing module pass : "
<< pass_info->name
<< " with opt level: "
<< pass_info->opt_level;
if (!PassEnabled(pass_info)) continue;
// resolve dependencies
for (const auto& it : pass_info->required) {
Expand Down
3 changes: 0 additions & 3 deletions src/relay/qnn/op/add.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ Expr QnnAddCanonicalize(const Attrs& attrs, const Array<Expr>& new_args,
auto itmd_zero_point = MakeConstantScalar<int>(
DataType::Int(32), 0);

printf("tvm lhs_scale: %f rhs_scale: %f out_scale: %f twice_max_iscale: %f\n",
real_lhs_scale_val, real_rhs_scale_val, real_out_scale_val, twice_max_input_scale);

auto requantized_lhs = Requantize(lhs, input_shape,
real_lhs_scale, lhs_zero_point,
itmd_out_scale, itmd_zero_point,
Expand Down
6 changes: 3 additions & 3 deletions tests/python/frontend/tflite/test_forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def get_real_image(im_height, im_width):
return data

def run_tvm_graph(tflite_model_buf, input_data, input_node, num_output=1, target='llvm',
out_names=None):
out_names=None, opt_level=3):
""" Generic function to compile on relay and execute on tvm """
try:
import tflite.Model
Expand All @@ -92,7 +92,7 @@ def run_tvm_graph(tflite_model_buf, input_data, input_node, num_output=1, target
mod, params = relay.frontend.from_tflite(tflite_model,
shape_dict=shape_dict,
dtype_dict=dtype_dict)
with relay.build_config(opt_level=3):
with relay.build_config(opt_level=opt_level):
graph, lib, params = relay.build(mod, target, params=params)

ctx = tvm.context(target, 0)
Expand Down Expand Up @@ -1660,7 +1660,7 @@ def test_forward_qnn_mobilenet_v2_net():

tflite_output = run_tflite_graph(tflite_model_buf, data)
tflite_predictions = np.squeeze(tflite_output)
tvm_output = run_tvm_graph(tflite_model_buf, data, 'input')
tvm_output = run_tvm_graph(tflite_model_buf, data, 'input', opt_level=2)
tvm_predictions = np.squeeze(tvm_output)
tvm.testing.assert_allclose(tvm_predictions, tflite_predictions,
rtol=0, atol=0)
Expand Down

0 comments on commit adfdd30

Please sign in to comment.