Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROCm] Fix for the broken --config=rocm build #31393

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions tensorflow/core/kernels/conv_grad_filter_ops.cc
Expand Up @@ -938,19 +938,12 @@ void LaunchConv2DBackpropFilterOp<Eigen::GpuDevice, T>::operator()(
transformed_input = compatible_input;
}

se::TfAllocatorAdapter tf_allocator_adapter(stream->parent()->platform(),
ctx->device()->GetAllocator({}));
se::cuda::RedzoneAllocator rz_allocator(stream, &tf_allocator_adapter,
se::cuda::PtxCompilationOptions());

se::DeviceMemory<T> out_backprop_ptr =
AsDeviceMemory(transformed_out_backprop.template flat<T>().data(),
transformed_out_backprop.template flat<T>().size());
se::DeviceMemory<T> filter_backprop_ptr =
AsDeviceMemory(pre_transformed_filter_backprop.template flat<T>().data(),
pre_transformed_filter_backprop.template flat<T>().size());
se::DeviceMemory<T> filter_backprop_ptr_rz(
WrapRedzoneBestEffort(&rz_allocator, filter_backprop_ptr));
auto input_ptr = AsDeviceMemory(transformed_input.template flat<T>().data(),
transformed_input.template flat<T>().size());

Expand Down Expand Up @@ -982,6 +975,15 @@ void LaunchConv2DBackpropFilterOp<Eigen::GpuDevice, T>::operator()(
if (cudnn_use_autotune && !AutoTuneConvBwdFilter::GetInstance()->Find(
conv_parameters, &algorithm_config)) {
#if GOOGLE_CUDA

se::TfAllocatorAdapter tf_allocator_adapter(
stream->parent()->platform(), ctx->device()->GetAllocator({}));
se::cuda::RedzoneAllocator rz_allocator(stream, &tf_allocator_adapter,
se::cuda::PtxCompilationOptions());

se::DeviceMemory<T> filter_backprop_ptr_rz(
WrapRedzoneBestEffort(&rz_allocator, filter_backprop_ptr));

std::vector<AlgorithmDesc> algorithms;
CHECK(stream->parent()->GetConvolveBackwardFilterAlgorithms(
conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(stream->parent()),
Expand Down