Skip to content

Commit f920405

Browse files
authored
Finally remove INT8x4 support. (#2452)
1 parent cdaf94a commit f920405

37 files changed

+28
-92
lines changed

docs/datatypes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ typedef enum {
1212
miopenInt8 = 3,
1313
/* Value 4 is reserved. */
1414
miopenBFloat16 = 5,
15+
miopenDouble = 6,
16+
miopenFloat8 = 7,
17+
miopenBFloat8 = 8
1518
} miopenDataType_t;
1619
```
1720

@@ -23,6 +26,9 @@ Type descriptions:
2326
* `miopenInt32` - 32-bit integer, used primarily for `int8` convolution outputs
2427
* `miopenInt8` - 8-bit integer, currently only supported by `int8` convolution forward path, tensor set, tensor copy, tensor cast, tensor transform, tensor transpose, and im2col.
2528
* `miopenBFloat16` - brain float fp-16 (8-bit exponent, 7-bit fraction), currently only supported by convolutions, tensor set, and tensor copy.
29+
* `miopenDouble` - 64-bit floating point, supported only by reduction, layerNorm, batchNorm.
30+
* `miopenFloat8` - 8-bit floating point (layout 1.4.3, exponent bias 7), currently only supported by convolutions.
31+
* `miopenBFloat8` - 8-bit floating point (layout 1.5.2, exponent bias 15), currently only supported by convolutions.
2632

2733

2834
Note: In addition to the standard datatypes above, pooling contains its own indexing datatypes:

driver/conv_driver.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ MIOPEN_DECLARE_ENV_VAR(MIOPEN_DRIVER_PAD_BUFFERS_2M)
8383
MIOPEN_DECLARE_ENV_VAR(MIOPEN_DRIVER_USE_GPU_REFERENCE)
8484
MIOPEN_DECLARE_ENV_VAR(MIOPEN_DRIVER_SUBNORM_PERCENTAGE)
8585

86+
// Support in the library discontinued, but left in the driver
87+
// for reference in the future.
88+
#define miopenInt8x4 (static_cast<miopenDataType_t>(4))
89+
8690
#if MIOPEN_BACKEND_OPENCL
8791
#define STATUS_SUCCESS CL_SUCCESS
8892
typedef cl_int status_t;

fin

Submodule fin updated from afc1a8d to e0122cb

include/miopen/miopen.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,11 @@ MIOPEN_DECLARE_OBJECT(miopenReduceTensorDescriptor);
348348
*/
349349
typedef enum
350350
{
351-
miopenHalf = 0, /*!< 16-bit floating point (Fully supported) */
352-
miopenFloat = 1, /*!< 32-bit floating point (Fully supported) */
353-
miopenInt32 = 2, /*!< 32-bit int point (Partially supported) */
354-
miopenInt8 = 3, /*!< 8-bit int point (Partially supported) */
355-
miopenInt8x4 = 4, /*!< Pack of four Int8 in NCHW_VECT_C format (Support discontinued) */
351+
miopenHalf = 0, /*!< 16-bit floating point (Fully supported) */
352+
miopenFloat = 1, /*!< 32-bit floating point (Fully supported) */
353+
miopenInt32 = 2, /*!< 32-bit integer (Partially supported) */
354+
miopenInt8 = 3, /*!< 8-bit integer (Partially supported) */
355+
// miopenInt8x4 = 4, /*!< Pack of 4x Int8 in NCHW_VECT_C format (Support discontinued) */
356356
miopenBFloat16 = 5, /*!< 16-bit binary floating point (8-bit exponent, 7-bit fraction)
357357
(Partially supported) */
358358
miopenDouble = 6, /*!< 64-bit floating point (Partially supported) */

src/check_numerics.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ std::string GetKernelName(miopenDataType_t data_type)
6464
case miopenBFloat8: return {"check_numerics_bf8"};
6565
case miopenInt32:
6666
case miopenInt8:
67-
case miopenInt8x4: // Support discontinued.
6867
case miopenDouble:
6968
default: return {""};
7069
}

src/driver_arguments.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void ConvDataType(std::stringstream& ss, const miopen::TensorDescriptor& desc)
5050
{
5151
ss << "convbfp16";
5252
}
53-
else if(desc.GetType() == miopenInt8 || desc.GetType() == miopenInt8x4)
53+
else if(desc.GetType() == miopenInt8)
5454
{
5555
ss << "convint8";
5656
}
@@ -190,8 +190,6 @@ std::string ConvArgsForMIOpenDriver(const miopen::TensorDescriptor& xDesc,
190190
ss << " -g " << convDesc.group_count;
191191
if(print_for_conv_driver)
192192
ss << " -F " << std::to_string(static_cast<int>(conv_dir)) << " -t 1"; // clang-format on
193-
if(xDesc.GetType() == miopenInt8x4)
194-
ss << " -Z 1";
195193
if(immediate_mode_solver_id.has_value())
196194
{
197195
ss << " -S " << *immediate_mode_solver_id;

src/gemm_v2.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,9 @@ miopenStatus_t CallGemm(const Handle& handle,
612612
};
613613
break;
614614

615-
case miopenInt8x4:
616615
case miopenDouble: {
617-
MIOPEN_THROW(miopenStatusBadParm, "Unknown or unsupported data type.");
616+
MIOPEN_THROW(miopenStatusBadParm,
617+
"miopenDouble data type not supported by MIOpenGEMM.");
618618
};
619619
break;
620620
}
@@ -879,10 +879,10 @@ miopenStatus_t CallGemmStridedBatched(const Handle& handle,
879879
break;
880880
}
881881

882-
case miopenInt8x4:
883882
case miopenDouble: {
884-
MIOPEN_THROW(miopenStatusBadParm, "Unknown or unsupported data type.");
885-
};
883+
MIOPEN_THROW(miopenStatusBadParm,
884+
"miopenDouble data type not supported by MIOpenGEMM.");
885+
}
886886
break;
887887
}
888888

@@ -1144,10 +1144,10 @@ miopenStatus_t CallGemmStridedBatchedSequential(const Handle& handle,
11441144
break;
11451145
}
11461146

1147-
case miopenInt8x4:
11481147
case miopenDouble: {
1149-
MIOPEN_THROW(miopenStatusBadParm, "Unknown or unsupported data type.");
1150-
};
1148+
MIOPEN_THROW(miopenStatusBadParm,
1149+
"miopenDouble data type not supported by MIOpenGEMM.");
1150+
}
11511151
break;
11521152
}
11531153

src/hip/general_tensor_reorder_sol.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ GenericReorderSolutionImpl::GenericReorderSolutionImpl(miopenDataType_t data_typ
137137
order_2(order_2_),
138138
order_3(order_3_)
139139
{
140-
if(data_type == miopenInt8x4)
141-
MIOPEN_THROW("These data type are not supported");
142140
std::size_t data_size = miopen::GetTypeSize(data_type);
143141
kernel_param_heuristic = tensor_reorder::HeuristicGet(data_size, dim_0, dim_1, dim_2, dim_3);
144142
}

src/include/miopen/datatype.hpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ inline std::string GetDataType(miopenDataType_t type)
5353
type_str = "bfloat16";
5454
}
5555
break;
56-
case miopenInt8x4: {
57-
type_str = "UNSUPPORTED_TYPE";
58-
}
59-
break;
6056
case miopenInt8: {
6157
type_str = "int8_t";
6258
}
@@ -157,10 +153,7 @@ inline KernelBuildParameters GetDataTypeKBP(miopenDataType_t type)
157153
case miopenDouble: use_fp64 = 1; break;
158154
case miopenFloat8: use_fp8 = 1; break;
159155
case miopenBFloat8: use_bfp8 = 1; break;
160-
case miopenInt8x4: // fallthrough
161-
default:
162-
MIOPEN_THROW("Only float, half, bfloat16, int8, float8, bfloat8 data types are supported.");
163-
break;
156+
default: MIOPEN_THROW("Unsupported data type."); break;
164157
}
165158

166159
auto kbp = KernelBuildParameters{
@@ -180,7 +173,7 @@ inline KernelBuildParameters GetDataTypeKBP(miopenDataType_t type)
180173
if(use_fp8 != 0)
181174
kbp.Define("MIOPEN_USE_FP8", use_fp8);
182175
if(use_bfp8 != 0)
183-
kbp.Define("MIOPEN_USE_FP8", use_bfp8);
176+
kbp.Define("MIOPEN_USE_BFP8", use_bfp8);
184177
return kbp;
185178
}
186179

src/include/miopen/problem_description_base.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ inline std::string GetDataTypeName(miopenDataType_t data_type)
3737
case miopenFloat: return "FP32";
3838
case miopenHalf: return "FP16";
3939
case miopenInt8: return "INT8";
40-
case miopenInt8x4: return "INT8x4";
4140
case miopenInt32: return "INT32";
4241
case miopenBFloat16: return "BF16";
4342
case miopenDouble: return "FP64";

0 commit comments

Comments
 (0)