CUDA: Follow up of #25635, refactoring FA shared smem swizzle - #28536
CUDA: Follow up of #25635, refactoring FA shared smem swizzle#28536ynankani wants to merge 1 commit into
Conversation
Signed-off-by: ynankani <ynankani@nvidia.com>
|
I was trying to repro the numbers posted on the comment #25635 (comment) to gate regressing configs. I observed below, just to confirm you were running with https://huggingface.co/unsloth/Llama-3.1-8B-Instruct-GGUF/tree/main? I see net gain in prefill for llama3.1-8b-instruct Performance
|
|
Ill re-check the numbers. The RTX 3090 is in a server that I'm sharing with other devs so feasibly there may have been interference and I didn't notice. |
|
I re-ran the benchmarks and the numbers I get match yours within 1%. Notably the numbers that I posted in the previous thread were worse than my current ones. So presumably my numbers indicating a regression were simply wrong. Since there seems to be no case where swizzling hurts performance if it can be used I would say to keep the logic equivalent to what we have on master: a function to check whether swizzling can be used but no explicit value in the configs. |
Thank you for the re-run. Actually I was also re-running microbenchmark perf test for the enabled swizzle configs and observed regression on some configs. I also checked ncu traces for one the config and saw higher bank-conflicts with swizzle on vs off. So maybe we need more granular control per config or need to handle tilling in some way for these. One approach can be just disable swizzle for configs which are regressing. I am not yet able to find the pattern why these configs regress. Any suggestions? Performance4-reps
|
|
For context, do you mean you are seeing more bank conflicts with the version in this PR? |
I meant swizzling has more bank conflicts compared to padding for few configs which are reported in previous comment rest configs swizzling is better compared to padding. It is inherent to swizzling not related to refactoring. I mean for these configs padding has lesser bank conflicts compared to both swizzling implementation (merged PR and refactor PR). |
Overview
This is follow-up of #25635, refactor FA shared smem swizzle.
This is WIP, I am working on isolating on different hardware to find which cases swizzle helps best on granular level.
For starters I have disabled swizzling for MHA
Any design related suggestion or review are welcome.
Additional information
Requirements