Skip to content

Commit

Permalink
[xla:cpu] drop Legacy from CompileLegacyCpuExecutable
Browse files Browse the repository at this point in the history
This was considered legacy under the XLA Runtime transition, but XLA
Runtime is no more, so this isn't legacy any more.

While at it, remove a stale declaration of an XlaRuntime method
whose definition was removed long ago.

PiperOrigin-RevId: 718308821
  • Loading branch information
cota authored and Google-ML-Automation committed Jan 24, 2025
1 parent 6557723 commit 41b5806
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
9 changes: 4 additions & 5 deletions xla/service/cpu/cpu_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1327,9 +1327,9 @@ static void StripPayloadFromLiteralProto(HloProto& proto) {
}

absl::StatusOr<std::unique_ptr<CpuExecutable>>
CpuCompiler::CompileLegacyCpuExecutable(std::unique_ptr<HloModule> module) {
CpuCompiler::CompileCpuExecutable(std::unique_ptr<HloModule> module) {
TraceMe trace([&] {
return TraceMeEncode("CpuCompiler::CompileLegacyCpuExecutable",
return TraceMeEncode("CpuCompiler::CompileCpuExecutable",
{{"name", module->name()}});
});

Expand Down Expand Up @@ -1715,8 +1715,7 @@ absl::StatusOr<std::unique_ptr<Executable>> CpuCompiler::RunBackend(
llvm_ir::LLVMCommandLineOptionsLock llvm_lock(llvm_options);

std::unique_ptr<CpuExecutable> cpu_executable;
TF_ASSIGN_OR_RETURN(cpu_executable,
CompileLegacyCpuExecutable(std::move(module)));
TF_ASSIGN_OR_RETURN(cpu_executable, CompileCpuExecutable(std::move(module)));

cpu_executable->set_debug_info(
cpu_executable->buffer_assignment().StatsString(
Expand Down Expand Up @@ -2129,7 +2128,7 @@ CpuExecutableAotCompilationResult::LoadExecutable(
// We emit thunks for the HLO module and ignore emitted LLVM IR as we
// already have it compiled to object file.
//
// See `CpuCompiler::CompileLegacyCpuExecutable` for the jit-compilation
// See `CpuCompiler::CompileCpuExecutable` for the jit-compilation
// version that actually compiles emitted LLVM IR.
//
// TODO(ezhulenev): We should make it less wasteful and instead serialize
Expand Down
9 changes: 1 addition & 8 deletions xla/service/cpu/cpu_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,6 @@ class CpuCompiler : public LLVMCompiler {
absl::StatusOr<std::unique_ptr<AotCompilationResult>>
LoadAotCompilationResult(const std::string& serialized_aot_result) override;

// The optional `registry` supports MLIR dialects and plugins to be loaded
// during optimization. If non-null, it will be used to construct relevant
// MLIR contexts.
absl::StatusOr<std::unique_ptr<CpuExecutable>> CompileXlaRuntimeCpuExecutable(
std::unique_ptr<HloModule> module,
mlir::DialectRegistry* registry = nullptr);

absl::StatusOr<HloSchedule> CreateHloSchedule(
const HloModule& hlo_module) const;

Expand Down Expand Up @@ -212,7 +205,7 @@ class CpuCompiler : public LLVMCompiler {
TargetMachineFeatures* target_machine_features,
const CompileOptions& compile_options);

absl::StatusOr<std::unique_ptr<CpuExecutable>> CompileLegacyCpuExecutable(
absl::StatusOr<std::unique_ptr<CpuExecutable>> CompileCpuExecutable(
std::unique_ptr<HloModule> module);

CpuCompiler(const CpuCompiler&) = delete;
Expand Down

0 comments on commit 41b5806

Please sign in to comment.