Skip to content

Commit

Permalink
Throw error and skip tests on ROCm systems
Browse files Browse the repository at this point in the history
  • Loading branch information
fiedorowicz1 committed Jun 18, 2024
1 parent 03e05a5 commit 46cf219
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci_test/unit_tests/test_unit_layer_upsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,5 @@ def func(cluster, dirname, weekly):
# Create test functions that can interact with PyTest
# Note: Create test name by removing ".py" from file name
_test_name = os.path.splitext(os.path.basename(current_file))[0]
for _test_func in tools.create_tests(setup_experiment, _test_name, skip_clusters=["catalyst"]):
for _test_func in tools.create_tests(setup_experiment, _test_name, skip_clusters=["tioga", "corona"]):
globals()[_test_func.__name__] = augment_test_func(_test_func)
2 changes: 1 addition & 1 deletion ci_test/unit_tests/test_unit_layer_upsample_distconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,6 @@ def func(cluster, dirname, weekly):
# Note: Create test name by removing ".py" from file name
_test_name = os.path.splitext(os.path.basename(current_file))[0]
for _test_func in tools.create_tests(setup_experiment, _test_name,
skip_clusters=["catalyst"],
skip_clusters=["tioga", "corona"],
environment=environment):
globals()[_test_func.__name__] = augment_test_func(_test_func)
115 changes: 115 additions & 0 deletions include/lbann/utils/dnn_lib/miopen/upsample.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2014-2024, Lawrence Livermore National Security, LLC.
// Produced at the Lawrence Livermore National Laboratory.
// Written by the LBANN Research Team (B. Van Essen, et al.) listed in
// the CONTRIBUTORS file. <[email protected]>
//
// LLNL-CODE-697807.
// All rights reserved.
//
// This file is part of LBANN: Livermore Big Artificial Neural Network
// Toolkit. For details, see http://software.llnl.gov/LBANN or
// https://github.com/LLNL/LBANN.
//
// Licensed under the Apache License, Version 2.0 (the "Licensee"); you
// may not use this file except in compliance with the License. You may
// obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied. See the License for the specific language governing
// permissions and limitations under the license.
////////////////////////////////////////////////////////////////////////////////
#ifndef LBANN_UTILS_DNN_LIB_MIOPEN_UPSAMPLE_HPP_
#define LBANN_UTILS_DNN_LIB_MIOPEN_UPSAMPLE_HPP_

#include "lbann/utils/dnn_enums.hpp"
#include "lbann/utils/dnn_lib/helpers.hpp"
#include "lbann/utils/gpu/helpers.hpp"

#include "utils.hpp"

namespace lbann {

#ifdef LBANN_HAS_MIOPEN
namespace dnn_lib {

using namespace miopen;

template <typename TensorDataType, typename ScalarParameterType>
void upsample_nearest_forward(PoolingDescriptor const& poolingDesc,
ScalarParameterType const& alpha_in,
TensorDescriptor const& xDesc,
TensorDataType const* x,
ScalarParameterType const& beta_in,
TensorDescriptor const& yDesc,
TensorDataType* y,
dnnHandle_t handle)
{
LBANN_ERROR("Upsample layer is not currently supported on ROCm devices.");
}

template <typename TensorDataType, typename ScalarParameterType>
void upsample_nearest_forward(PoolingDescriptor const& poolingDesc,
ScalarParameterType const& alpha_in,
TensorDescriptor const& xDesc,
El::AbstractMatrix<TensorDataType> const& x,
ScalarParameterType const& beta_in,
TensorDescriptor const& yDesc,
El::AbstractMatrix<TensorDataType>& y)
{
auto multisync =
El::MakeMultiSync(gpu::get_sync_info(y), gpu::get_sync_info(x));
auto handle_manager = internal::make_default_handle_manager(multisync);
upsample_nearest_forward(poolingDesc,
alpha_in,
xDesc,
x.LockedBuffer(),
beta_in,
yDesc,
y.Buffer(),
handle_manager.get());
}

template <typename TensorDataType, typename ScalarParameterType>
void upsample_nearest_backward(PoolingDescriptor const& poolingDesc,
ScalarParameterType const& alpha_in,
TensorDescriptor const& dyDesc,
TensorDataType const* dy,
ScalarParameterType const& beta_in,
TensorDescriptor const& dxDesc,
TensorDataType* dx,
dnnHandle_t handle)
{
LBANN_ERROR("Upsample layer is not currently supported on ROCm devices.");
}

template <typename TensorDataType, typename ScalarParameterType>
void upsample_nearest_backward(PoolingDescriptor const& poolingDesc,
ScalarParameterType const& alpha_in,
TensorDescriptor const& dyDesc,
El::AbstractMatrix<TensorDataType> const& dy,
ScalarParameterType const& beta_in,
TensorDescriptor const& dxDesc,
El::AbstractMatrix<TensorDataType>& dx)
{
auto multisync = El::MakeMultiSync(gpu::get_sync_info(dx),
gpu::get_sync_info(dy));
auto handle_manager = internal::make_default_handle_manager(multisync);
upsample_nearest_backward(poolingDesc,
alpha_in,
dyDesc,
dy.LockedBuffer(),
beta_in,
dxDesc,
dx.Buffer(),
handle_manager.get());
}

} // namespace dnn_lib
#endif // LBANN_HAS_MIOPEN
} // namespace lbann
#endif // LBANN_UTILS_DNN_LIB_MIOPEN_UPSAMPLE_HPP_

0 comments on commit 46cf219

Please sign in to comment.