From 7733c4c03da55a124cd0c2f652e33f606d8fed1a Mon Sep 17 00:00:00 2001 From: Junwhan Ahn Date: Sun, 21 Dec 2025 17:25:22 -0800 Subject: [PATCH] Use `StartDetachedThread` instead of `SchedClosure` to dispatch atom program compilation PiperOrigin-RevId: 847528854 --- .../ifrt/ir/transforms/multi_threaded_atom_program_compiler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/third_party/xla/xla/python/ifrt/ir/transforms/multi_threaded_atom_program_compiler.cc b/third_party/xla/xla/python/ifrt/ir/transforms/multi_threaded_atom_program_compiler.cc index 24785ec7e59..ee938534b80 100644 --- a/third_party/xla/xla/python/ifrt/ir/transforms/multi_threaded_atom_program_compiler.cc +++ b/third_party/xla/xla/python/ifrt/ir/transforms/multi_threaded_atom_program_compiler.cc @@ -180,7 +180,8 @@ absl::StatusOr MultiThreadedAtomProgramCompiler::CompileXla( /*context=*/nullptr, // Shares the same long-living context. mlir::OwningOpRef(module_op.clone())); auto [promise, future] = CompileFuture::MakePromise(); - tsl::Env::Default()->SchedClosure( + tsl::Env::Default()->StartDetachedThread( + tsl::ThreadOptions(), /*name=*/"MultiThreadedAtomProgramCompiler", WithCurrentUserContext([this, hlo_program = std::move(hlo_program), compile_options = std::move(compile_options), promise = std::move(promise)]() mutable {