Skip to content

[KMCompiler][Ascend] ascend masked_scatter_backward - #6008

Open
YangLong114514 wants to merge 2 commits into
flagos-ai:masterfrom
YangLong114514:ascend-masked_scatter_backward
Open

[KMCompiler][Ascend] ascend masked_scatter_backward#6008
YangLong114514 wants to merge 2 commits into
flagos-ai:masterfrom
YangLong114514:ascend-masked_scatter_backward

Conversation

@YangLong114514

Copy link
Copy Markdown
Contributor

PR Category

Operator

Type of Change

Performance Optimization

Description

add operator masked_scatter_backward for ascend backend.

Performance

test_masked_scatter_backward.py
Operator: masked_scatter_backward  Performance Test (dtype=torch.float16, mode=operator,level=comprehensive)
Status       Torch Latency (ms)    Gems Latency (ms)         Gems Speedup          Torch GBPS            Gems GBPS           Size Detail
-----------------------------------------------------------------------------------------------------------------------------------------
SUCCESS               0.186865            0.222445               0.840               0.110               0.092          [torch.Size([64, 64]), torch.Size([64, 64]), [64, 64]]
SUCCESS               0.191116            0.213633               0.895               1.715               1.534          [torch.Size([256, 256]), torch.Size([256, 256]), [256, 256]]
SUCCESS               0.230341            0.404634               0.569              22.761              12.957          [torch.Size([1024, 1024]), torch.Size([1024, 1024]), [1024, 1024]]
SUCCESS               0.299732            2.089534               0.143             279.871              40.146          [torch.Size([4096, 4096]), torch.Size([4096, 4096]), [4096, 4096]]
SUCCESS               0.834866            8.304328               0.101             401.914              40.406          [torch.Size([1024, 65536]), torch.Size([1024, 65536]), [1024, 65536]]
SUCCESS               0.207613            0.373913               0.555              61.653              34.233          [torch.Size([10000, 256]), torch.Size([10000, 256]), [10000, 256]]
SUCCESS               6.694811           80.605745               0.083             489.454              40.652          [torch.Size([10000, 65536]), torch.Size([10000, 65536]), [10000, 65536]]
SUCCESS               0.214244            0.150338               1.425               0.007               0.010          [torch.Size([17, 17]), torch.Size([17, 17]), [17, 17]]
SUCCESS               0.238289            0.150170               1.587               0.086               0.136          [torch.Size([32, 128]), torch.Size([32, 128]), [32, 128]]
SUCCESS               0.208093            0.151333               1.375               0.197               0.271          [torch.Size([128, 64]), torch.Size([128, 64]), [128, 64]]
SUCCESS               0.192496            0.150580               1.278               0.426               0.544          [torch.Size([256, 64]), torch.Size([256, 64]), [256, 64]]
SUCCESS               0.221345            0.419613               0.527              47.373              24.989          [torch.Size([1024, 2048]), torch.Size([1024, 2048]), [1024, 2048]]


Operator: masked_scatter_backward  Performance Test (dtype=torch.float32, mode=operator,level=comprehensive)
Status       Torch Latency (ms)    Gems Latency (ms)         Gems Speedup          Torch GBPS            Gems GBPS           Size Detail
-----------------------------------------------------------------------------------------------------------------------------------------
SUCCESS               0.190768            0.148341               1.286               0.193               0.249          [torch.Size([64, 64]), torch.Size([64, 64]), [64, 64]]
SUCCESS               0.290923            0.213058               1.365               2.027               2.768          [torch.Size([256, 256]), torch.Size([256, 256]), [256, 256]]
SUCCESS               0.257021            0.437299               0.588              36.718              21.581          [torch.Size([1024, 1024]), torch.Size([1024, 1024]), [1024, 1024]]
SUCCESS               0.432519            2.230018               0.194             349.106              67.710          [torch.Size([4096, 4096]), torch.Size([4096, 4096]), [4096, 4096]]
SUCCESS               1.420952            8.811322               0.161             425.053              68.546          [torch.Size([1024, 65536]), torch.Size([1024, 65536]), [1024, 65536]]
SUCCESS               0.221188            0.406568               0.544             104.165              56.670          [torch.Size([10000, 256]), torch.Size([10000, 256]), [10000, 256]]
SUCCESS              12.251547           85.894108               0.143             481.428              68.669          [torch.Size([10000, 65536]), torch.Size([10000, 65536]), [10000, 65536]]
SUCCESS               0.180288            0.144298               1.249               0.014               0.018          [torch.Size([17, 17]), torch.Size([17, 17]), [17, 17]]
SUCCESS               0.186995            0.151316               1.236               0.197               0.244          [torch.Size([32, 128]), torch.Size([32, 128]), [32, 128]]
SUCCESS               0.221251            0.153422               1.442               0.333               0.481          [torch.Size([128, 64]), torch.Size([128, 64]), [128, 64]]
SUCCESS               0.227187            0.156054               1.456               0.649               0.945          [torch.Size([256, 64]), torch.Size([256, 64]), [256, 64]]
SUCCESS               0.241353            0.420698               0.574              78.202              44.864          [torch.Size([1024, 2048]), torch.Size([1024, 2048]), [1024, 2048]]


Operator: masked_scatter_backward  Performance Test (dtype=torch.bfloat16, mode=operator,level=comprehensive)
Status       Torch Latency (ms)    Gems Latency (ms)         Gems Speedup          Torch GBPS            Gems GBPS           Size Detail
-----------------------------------------------------------------------------------------------------------------------------------------
SUCCESS               0.195788            0.151861               1.289               0.105               0.135          [torch.Size([64, 64]), torch.Size([64, 64]), [64, 64]]
SUCCESS               0.203880            0.215265               0.947               1.607               1.522          [torch.Size([256, 256]), torch.Size([256, 256]), [256, 256]]
SUCCESS               0.228684            0.413876               0.553              22.926              12.668          [torch.Size([1024, 1024]), torch.Size([1024, 1024]), [1024, 1024]]
SUCCESS               0.304732            2.085660               0.146             275.278              40.220          [torch.Size([4096, 4096]), torch.Size([4096, 4096]), [4096, 4096]]
SUCCESS               0.852247            8.287827               0.103             393.717              40.486          [torch.Size([1024, 65536]), torch.Size([1024, 65536]), [1024, 65536]]
SUCCESS               0.223813            0.417465               0.536              57.191              30.661          [torch.Size([10000, 256]), torch.Size([10000, 256]), [10000, 256]]
SUCCESS               6.575993           80.737352               0.081             498.297              40.586          [torch.Size([10000, 65536]), torch.Size([10000, 65536]), [10000, 65536]]
SUCCESS               0.181642            0.145472               1.249               0.008               0.010          [torch.Size([17, 17]), torch.Size([17, 17]), [17, 17]]
SUCCESS               0.199590            0.145099               1.376               0.103               0.141          [torch.Size([32, 128]), torch.Size([32, 128]), [32, 128]]
SUCCESS               0.204784            0.145400               1.408               0.200               0.282          [torch.Size([128, 64]), torch.Size([128, 64]), [128, 64]]
SUCCESS               0.189378            0.147345               1.285               0.433               0.556          [torch.Size([256, 64]), torch.Size([256, 64]), [256, 64]]
SUCCESS               0.214521            0.409541               0.524              48.880              25.604          [torch.Size([1024, 2048]), torch.Size([1024, 2048]), [1024, 2048]]

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.

2 participants