Skip to content

[AIROCMLIR-62] Add verification support for attention#2235

Open
mirza-halilcevic wants to merge 2 commits intodevelopfrom
attention-verifier
Open

[AIROCMLIR-62] Add verification support for attention#2235
mirza-halilcevic wants to merge 2 commits intodevelopfrom
attention-verifier

Conversation

@mirza-halilcevic
Copy link
Contributor

Motivation

Verifier for attention was missing causing gpu verification to fail.

Technical Details

Implement verification code path for attention kernels.

Test Plan

Test Result

Submission Checklist

Comment on lines +4831 to +4836
if (!((heuristicValidation || hasAccel) &&
genParams.types[0].isInteger(8))) {
SmallVector<Type, 5> newTypes;
for (Type t : genParams.types)
newTypes.push_back(isa<IntegerType>(t) ? t : b.getF32Type());
newParams.types = newTypes;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it will use FP32 for the attention ? It may not work on Navis

Comment on lines +4828 to +4829
if (heuristicValidation || hasAccel)
newParams.perfConfig = "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes heuristic perf config verifies correctly. Is it guranteed ?

} else if (genParams.operation == rock::KernelType::Attention) {
// attention GPU validation
// Attention has no non-accel path, so keep accel features and just
// use the heuristic perf config as the reference.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we sure we even want to do this? for gemms at least it's a partially different code path. Here, if there are bugs common to different perfConfigs, it will still pass.

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