Commit bb94fa85 authored by Chris Sullivan's avatar Chris Sullivan Committed by Scott Cyphers

softmax & convolution memory primitive cacheing (#1290)

* Updated softmax.

* Formatting.

* Updated convolution.

* Use build_primitive overloading. Add helper to emit type_string given a node.

* Formatting.

* Update ConvolutionBackpropData.

* convolution backprop & max pool memory primitive cacheing (#1303)

* Updated ConvolutionBackpropFilters.
* Update MaxPool.

* Update Max and Min. (#1307)
parent eba9439b
This diff is collapsed.
......@@ -22,6 +22,10 @@
#include "ngraph/runtime/gpu/gpu_shape.hpp"
#include "ngraph/strides.hpp"
#include "ngraph/op/convolution.hpp"
#include "ngraph/op/max_pool.hpp"
#include "ngraph/op/softmax.hpp"
namespace ngraph
{
class GPUShape;
......@@ -37,6 +41,11 @@ namespace ngraph
{
friend class GPUPrimitiveEmitter;
public:
size_t build_primitive(const op::Softmax* node);
size_t build_primitive(const op::Convolution* node);
size_t build_primitive(const op::MaxPool* node);
public:
size_t build_pad(const std::array<std::string, 2>& dtypes,
GPUShape input_shape,
......
This diff is collapsed.
......@@ -30,6 +30,11 @@
#include "ngraph/runtime/gpu/gpu_runtime_context.hpp"
#include "ngraph/shape.hpp"
#include "ngraph/op/convolution.hpp"
#include "ngraph/op/max.hpp"
#include "ngraph/op/max_pool.hpp"
#include "ngraph/op/min.hpp"
namespace ngraph
{
namespace runtime
......@@ -48,6 +53,14 @@ namespace ngraph
{
friend class GPUPrimitiveEmitter;
public:
size_t build_primitive(const op::Convolution* node);
size_t build_primitive(const op::ConvolutionBackpropData* node);
size_t build_primitive(const op::ConvolutionBackpropFilters* node);
size_t build_primitive(const op::MaxPool* node);
size_t build_primitive(const op::Max* node);
size_t build_primitive(const op::Min* node);
public:
enum class Prop
{
......
This diff is collapsed.
......@@ -232,3 +232,19 @@ void runtime::gpu::kernel::emit_cudnnReduceTensor(codegen::CodeWriter& writer,
writer << " " << out.get_name() << "));\n";
writer << "ngraph::runtime::gpu::free_gpu_buffer(workspace_ptr);\n";
}
std::string runtime::gpu::kernel::emit_type_string(const Node* node)
{
std::stringstream ss;
for (auto const& input : node->get_inputs())
{
ss << input.get_element_type().c_type_string() << "_";
}
for (auto const& output : node->get_outputs())
{
ss << output.get_element_type().c_type_string() << "_";
}
std::string types = ss.str();
std::replace(types.begin(), types.end(), ' ', '_');
return types;
}
......@@ -82,6 +82,8 @@ namespace ngraph
const std::string& output_desc,
const float& alpha,
const float& beta);
std::string emit_type_string(const Node* node);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment