Fix the Qwen GQA test failure.#4385
Conversation
zewenli98
left a comment
There was a problem hiding this comment.
@SandSnip3r The idea looks good! The decomposed attention path needs the entire computation in FP32, not just matmul.
My only concern is that the definition of use_fp32_acc currently suggests FP32 applies only to matmul, whereas this implementation extends it to the whole attention path. It may help to clarify that in the definition, for example by noting that [op1, op2, ...] will use FP32 for the full computation rather than matmul alone for accuracy.
Yeah, I understand that. I don't necessarily love my overloading of the fp32 accumulation flag for this exact reason. I have a comment inside Are you proposing something different? Possibly commenting about the option's behavior with regard to sdpa in |
Yeah it's very clear for developers to see your comments inside |
The Qwen GQA test failed in the decomposed variant due to the intemediate between the matmuls being downcast to fp16. Plumb use_fp32_acc through the dynamo backend. Pick a specific seed for the GQA test. Reenable GQA test for fp16.
4a87f7f to
2c1e2e2
Compare
|
Ok, I've gone through and added comments about attention, on the fp32_acc flag, when decompose_attention is also set |
Description
Fix the Qwen GQA test failure.
The Qwen GQA test failed in the decomposed variant due to the intemediate between the matmuls being downcast to fp16. Plumb use_fp32_acc through the dynamo backend.
Pick a specific seed for the GQA test.
Reenable GQA test for fp16.
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: