Use StartDetachedThread instead of SchedClosure to dispatch atom program compilation

PiperOrigin-RevId: 847528854
This commit is contained in:
Junwhan Ahn
2025-12-21 17:25:22 -08:00
committed by TensorFlower Gardener
parent ce61030c67
commit 7733c4c03d

View File

@@ -180,7 +180,8 @@ absl::StatusOr<CompileFuture> MultiThreadedAtomProgramCompiler::CompileXla(
/*context=*/nullptr, // Shares the same long-living context.
mlir::OwningOpRef<mlir::ModuleOp>(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 {