已合并
[inductor] add fx_pass embedding_indice_i64_to_i32_pass #29405
jimmycao9929创建于 1月11日
[inductor] add fx_pass embedding_indice_i64_to_i32_pass #29405
已合并
jimmycao9929创建于 1月11日
jimmycao9929
1月11日

What type of PR is this?
kind feature

What does this PR do / why do we need it:
add a fx_pass 'embedding_indice_i64_to_i32_pass' to speedup the performance of 'embedding'-related op. This pass will add _node_dtype_cast node to cast one of embedding inputs (indices) whose dtype from torch.int64 to torch.int32.

The pass can speed the following cases:

...
self.emb_table(input_ids)

or

torch.nn.functional.embedding(input_ids, self.emb_table.weight)

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewers:
For the UT case, after embedding_indice_i64_to_i32_pass is enabled, the performance can be improved 25.7%

likedislike
Pull Request已成功合入, 合并人@ascend-robot
(感谢 jimmycao9929 的贡献)
Jjimmycao9929
1月11日 创建了 pull request,commit 5c27101a
ascend-robot
ascend-robot成员
1月11日 评论:

Thank your for your pull-request.

The full list of commands accepted by me can be found at here.

You can get sig-info at here

likedislike
ascend-robot
ascend-robot成员
1月11日 评论:

以下是根据您提交的修改文件推荐的Reviewer和Committer序列,需各模块评审通过后方可合入

Module List Reviewers Committers
repo-Ascend/pytorch dilililiwhy, chuboning, wangchao285, medivh-x, liangsongwei wasd1111222, wangqiang160, zichun_ye, weizhan4, wangchao430
likedislike
ascend-robotascend-robot成员
1月11日 添加了label:stat/needs-squash
此处折叠了100条消息 查看更多
Sshi-yufeng99
1月14日 解决了最后一个问题
rain-666
rain-666成员
1月14日 评论:

/lgtm
/approve

likedislike
ascend-robotascend-robot成员
1月14日 添加了label:approved
ascend-robot
ascend-robot成员
1月14日 评论:

Review Guide

This Pull-Request Passes Review.
Committers who wrote a comment of /approve are: rain-666, weizhan4.
Reviewers who wrote a comment of /lgtm are: weizhan4, rain-666.

likedislike
ascend-robotascend-robot成员
1月14日 合入了pull request