Skip to content
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

Add MIOPEN_BETA_API defines around f8 #2430

Merged
merged 21 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ include(ROCMCreatePackage)
include(CheckCXXCompilerFlag)
include(ROCMHeaderWrapper)

# Build librarie with beta apis
cderb marked this conversation as resolved.
Show resolved Hide resolved
add_definitions("-DMIOPEN_BETA_API_FP8=1")

set(MIOPEN_ENABLE_AI_IMMED_MODE_FALLBACK On CACHE BOOL "Enable AI-based fallback for Immediate Mode")
set(MIOPEN_ENABLE_AI_KERNEL_TUNING On CACHE BOOL "Enable AI heuristic for kernel tuning")
set(MIOPEN_ENABLE_SQLITE On CACHE BOOL "")
Expand Down
2 changes: 1 addition & 1 deletion fin
Submodule fin updated from b2f3f4 to d5044d
17 changes: 15 additions & 2 deletions include/miopen/miopen.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ typedef enum
miopenStatusVersionMismatch = 10, /*!< Version mismatch of the supplied binary data argment. */
} miopenStatus_t;

#ifdef MIOPEN_BETA_API_FP8
cderb marked this conversation as resolved.
Show resolved Hide resolved
typedef enum
{
miopenF8RoundingModeStandard = 0,
miopenF8RoundingModeStochastic = 1,
} miopenF8RoundingMode_t;
#endif

/*! @brief Get character string for an error code.
*
Expand Down Expand Up @@ -354,9 +356,14 @@ typedef enum
4, /*!< Pack of four 8-bit int points in NCHW_VECT_C format (Partially supported) */
miopenBFloat16 = 5, /*!< 16-bit binary floating point (8-bit exponent, 7-bit fraction)
(Partially supported) */
miopenDouble = 6, /*!< 64-bit floating point (Partially supported) */
miopenDouble = 6, /*!< 64-bit floating point (Partially supported) */
#ifdef MIOPEN_BETA_API_FP8
miopenFloat8 = 7,
miopenBFloat8 = 8
miopenBFloat8 = 8,
#else
cderb marked this conversation as resolved.
Show resolved Hide resolved
// miopenReserved1 = 7,
// miopenReserved2 = 8,
#endif
cderb marked this conversation as resolved.
Show resolved Hide resolved
} miopenDataType_t;

/*! @ingroup tensor
Expand Down Expand Up @@ -601,11 +608,15 @@ typedef enum
MIOPEN_CONVOLUTION_ATTRIB_DETERMINISTIC =
1, /*!< Restrict MIOpen convolutions to kernels which produce numerically deterministic
results. 0 - disabled (default), 1 - enabled >*/
#ifdef MIOPEN_BETA_API_FP8
MIOPEN_CONVOLUTION_ATTRIB_FP8_ROUNDING_MODE =
2, /*!<Specifies the rounding mode for the 8-bit floating data types. Currently, two
rounding modes are supported miopenF8RoundingModeStandard and
miopenF8RoundingModeStochastic. These are listed as part of the miopenF8RoundingMode_t
enum.>*/
#else
// miopenReserved1 = 2,
#endif
} miopenConvolutionAttrib_t;

/** @addtogroup tensor
Expand Down Expand Up @@ -723,6 +734,7 @@ MIOPEN_EXPORT miopenStatus_t miopenSetTensorDescriptor(miopenTensorDescriptor_t
const int* dimsA,
const int* stridesA);

#ifdef MIOPEN_BETA_API_FP8
/*! @brief Set the tensor cast type
*
* For tensors where the cast_type attribute is set, the tensor elements would be converted to the
Expand All @@ -734,6 +746,7 @@ MIOPEN_EXPORT miopenStatus_t miopenSetTensorDescriptor(miopenTensorDescriptor_t
*/
MIOPEN_EXPORT miopenStatus_t miopenSetTensorCastType(miopenTensorDescriptor_t tensorDesc,
miopenDataType_t cast_type);
#endif

/*! @brief Set shape of N-dimensional tensor
*
Expand Down