Remove little endian asserts (#99713)

They block tests test_embedding_bag_2bit_unpack,
test_embedding_bag_4bit_unpack and test_embedding_bag_byte_unpack in test/quantization/core/test_quantized_op.py.

Without these asserts tests start passing on big endian systems.

Fixes #97803

Pull Request resolved: https://github.com/pytorch/pytorch/pull/99713
Approved by: https://github.com/kit1980
This commit is contained in:
Aleksei Nikiforov 2023-04-26 02:08:23 +00:00 committed by PyTorch MergeBot
parent c680f2b8ea
commit 1ded73f909
2 changed files with 0 additions and 8 deletions

View File

@ -32,8 +32,6 @@ class FloatToFused8BitRowwiseQuantizedOp : public Operator<Context> {
USE_SIMPLE_CTOR_DTOR(FloatToFused8BitRowwiseQuantizedOp)
bool RunOnDevice() override {
CAFFE_ENFORCE(IS_LITTLE_ENDIAN, "Unsupported endianness");
const auto& input = Input(DATA_FLOAT);
CAFFE_ENFORCE_GT(input.dim(), 0, "Input's dimension must be at least 1");
@ -119,8 +117,6 @@ class Fused8BitRowwiseQuantizedToFloatOp : public Operator<Context> {
USE_SIMPLE_CTOR_DTOR(Fused8BitRowwiseQuantizedToFloatOp)
bool RunOnDevice() override {
CAFFE_ENFORCE(IS_LITTLE_ENDIAN, "Unsupported endianness");
const auto& input = Input(DATA_FUSED_SCALE_BIAS_INT8);
CAFFE_ENFORCE_GT(input.dim(), 0, "Input's dimension must be at least 1");

View File

@ -28,8 +28,6 @@ class FloatToFusedNBitRowwiseQuantizedOp final : public Operator<CPUContext> {
~FloatToFusedNBitRowwiseQuantizedOp() override {}
bool RunOnDevice() override {
CAFFE_ENFORCE(internal::is_little_endian(), "Unsupported endianness");
const auto& input = Input(DATA_FLOAT);
CAFFE_ENFORCE_GT(input.dim(), 0, "Input's dimension must be at least 1");
@ -167,8 +165,6 @@ class FusedNBitRowwiseQuantizedToFloatOp final : public Operator<CPUContext> {
~FusedNBitRowwiseQuantizedToFloatOp() override {}
bool RunOnDevice() override {
CAFFE_ENFORCE(internal::is_little_endian(), "Unsupported endianness");
const auto& input = Input(DATA_FUSED_SCALE_BIAS);
CAFFE_ENFORCE_GT(input.dim(), 0, "Input's dimension must be at least 1");