Skip to content

Comments

S390x test fixes#27404

Open
AlekseiNikiforovIBM wants to merge 8 commits intomicrosoft:mainfrom
AlekseiNikiforovIBM:s390x_test_fixes
Open

S390x test fixes#27404
AlekseiNikiforovIBM wants to merge 8 commits intomicrosoft:mainfrom
AlekseiNikiforovIBM:s390x_test_fixes

Conversation

@AlekseiNikiforovIBM
Copy link
Contributor

Description

This PR contains fixes to various big endian support issues in onnxruntime, both in libraries and tests.

Motivation and Context

Currently some tests from onnxruntime testsuite fail.
This change fixes all tests from onnxruntime testsuite when it's built without training support.
It also includes a linking issue fix.

Following tests are fixed on s390x:
OrtModelOnlyTests.ValidateOrtFormatModelDoesNotRunOptimizersInFullBuild
FlatbufferUtilsTest.ExternalWriteReadWithLoadInitializers
SparseTensorConversionTests.SparseTensorProtoToDense_Rank1Indices64
SparseTensorConversionTests.SparseTensorProtoToDense_Rank1Indices32
SparseTensorConversionTests.SparseTensorProtoToDense_Rank1Indices16
SparseTensorConversionTests.SparseTensorProtoToDense_Rank1Indices8
SparseTensorConversionTests.SparseTensorProtoToDense_Rank2Indices_COO
SparseTensorConversionTests.TestConstantNodeConversion
OrtModelOnlyTests.SparseInitializerHandling
SparseTensorConversionTests.TestConstantNodeConversion
SparseTensorConversionTests.TestDenseToSparseConversion
ExecutionFrameTestInit.SparseInitializerAsOutput
CApiTest.SparseOutputModel

Build command:
./build.sh --config Debug --parallel 0 --enable_pybind --build_wheel --allow_running_as_root
This change fixes test
OrtModelOnlyTests.ValidateOrtFormatModelDoesNotRunOptimizersInFullBuild
on s390x.
Later this data is narrowed:
*p_data++ = static_cast<T>(*data_iter);

If for example BE int32_t data is 4 bytes:
0x00 0x00 0x00 0x01
After byteswapping it'll become:
0x01 0x00 0x00 0x00
And after narrowing to int16_t two rightmost bytes are used on big endian
and result is 0x00 0x00

If instead we byteswap it as two shorts, byteswapping result is:
0x00 0x00 0x01 0x00
And narrowing result is 0x01 0x00, which is correct LE representation of that number.

This change fixes following test on s390x:
FlatbufferUtilsTest.ExternalWriteReadWithLoadInitializers
Raw data is expected to be in LE.

This change fixes tests:
SparseTensorConversionTests.SparseTensorProtoToDense_Rank1Indices64
SparseTensorConversionTests.SparseTensorProtoToDense_Rank1Indices32
SparseTensorConversionTests.SparseTensorProtoToDense_Rank1Indices16
SparseTensorConversionTests.SparseTensorProtoToDense_Rank1Indices8
SparseTensorConversionTests.SparseTensorProtoToDense_Rank2Indices_COO
This change fixes tests:
OrtModelOnlyTests.SparseInitializerHandling
SparseTensorConversionTests.TestConstantNodeConversion
This change fixes following tests on s390x:
ExecutionFrameTestInit.SparseInitializerAsOutput
CApiTest.SparseOutputModel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant