@@ -537,20 +537,13 @@ BatchNormBackend _select_batch_norm_backend(
537537 }
538538
539539 // TODO: Remove PYTORCH_MIOPEN_SUGGEST_NHWC_BATCHNORM once ROCm officially supports NHWC in MIOpen
540- <<<<<<< HEAD
541- // See #64427
542- // non static variable is used to be able to change environment variable in runtime for testing
543- // enabled by default for ROCm >= 7.0.0
544- bool PYTORCH_MIOPEN_SUGGEST_NHWC_BATCHNORM = c10::utils::check_env (" PYTORCH_MIOPEN_SUGGEST_NHWC_BATCHNORM" ).value_or (ROCM_VERSION >= 70000 );
545- =======
546540 // See https://github.com/pytorch/pytorch/issues/64427.
547541 // non static variable is used to be able to change environment variable in runtime for testing
548542 // enabled by default for ROCm >= 7.0.0 with miopen 3.5
549543 int miopen_version = detail::getCUDAHooks ().compiledWithMIOpen () ? detail::getCUDAHooks ().versionMIOpen () : 0 ;
550544 bool is_miopen_3_4 = miopen_version >= 30400 ; // ROCm 6.4
551545 bool is_miopen_3_5 = miopen_version >= 30500 ; // ROCm 7.0
552546 bool PYTORCH_MIOPEN_SUGGEST_NHWC_BATCHNORM = c10::utils::check_env (" PYTORCH_MIOPEN_SUGGEST_NHWC_BATCHNORM" ).value_or (is_miopen_3_5);
553- >>>>>>> upstream/main
554547
555548 if (
556549 detail::getCUDAHooks ().compiledWithMIOpen ()
@@ -565,17 +558,9 @@ BatchNormBackend _select_batch_norm_backend(
565558 && ((running_mean.defined () && running_var.defined ())
566559 || (!running_mean.defined () && !running_var.defined () && training))
567560 && (input.suggest_memory_format () == MemoryFormat::Contiguous
568- <<<<<<< HEAD
569- #if (defined(USE_ROCM) && ROCM_VERSION >= 60500)
570- || (input.suggest_memory_format () == MemoryFormat::ChannelsLast && PYTORCH_MIOPEN_SUGGEST_NHWC_BATCHNORM)
571- || (input.suggest_memory_format () == MemoryFormat::ChannelsLast3d && PYTORCH_MIOPEN_SUGGEST_NHWC_BATCHNORM)
572- #endif
573- )
574- =======
575561 || (is_miopen_3_5 && PYTORCH_MIOPEN_SUGGEST_NHWC_BATCHNORM &&
576562 (input.suggest_memory_format () == MemoryFormat::ChannelsLast
577563 || input.suggest_memory_format () == MemoryFormat::ChannelsLast3d)))
578- >>>>>>> upstream/main
579564 ) {
580565 return BatchNormBackend::Miopen;
581566 }
0 commit comments