Skip to content

Commit

Permalink
[xla:gpu] Do not add address computation fusion into command buffer
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 604065387
  • Loading branch information
tyb0807 authored and tensorflower-gardener committed Feb 4, 2024
1 parent 4908db6 commit c8218b1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions third_party/xla/xla/service/gpu/command_buffer_scheduling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,16 @@ static bool IsCommand(const HloCustomCallInstruction* hlo,

static bool IsCommand(const HloInstruction* hlo,
const CommandBufferConfig& config) {
if (auto* fusion = DynCast<HloFusionInstruction>(hlo))
return config.contains(DebugOptions::FUSION);
if (auto* fusion = DynCast<HloFusionInstruction>(hlo)) {
// TODO(vuson): Make address computation fusion compatible with command
// buffer
auto gpu_config = fusion->backend_config<GpuBackendConfig>();
const FusionBackendConfig& backend_config =
gpu_config->fusion_backend_config();
const auto& custom_config = backend_config.custom_fusion_config();
return custom_config.name() != "address_computation" &&
config.contains(DebugOptions::FUSION);
}

if (auto* sort = DynCast<HloSortInstruction>(hlo))
return config.contains(DebugOptions::FUSION);
Expand Down

0 comments on commit c8218b1

Please sign in to comment.