Skip to content

[Bugfix][TIR] Narrow-Datatype for thread axis#11725

Merged
zxybazh merged 1 commit intoapache:mainfrom
junrushao:bugfix/2022-06-14/tir-narrow-dtype-mismatch
Jun 15, 2022
Merged

[Bugfix][TIR] Narrow-Datatype for thread axis#11725
zxybazh merged 1 commit intoapache:mainfrom
junrushao:bugfix/2022-06-14/tir-narrow-dtype-mismatch

Conversation

@junrushao
Copy link
Member

This PR fixes a bug in the pass Narrow-Datatype in TIR, where dtype of
certain IterVar and loop variables are adjusted to narrower ones.

The bug occurs when the dtype of thread axis is int32, while its extent
is int64, where the original behavior will not narrow the extent to
int32, which causes an assertion thrown in IterVar's constructor. An
alternative approach is to re-dtype IterVar to int64, however, the
subsequent passes do not actually respect int64 thread axes, which leads
to even more issues in lowering.

This bug prevents AutoTIR in tuning Huggingface DistilBERT.

This PR fixes a bug in the pass Narrow-Datatype in TIR, where dtype of
certain IterVar and loop variables are adjusted to narrower ones.

The bug occurs when the dtype of thread axis is int32, while its extent
is int64, where the original behavior will not narrow the extent to
int32, which causes an assertion thrown in IterVar's constructor. An
alternative approach is to re-dtype IterVar to int64, however, the
subsequent passes do not actually respect int64 thread axes, which leads
to even more issues in lowering.

This bug prevents AutoTIR in tuning Huggingface DistilBERT.
@junrushao junrushao marked this pull request as ready for review June 15, 2022 05:03
@zxybazh zxybazh merged commit 954a927 into apache:main Jun 15, 2022
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