-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[MLIR][AMDGPU] Add OCP FP8 support for new hardware #106160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0272474
1848df4
1b790e3
de5a263
a62c37c
fd0f519
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,7 +509,8 @@ bool TosaValidation::isValidElementType(Type type) { | |
if (isa<FloatType>(type)) { | ||
if (profile == TosaProfileEnum::BaseInference) | ||
return false; | ||
return type.isF32() || type.isF16() || type.isBF16(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The TOSA spec only supports the OCP versions of the FP8 formats, and this pass is verifying adherence to the spec, so we should only add the Float8E4M3FNType and Float8E5M2Type in this location. |
||
return isa<Float32Type, Float16Type, BFloat16Type, Float8E4M3FNUZType, | ||
Float8E5M2FNUZType, Float8E4M3FNType, Float8E5M2Type>(type); | ||
} | ||
if (auto intTy = dyn_cast<IntegerType>(type)) { | ||
if (intTy.isUnsigned()) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,15 @@ bool Type::isF64() const { return llvm::isa<Float64Type>(*this); } | |
bool Type::isF80() const { return llvm::isa<Float80Type>(*this); } | ||
bool Type::isF128() const { return llvm::isa<Float128Type>(*this); } | ||
|
||
bool Type::isFloat() const { return llvm::isa<FloatType>(*this); } | ||
|
||
/// Return true if this is an integer type with the specified width. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo integer should be float? |
||
bool Type::isFloat(unsigned width) const { | ||
if (auto fltTy = llvm::dyn_cast<FloatType>(*this)) | ||
return fltTy.getWidth() == width; | ||
return false; | ||
} | ||
|
||
bool Type::isIndex() const { return llvm::isa<IndexType>(*this); } | ||
|
||
bool Type::isInteger() const { return llvm::isa<IntegerType>(*this); } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!