Skip to content

Commit 2fa7628

Browse files
committed
Add implementation files
1 parent 710d0fe commit 2fa7628

File tree

5 files changed

+478
-343
lines changed

5 files changed

+478
-343
lines changed

src/layers/regularizers/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ if (LBANN_HAS_GPU)
4848
)
4949
endif ()
5050

51+
if (LBANN_HAS_DISTCONV)
52+
add_subdirectory(distconv)
53+
endif()
54+
5155
add_subdirectory(cereal_registration)
5256

5357
# Propagate the files up the tree
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
################################################################################
2+
## Copyright (c) 2014-2022, Lawrence Livermore National Security, LLC.
3+
## Produced at the Lawrence Livermore National Laboratory.
4+
## Written by the LBANN Research Team (B. Van Essen, et al.) listed in
5+
## the CONTRIBUTORS file. <[email protected]>
6+
##
7+
## LLNL-CODE-697807.
8+
## All rights reserved.
9+
##
10+
## This file is part of LBANN: Livermore Big Artificial Neural Network
11+
## Toolkit. For details, see http://software.llnl.gov/LBANN or
12+
## https://github.com/LLNL/LBANN.
13+
##
14+
## Licensed under the Apache License, Version 2.0 (the "Licensee"); you
15+
## may not use this file except in compliance with the License. You may
16+
## obtain a copy of the License at:
17+
##
18+
## http://www.apache.org/licenses/LICENSE-2.0
19+
##
20+
## Unless required by applicable law or agreed to in writing, software
21+
## distributed under the License is distributed on an "AS IS" BASIS,
22+
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
23+
## implied. See the License for the specific language governing
24+
## permissions and limitations under the license.
25+
################################################################################
26+
set_full_path(THIS_DIR_CU_SOURCES
27+
distconv_layer_norm.cu
28+
)
29+
30+
# Propagate the files up the tree
31+
set(GPU_SOURCES "${GPU_SOURCES}" "${THIS_DIR_CU_SOURCES}" PARENT_SCOPE)
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
////////////////////////////////////////////////////////////////////////////////
2+
// Copyright (c) 2014-2022, Lawrence Livermore National Security, LLC.
3+
// Produced at the Lawrence Livermore National Laboratory.
4+
// Written by the LBANN Research Team (B. Van Essen, et al.) listed in
5+
// the CONTRIBUTORS file. <[email protected]>
6+
//
7+
// LLNL-CODE-697807.
8+
// All rights reserved.
9+
//
10+
// This file is part of LBANN: Livermore Big Artificial Neural Network
11+
// Toolkit. For details, see http://software.llnl.gov/LBANN or
12+
// https://github.com/LLNL/LBANN.
13+
//
14+
// Licensed under the Apache License, Version 2.0 (the "Licensee"); you
15+
// may not use this file except in compliance with the License. You may
16+
// obtain a copy of the License at:
17+
//
18+
// http://www.apache.org/licenses/LICENSE-2.0
19+
//
20+
// Unless required by applicable law or agreed to in writing, software
21+
// distributed under the License is distributed on an "AS IS" BASIS,
22+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
23+
// implied. See the License for the specific language governing
24+
// permissions and limitations under the license.
25+
////////////////////////////////////////////////////////////////////////////////
26+
27+
#define LBANN_LAYERS_REGULARIZERS_DISTCONV_LAYER_NORM_INSTANTIATE
28+
29+
#include "../layer_norm_kernel.cuh"
30+
#include "lbann/layers/regularizers/distconv/distonv_layer_norm.hpp"
31+
32+
#ifdef LBANN_HAS_DISTCONV
33+
34+
template <typename Backend, typename DataType>
35+
template <typename Allocator>
36+
void LayerNormalization ::calculate_forward_stats(
37+
const DCTensor<Allocator>& input)
38+
{}
39+
40+
template <typename Backend, typename DataType>
41+
template <typename Allocator>
42+
void LayerNormalization ::apply_normalization(
43+
const DCTensor<Allocator>& input,
44+
const DCTensor<Allocator>& statistics,
45+
DCTensor<Allocator>& output)
46+
{}
47+
48+
template <typename Backend, typename DataType>
49+
template <typename Allocator>
50+
void LayerNormalization ::calculate_backward_stats(
51+
const DCTensor<Allocator>& input,
52+
const DCTensor<Allocator>& output_grad,
53+
const DCTensor<Allocator>& statistics,
54+
DCTensor<Allocator>& statistics_grad)
55+
{}
56+
template <typename Backend, typename DataType>
57+
template <typename Allocator>
58+
void LayerNormalization ::apply_grad(const DCTensor<Allocator>& input,
59+
const DCTensor<Allocator>& output_grad,
60+
const DCTensor<Allocator>& statistics,
61+
const DCTensor<Allocator>& statistics_grad,
62+
DCTensor<Allocator>& input_grad)
63+
{}
64+
65+
#endif // LBANN_HAS_DISTCONV

0 commit comments

Comments
 (0)