From ef368c5f62715ccc49d0b11a945388e459db4673 Mon Sep 17 00:00:00 2001 From: Chao Chen Date: Thu, 4 Jul 2024 12:49:10 +0000 Subject: [PATCH] small changes --- xla/debug_options_flags.cc | 2 +- xla/service/gpu/buffer_comparator.cc | 6 +++++- xla/service/gpu/buffer_comparator.h | 2 +- xla/service/gpu/gemm_algorithm_picker.cc | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/xla/debug_options_flags.cc b/xla/debug_options_flags.cc index 2bf5dc137ebe05..3b103bf8edd025 100644 --- a/xla/debug_options_flags.cc +++ b/xla/debug_options_flags.cc @@ -49,7 +49,7 @@ DebugOptions DefaultDebugOptionsIgnoringFlags() { opts.set_xla_llvm_enable_invariant_load_metadata(true); opts.set_xla_llvm_disable_expensive_passes(false); opts.set_xla_backend_optimization_level(3); - opts.set_xla_gpu_autotune_level(4); + opts.set_xla_gpu_autotune_level(5); opts.set_xla_gpu_autotune_max_solutions(0); opts.set_xla_cpu_multi_thread_eigen(true); opts.set_xla_gpu_cuda_data_dir("./cuda_sdk_lib"); diff --git a/xla/service/gpu/buffer_comparator.cc b/xla/service/gpu/buffer_comparator.cc index 43fbde0e5f202b..ee2aa80edbe4a4 100644 --- a/xla/service/gpu/buffer_comparator.cc +++ b/xla/service/gpu/buffer_comparator.cc @@ -104,6 +104,10 @@ static absl::StatusOr DeviceCompare( return result == 0; } +// Host side comparison code that does the same thing, but reports some of the +// differences as well. It only print logs for debugging. +// +// Returns true if no differences were seen, false otherwise. template static absl::StatusOr HostCompare(const ComparisonParams& params) { int64_t n = params.current.size() / sizeof(ElementType); @@ -195,7 +199,7 @@ absl::StatusOr BufferComparator::CompareEqual( "fp8_e5m2_comparison", buffer_comparator::fp8_e5m2_comparison(), params); #endif // GOOGLE_CUDA -#if TENSORFLOW_USE_ROCM && TF_ROCM_VERSION >= 60300 +#if TENSORFLOW_USE_ROCM && TF_ROCM_VERSION >= 60200 case xla::F8E4M3FNUZ: return CompareEqualParameterized( "fp8_e4m3fnuz_comparison", diff --git a/xla/service/gpu/buffer_comparator.h b/xla/service/gpu/buffer_comparator.h index b56fc21073e564..107585c2ba901b 100644 --- a/xla/service/gpu/buffer_comparator.h +++ b/xla/service/gpu/buffer_comparator.h @@ -51,7 +51,7 @@ class BufferComparator { se::DeviceMemoryBase expected) const; private: Shape shape_; - float relative_tol_; // relative tolerance for comparison + double relative_tol_; // relative tolerance for comparison bool verbose_; // whether to print out error message on mismatch }; diff --git a/xla/service/gpu/gemm_algorithm_picker.cc b/xla/service/gpu/gemm_algorithm_picker.cc index cdc1295675369d..f5c3524e3be84d 100644 --- a/xla/service/gpu/gemm_algorithm_picker.cc +++ b/xla/service/gpu/gemm_algorithm_picker.cc @@ -343,7 +343,7 @@ class GemmAutotuner { comparator.CompareEqual(stream_, /*current=*/OutputBuffer(), /*expected=*/reference_buffer)); if (!outputs_match) { - LOG(ERROR) << "Results mismatch between different GEMM algorithms. " + LOG(WARNING) << "Results mismatch between different GEMM algorithms. " << "This is likely a bug/unexpected loss of precision."; CHECK(!autotune_config_.should_crash_on_check_failure());