Skip to content

[Relay] support i64 indices#6143

Merged
tqchen merged 21 commits into
apache:masterfrom
hzfan:i64_pr
Sep 1, 2020
Merged

[Relay] support i64 indices#6143
tqchen merged 21 commits into
apache:masterfrom
hzfan:i64_pr

Conversation

@hzfan

@hzfan hzfan commented Jul 27, 2020

Copy link
Copy Markdown
Contributor

@tqchen

tqchen commented Aug 4, 2020

Copy link
Copy Markdown
Member

@hzfan is this PR ready for review? cc @yzhliu please followup

@hzfan hzfan marked this pull request as ready for review August 5, 2020 02:20
@hzfan

hzfan commented Aug 6, 2020

Copy link
Copy Markdown
Contributor Author

@yzhliu @tqchen It's ready for review.

I'm not sure if this pr introduces perf. regression (because some models may contain i64 indexing, and not all i64 can be narrowed).

Do we need a compilation flag like TVM_USE_I64 (defaults to ON) to roll back if regression is detected by users? We can get it removed if no regression is reported for quite some time.

const int64_t* pval = tir::as_const_int(val);
if (pval != nullptr) {
#ifdef TVM_USE_I64  // new behavior introduced by this pr
  res.push_back(val);
#else  // original behavior
  CHECK_LE(pval[0], std::numeric_limits<int32_t>::max());
  CHECK_GE(pval[0], std::numeric_limits<int32_t>::min());
  res.push_back(IntImm(DataType::Int(32), *pval));
#endif
}

@tqchen

tqchen commented Aug 9, 2020

Copy link
Copy Markdown
Member

Let us confirm the major networks and also notify the parties. We could have an option TVM_INDEX_DEFAULT_I64 and keep that option for a bit.

cc @jwfromm @kevinthesun @mbaret @merrymercy @FrozenGene

@jwfromm jwfromm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, excited for i64 support to finally make it in!

@tqchen tqchen merged commit 4fc320a into apache:master Sep 1, 2020
@tqchen

tqchen commented Sep 1, 2020

Copy link
Copy Markdown
Member

Thanks @hzfan @yzhliu @jwfromm !

kevinthesun pushed a commit to kevinthesun/tvm that referenced this pull request Sep 17, 2020
kevinthesun pushed a commit to kevinthesun/tvm that referenced this pull request Sep 18, 2020
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 18, 2020
@trevor-m

trevor-m commented Oct 15, 2020

Copy link
Copy Markdown
Contributor

@hzfan FYI, I found that Keras MobileNetV2 model experiences a heavy perf regression with i64 indices enabled.
With ON: 66.55801918395055 FPS
With OFF: 435.48951121558594 FPS

This is on an AWS m5.12xlarge instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants