Skip to content

Commit

Permalink
[xla:cpu] Switch XLA:CPU runtime to thunks interpreter
Browse files Browse the repository at this point in the history
With this change XLA:CPU instead of compiling one LLVM function for the whole HLO module compiles separate functions for different fusions and runs them via the interpreter-like runtime.

This can change numerics because of slightly different LLVM IR and missed cross-fusion optimizations. If this breaks your tests, they likely have to relax numerical error tolerance.

Another potential issue is performance regressions for while loops with large number of iterations and small computation, as instead of compiling, we run such loops in interpreter. We plan to fix it in the future.

To disable thunks runtime set env variable: XLA_FLAGS=--xla_cpu_use_thunk_runtime=false.

PiperOrigin-RevId: 660520935
  • Loading branch information
ezhulenev authored and copybara-github committed Aug 7, 2024
1 parent 39c59b9 commit 0a4d157
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xla/debug_options_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ DebugOptions DefaultDebugOptionsIgnoringFlags() {
#ifdef XLA_CPU_USE_ACL
opts.set_xla_cpu_use_acl(true);
#endif
opts.set_xla_cpu_use_thunk_runtime(false);
opts.set_xla_cpu_use_thunk_runtime(true);
opts.set_xla_cpu_enable_concurrency_optimized_scheduler(false);
opts.set_xla_cpu_prefer_vector_width(256);

Expand Down

0 comments on commit 0a4d157

Please sign in to comment.