tree: 0717c9d73f9c3bd9db79b699236b2d2d36181f47
  1. backends/
  2. c/
  3. client/
  4. codegen/
  5. core/
  6. error/
  7. examples/
  8. experiments/
  9. ffi/
  10. hlo/
  11. internal/
  12. megascale/
  13. mlir/
  14. mlir_hlo/
  15. pjrt/
  16. python/
  17. python_api/
  18. runtime/
  19. service/
  20. stream_executor/
  21. tests/
  22. tools/
  23. tsl/
  24. util/
  25. AGENTS.md
  26. array.cc
  27. array.h
  28. array2d.h
  29. array2d_test.cc
  30. array3d.h
  31. array3d_test.cc
  32. array4d.h
  33. array4d_test.cc
  34. array_test.cc
  35. autotune_result_wrapper.cc
  36. autotune_result_wrapper.h
  37. autotune_result_wrapper_test.cc
  38. autotune_results.proto
  39. autotuning.proto
  40. bit_cast.h
  41. bit_cast_test.cc
  42. BUILD
  43. comparison_util.cc
  44. comparison_util.h
  45. comparison_util_test.cc
  46. compiler_macros.h
  47. debug_options_flags.cc
  48. debug_options_flags.h
  49. debug_options_flags_test.cc
  50. debug_options_parsers.cc
  51. debug_options_parsers.h
  52. debug_options_parsers_test.cc
  53. ef57.cc
  54. ef57.h
  55. ef57_test.cc
  56. error_spec.h
  57. executable_run_options.cc
  58. executable_run_options.h
  59. execution_options_util.cc
  60. execution_options_util.h
  61. fp_util.h
  62. fp_util_test.cc
  63. frontend_attributes.cc
  64. frontend_attributes.h
  65. future.h
  66. GEMINI.md
  67. index_util.cc
  68. index_util.h
  69. index_util_test.cc
  70. iterator_util.h
  71. iterator_util_test.cc
  72. layout.cc
  73. layout.h
  74. layout_test.cc
  75. layout_util.cc
  76. layout_util.h
  77. layout_util_test.cc
  78. lazy.h
  79. lit.bzl
  80. lit.cfg.py
  81. literal.cc
  82. literal.h
  83. literal_comparison.cc
  84. literal_comparison.h
  85. literal_comparison_test.cc
  86. literal_pool.cc
  87. literal_pool.h
  88. literal_pool_test.cc
  89. literal_test.cc
  90. literal_util.cc
  91. literal_util.h
  92. map_util.h
  93. maybe_owning.h
  94. metric_table_report.cc
  95. metric_table_report.h
  96. online_topsort.h
  97. online_topsort_test.cc
  98. overflow_util.h
  99. package_groups.bzl
  100. packed_literal_reader.cc
  101. packed_literal_reader.h
  102. parse_flags_from_env.cc
  103. parse_flags_from_env.h
  104. parse_flags_from_env_test.cc
  105. permutation_util.cc
  106. permutation_util.h
  107. permutation_util_test.cc
  108. primitive_util.cc
  109. primitive_util.h
  110. primitive_util_test.cc
  111. printer.cc
  112. printer.h
  113. protobuf_util.cc
  114. protobuf_util.h
  115. py_strict.bzl
  116. pytype.bzl
  117. README.md
  118. reference_util.cc
  119. reference_util.h
  120. reference_util_test.cc
  121. sh_test_with_runfiles.py
  122. shape.cc
  123. shape.h
  124. shape_layout.cc
  125. shape_layout.h
  126. shape_partition.cc
  127. shape_partition.h
  128. shape_partition_test.cc
  129. shape_pool.cc
  130. shape_pool.h
  131. shape_pool_test.cc
  132. shape_test.cc
  133. shape_tree.h
  134. shape_tree_test.cc
  135. shape_util.cc
  136. shape_util.h
  137. shape_util.proto
  138. shape_util_test.cc
  139. sharding_op_util.cc
  140. sharding_op_util.h
  141. side_effect_util.cc
  142. side_effect_util.h
  143. sort_json.cc
  144. sort_json.h
  145. sort_json_test.cc
  146. status_macros.cc
  147. status_macros.h
  148. status_macros_test.cc
  149. text_literal_reader.cc
  150. text_literal_reader.h
  151. text_literal_reader_test.cc
  152. text_literal_writer.cc
  153. text_literal_writer.h
  154. text_literal_writer_test.cc
  155. tuple_tree.cc
  156. tuple_tree.h
  157. tuple_tree_test.cc
  158. types.h
  159. types_test.cc
  160. union_find.h
  161. util.cc
  162. util.h
  163. util_test.cc
  164. window_util.cc
  165. window_util.h
  166. window_util_test.cc
  167. xla.default.bzl
  168. xla.proto
  169. xla_data.proto
third_party/xla/xla/README.md

XLA (Accelerated Linear Algebra) is a domain-specific compiler for linear algebra that optimizes TensorFlow computations. See the documentation.

This directory is currently migrating to OpenXLA and will be the root of the openxla/xla repository.

Where to start? If you're newly integrating with XLA, use PJRT. Integrate with the plugin you need at xla/pjrt/plugin/.

Making a new hardware accelerator type compiler? Create a new PJRT Plugin and follow the examples in xla/pjrt/plugin/example_plugin.

== Directory Structure ==

We're currently re-organizing the directory structure, the end result should be that no sources are directly present at the top-level. Here is the current plan for the directory layout:

  • backends/ (created from directories under xla/service)
    • cpu/
    • gpu/
    • interpreter/
    • ...
  • hlo/ (created from xla/service/ mostly, no sources expected directly here)
    • client/ (created from xla/client)
    • evaluator/ (created from the relevant files in xla/service)
    • experimental/ (created from xla/experimental)
    • ir/ (created from the relevant files in xla/service)
    • python/ (created from xla/python)
    • tests/ (created from xla/tests)
    • transforms/ (created from the relevant files in xla/service)
    • utils/ (created from the relevant files in xla/service)
  • mlir/ (also exported as the root of https://github.com/tensorflow/mlir-hlo and building with CMake)
    • CMakeLists.txt (just like now for mlir-hlo repo).
    • backends/ (same as xla/backends/ but for the MLIR specific bits: this is a short-term solution pending more convergence / XLA Next)
      • cpu
      • gpu (populated from /compiler/xla/mlir/transforms/gpu/passes.td, will contain all the glue for e2e GPU compilation)
    • bindings/
      • c/ (bootstrapped from mlir/hlo/{include,lib}/mlir-hlo-c)
      • python/ (bootstrapped from mlir/hlo/python, should talk about some low-level LAX?)
    • integration_tests/ (to be defined / refined)
    • tools/ (fuzzer, ir-reducer, interpreter/evaluator)
    • transforms/ (generic / cross dialect transforms)
    • utils/
  • tsl/ (Tensor Standard Libraries - common utilities for implementing XLA)
  • // below are dialects and transforms folders
    • framework/ (moved from compiler/mlir/xla/ir/xla_framework_ops.td)
    • gml_st
      • gmlst-opt.cc
      • gmlst-runner.cc (runner tool that can execute IR at ~gmlst level)
      • ir/
      • integration_test (tests that run things: Tensor(s) in -> Tensor(s) out)
      • test (IR -> IR tests for passes interaction)
      • transforms/
        • bufferize_tiled_loop/
          • bufferize_tiled_loop.cc
          • bufferize_tiled_loop.h
        • ...
    • mhlo/
      • mhlo-opt.cc
      • analysis/
        • dataflow/
          • dataflow.h
          • dataflow.cc
          • test_pass.cc // test_only target, linked into opt tool for testing only.
      • integration_test (tests that run things: Tensor(s) in -> Tensor(s) out)
      • ir/ (dialect definition)
      • test (IR -> IR tests for passes interaction)
      • transforms/
        • materialize_broadcasts/
          • materialize_broadcasts.cc
          • materialize_broadcasts.h // headers stays with the source
          • broadcast_analysis.{cc, h} // private analysis/utils needed for this pass
          • test/ (.mlir unit-tests are collocated with the pass itself).
        • passes.td // enables group registration for all passes.
      • utils/
    • thlo/
    • runtime/
  • pjrt/ (created from xla/pjrt)
    • plugin/ - Public PJRT API entry points for various backends.
  • rpc/ (created from xla/rpc)
  • runtime/
  • stream_executor/ (moved from TensorFlow)
  • third_party/ (vendoring of TSL base library)
  • tools/ (created from mlir/hlo/tools and xla/tools)
  • translate/ (StableHLO to MHLO, MHLO to HLO, HLO to MHLO, MHLO to TOSA)