"git@developer.sourcefind.cn:OpenDAS/nni.git" did not exist on "80bc9537b6952a879e3a7805996cb3c862a29ee8"
Commit 07fc3c2d authored by Paul's avatar Paul
Browse files

Check for flag

parent fdcb8d92
...@@ -24,8 +24,7 @@ struct miopen_quant_convolution ...@@ -24,8 +24,7 @@ struct miopen_quant_convolution
{ {
// TODO: Add algo // TODO: Add algo
// return op::quant_convolution::reflect(self.op, f); // return op::quant_convolution::reflect(self.op, f);
return pack(f(self.op, "op"), return pack(f(self.op, "op"), f(self.int8_x4_format, "int8_x4_format"));
f(self.int8_x4_format, "int8_x4_format"));
} }
std::string name() const { return "gpu::quant_convolution"; } std::string name() const { return "gpu::quant_convolution"; }
......
...@@ -156,6 +156,7 @@ void pack_int8_args::apply(module& m) const ...@@ -156,6 +156,7 @@ void pack_int8_args::apply(module& m) const
} }
else if(ins->name() == "gpu::quant_convolution") else if(ins->name() == "gpu::quant_convolution")
{ {
// TODO: Check for int8_x4_format
auto inputs = ins->inputs(); auto inputs = ins->inputs();
auto packed_x = m.insert_instruction( auto packed_x = m.insert_instruction(
ins, ins,
......
...@@ -16,8 +16,8 @@ argument miopen_quant_convolution::compute(context& ctx, ...@@ -16,8 +16,8 @@ argument miopen_quant_convolution::compute(context& ctx,
const shape& output_shape, const shape& output_shape,
const std::vector<argument>& args) const const std::vector<argument>& args) const
{ {
auto x_desc = make_tensor(args[0].get_shape(), true); auto x_desc = make_tensor(args[0].get_shape(), int8_x4_format);
auto w_desc = make_tensor(args[1].get_shape(), true); auto w_desc = make_tensor(args[1].get_shape(), int8_x4_format);
auto y_desc = make_tensor(output_shape); auto y_desc = make_tensor(output_shape);
float alpha = 1; float alpha = 1;
...@@ -49,8 +49,8 @@ shape miopen_quant_convolution::compile(context& ctx, ...@@ -49,8 +49,8 @@ shape miopen_quant_convolution::compile(context& ctx,
std::vector<shape> inputs) std::vector<shape> inputs)
{ {
shape workspace_shape{}; shape workspace_shape{};
auto x_desc = make_tensor(inputs[0], true); auto x_desc = make_tensor(inputs[0], int8_x4_format);
auto w_desc = make_tensor(inputs[1], true); auto w_desc = make_tensor(inputs[1], int8_x4_format);
auto y_desc = make_tensor(output_shape); auto y_desc = make_tensor(output_shape);
std::size_t workspace_size = 0; std::size_t workspace_size = 0;
...@@ -62,6 +62,7 @@ shape miopen_quant_convolution::compile(context& ctx, ...@@ -62,6 +62,7 @@ shape miopen_quant_convolution::compile(context& ctx,
&workspace_size); &workspace_size);
workspace_shape = shape{shape::int8_type, {workspace_size}}; workspace_shape = shape{shape::int8_type, {workspace_size}};
// TODO: use pack_int8_shape only when pack_int8_shape is true
auto arg_vec4_x = to_gpu(generate_argument(pack_int8_shape(inputs[0]))); auto arg_vec4_x = to_gpu(generate_argument(pack_int8_shape(inputs[0])));
auto arg_vec4_w = to_gpu(generate_argument(pack_int8_shape(inputs[1]))); auto arg_vec4_w = to_gpu(generate_argument(pack_int8_shape(inputs[1])));
auto y = allocate_gpu(output_shape); auto y = allocate_gpu(output_shape);
......
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