Skip to content

[xnn update prep] Update Dtypes for XNNPACK #11505

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

Merged
merged 1 commit into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions backends/xnnpack/runtime/XNNCompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ xnn_datatype getDataType(const DataType& data_type) {
return xnn_datatype::xnn_datatype_qdint8;
case DataType::xnn_datatype_qbint4:
return xnn_datatype::xnn_datatype_qbint4;
case DataType::xnn_datatype_qpint8:
return xnn_datatype::xnn_datatype_qpint8;
case DataType::xnn_datatype_int32:
return xnn_datatype::xnn_datatype_int32;
case DataType::xnn_datatype_pfp32:
return xnn_datatype::xnn_datatype_pfp32;
case DataType::xnn_datatype_bf16:
return xnn_datatype::xnn_datatype_bf16;
default:
return xnn_datatype::xnn_datatype_invalid;
}
Expand Down
9 changes: 9 additions & 0 deletions backends/xnnpack/serialization/runtime_schema.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ enum XNNDatatype : short {
xnn_datatype_qdint8 = 9,
/// Quantized 4-bit signed integer with shared blockwise quantization parameters.
xnn_datatype_qbint4 = 10,
/// Dynamically quantized 8-bit signed integers packed with their per-row
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume we will bump version at the end of the stack?

/// quantization parameters.
xnn_datatype_qpint8 = 11,
/// 32-bit signed integers.
xnn_datatype_int32 = 12,
/// IEEE754 single-precision packed floating-point.
xnn_datatype_pfp32 = 13,
/// BFloat16, i.e. the upper 16 bits of a float32.
xnn_datatype_bf16 = 14,
}

// type of quantization
Expand Down
9 changes: 9 additions & 0 deletions backends/xnnpack/serialization/schema.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ enum XNNDatatype : short {
xnn_datatype_qdint8 = 9,
/// Quantized 4-bit signed integer with shared blockwise quantization parameters.
xnn_datatype_qbint4 = 10,
/// Dynamically quantized 8-bit signed integers packed with their per-row
/// quantization parameters.
xnn_datatype_qpint8 = 11,
/// 32-bit signed integers.
xnn_datatype_int32 = 12,
/// IEEE754 single-precision packed floating-point.
xnn_datatype_pfp32 = 13,
/// BFloat16, i.e. the upper 16 bits of a float32.
xnn_datatype_bf16 = 14,
}

// type of quantization
Expand Down
4 changes: 4 additions & 0 deletions backends/xnnpack/serialization/xnnpack_graph_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ class XNNDatatype(IntEnum):
xnn_datatype_qcint4 = 8
xnn_datatype_qdint8 = 9
xnn_datatype_qbint4 = 10
xnn_datatype_qpint8 = 11
xnn_datatype_int32 = 12
xnn_datatype_pfp32 = 13
xnn_datatype_bf16 = 14


@dataclass
Expand Down
Loading