-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduced CUDA dropout memory usage (#1005)
* Revert "Build Framework (NeoML-master 2.0.204.0): Incrementing version number." This reverts commit 9a29b52. * added test to branch * added rca22824 * started * revert some changes * added some new * reducing dropout memory usage on cuda Signed-off-by: daniyalaliev <daniial.aliev@abbyy.com> * design changes have been made Signed-off-by: daniyalaliev <daniial.aliev@abbyy.com> --------- Signed-off-by: daniyalaliev <daniial.aliev@abbyy.com> Co-authored-by: daniyalaliev <daniial.aliev@abbyy.com>
- Loading branch information
1 parent
6c9023d
commit 9cf9652
Showing
4 changed files
with
101 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* Copyright © 2017-2023 ABBYY Production LLC | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
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. | ||
--------------------------------------------------------------------------------------------------------------*/ | ||
|
||
#pragma once | ||
|
||
#ifdef NEOML_USE_CUDA | ||
|
||
#include <NeoMathEngine/NeoMathEngine.h> | ||
#include <NeoMathEngine/CrtAllocatedObject.h> | ||
|
||
namespace NeoML { | ||
|
||
// DropoutDesc without mask for usage on CUDA | ||
struct CCudaMathEngineDropoutDesc : public CDropoutDesc { | ||
explicit CCudaMathEngineDropoutDesc(IMathEngine& mathEngine, float rate, bool isSpatial, bool isBatchwise, | ||
const CBlobDesc& input, const CBlobDesc& output, int seed); | ||
|
||
CBlobDesc Input; // input blob descriptor | ||
CBlobDesc Output; // output blob descriptor | ||
const float ForwardRate; // the probability that an element is not dropped out | ||
const bool IsSpatial; // indicates if whole channels are dropped out | ||
const bool IsBatchwise; // indicates if an element is dropped out of all objects in one batch at the same time | ||
// seed that will be used later in CUDA | ||
const int seed; | ||
}; | ||
|
||
} // namespace NeoML | ||
|
||
#endif // NEOML_USE_CUDA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters