Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Tensor core type issue for dense #7187

Merged
merged 3 commits into from
Jan 2, 2021
Merged

[Fix] Tensor core type issue for dense #7187

merged 3 commits into from
Jan 2, 2021

Conversation

Laurawly
Copy link
Contributor

As mentioned in PR #7146, previous tensor core code lacks type check and this PR is trying to fix that.
cc @jcf94 @merrymercy @Meteorix

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

LGTM

@merrymercy
Copy link
Member

Do we allow data.dtype == "float32"?
The problem comes from this downcast, which may cause accuracy problem.

data_16 = te.compute((batch, in_dim), lambda b, i: data[b, i].astype("float16"))
weight_16 = te.compute((out_dim, in_dim), lambda o, i: weight[o, i].astype("float16"))

@Laurawly
Copy link
Contributor Author

Do we allow data.dtype == "float32"?
The problem comes from this downcast, which may cause accuracy problem.

data_16 = te.compute((batch, in_dim), lambda b, i: data[b, i].astype("float16"))
weight_16 = te.compute((out_dim, in_dim), lambda o, i: weight[o, i].astype("float16"))

Good catch, just removed it.

@junrushao junrushao merged commit 6258fae into apache:main Jan 2, 2021
tkonolige pushed a commit to tkonolige/incubator-tvm that referenced this pull request Jan 11, 2021
* fix tc type issue for dense

* fix lint

* rm float 32

Co-authored-by: Leyuan Wang <ziyu.guo@bytedance.com>
TusharKanekiDey pushed a commit to TusharKanekiDey/tvm that referenced this pull request Jan 20, 2021
* fix tc type issue for dense

* fix lint

* rm float 32

Co-authored-by: Leyuan Wang <ziyu.guo@bytedance.com>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jan 21, 2021
* fix tc type issue for dense

* fix lint

* rm float 32

Co-authored-by: Leyuan Wang <ziyu.guo@bytedance.com>
electriclilies pushed a commit to electriclilies/tvm that referenced this pull request Feb 18, 2021
* fix tc type issue for dense

* fix lint

* rm float 32

Co-authored-by: Leyuan Wang <ziyu.guo@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants