Use hermetic Python in TSL and XLA
The issue is:
- It affects mlir/hlo tests time by several minutes (for "Creating runfiles trees" step)
- It uses gigabytes of disk space for duplicates of pypi_lit and python_x86_64-unknown-linux-gnu folders. Total 161,343 additional files
Command I used: bazel test //xla/mlir_hlo/tests/...
Before / After stats:
- Size of bazel-out/k8-opt/bin/xla/mlir_hlo/tests/Dialect/mhlo
before: 40M
after: 1.8G !!!
- Creating runfiles tree
before: 1 second
after: 110 seconds !!!
Content of typical xxx.mlir.test.runfiles folder:Before (size 476K):
MANIFEST __init__.py llvm-project xla
After (size 22M):
MANIFEST __init__.py llvm-project
pypi_lit python_x86_64-unknown-linux-gnu xla
MANIFEST number of lines
before: 101 linesafter: 4815 lines
bazel test //xla/mlir_hlo/tests/creates 63 mlir.test.runfiles folders containing the same copy of pypi_lit and python_x86_64-unknown-linux-gnu subfolders python_x86_64-unknown-linux-gnu folder contains 2490 filespypi_lit contains 71 files
Total 161,343 additional files !!! (for 63 tests)
Is it possible to give particular options/flags to bazel to use old fast approach?