openxla / xla

A machine learning compiler for GPUs, CPUs, and ML accelerators
Apache License 2.0
2.56k stars 400 forks source link

Error occurred while building TensorFlow #14129

Open Prashant-Jagtap opened 2 months ago

Prashant-Jagtap commented 2 months ago

While building TensorFlow on a big endian system, encountered the following error :

ERROR: .cache/bazel/_bazel_root/efb88f6336d9c4a18216fb94287b8d97/external/local_xla/xla/service/cpu/runtime/BUILD:199:11: Compiling xla/service/cpu/runtime/rng_state_thunk.cc failed: (Exit 1): gcc failed: error executing command (from target @local_xla//xla/service/cpu/runtime:rng_state_thunk) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 110 arguments skipped)
In file included from external/local_xla/xla/shape.h:28,
                 from external/local_xla/xla/index_util.h:24,
                 from external/local_xla/xla/literal.h:45,
                 from external/local_xla/xla/hlo/ir/dfs_hlo_visitor.h:27,
                 from external/local_xla/xla/hlo/ir/hlo_computation.h:35,
                 from external/local_xla/xla/service/buffer_assignment.h:28,
                 from external/local_xla/xla/service/cpu/runtime/rng_state_thunk.h:25,
                 from external/local_xla/xla/service/cpu/runtime/rng_state_thunk.cc:16:
external/local_xla/xla/layout.h:461:18: warning: 'xla::Layout::DimInfo::dim_level_type' is too small to hold all values of 'enum xla::DimLevelType'
  461 |     DimLevelType dim_level_type : 6;
      |                  ^~~~~~~~~~~~~~
external/local_xla/xla/layout.h:473:17: warning: 'xla::Layout::index_primitive_type' is too small to hold all values of 'enum xla::PrimitiveType'_
  473 |   PrimitiveType index_primitive_type : 8;_
      |                 ^~~~~~~~~~~~~~~~~~~~~
external/local_xla/xla/layout.h:474:17: warning: 'xla::Layout::pointer_primitive_type' is too small to hold all values of 'enum xla::PrimitiveType'_
  474 |   PrimitiveType pointer_primitive_type : 8;_
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
external/local_xla/xla/service/cpu/runtime/rng_state_thunk.cc: In member function 'virtual absl::lts_20230802::Status xla::cpu::RngGetAndUpdateStateThunk::Execute(const xla::cpu::Thunk::ExecuteParams&)':
external/local_xla/xla/service/cpu/runtime/rng_state_thunk.cc:69:17: error: 'ABSL_IS_LITTLE_ENDIAN' was not declared in this scope; did you mean 'ABSL_IS_BIG_ENDIAN'?
   69 |   static_assert(ABSL_IS_LITTLE_ENDIAN, "Big endian not supported");
      |                 ^~~~~~~~~~~~~~~~~~~~~
      |                 ABSL_IS_BIG_ENDIAN
Target //tensorflow/tools/pip_package:wheel failed to build 

Observed the changes from a recent commit. static_assert(ABSL_IS_LITTLE_ENDIAN, "Big endian not supported");

Currently, there is no test data or test case file to verify this. The logic works fine on big endian systems as it stands. Unless specific test data generated on little endian is added, it might not be required at this moment. Could you please take a look? Thanks.

Prashant-Jagtap commented 1 month ago

Any update on above issue ?

Prashant-Jagtap commented 1 week ago

Can anyone please take a look ? Thanks