"external/include/half/half.hpp" did not exist on "d09ea4f4e5aca0aec89badff827639d998ee1f0b"
Commit e2d12e15 authored by Paul's avatar Paul
Browse files

Improvements to verify --reduce

parent f50ba415
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <migraphx/instruction.hpp> #include <migraphx/instruction.hpp>
#include <migraphx/compile_options.hpp> #include <migraphx/compile_options.hpp>
#include <migraphx/quantization.hpp> #include <migraphx/quantization.hpp>
#include <migraphx/ranges.hpp>
namespace migraphx { namespace migraphx {
namespace driver { namespace driver {
...@@ -84,7 +85,15 @@ void verify_program(const std::string& name, ...@@ -84,7 +85,15 @@ void verify_program(const std::string& name,
std::size_t output_num = x.size(); std::size_t output_num = x.size();
for(std::size_t i = 0; i < output_num; ++i) for(std::size_t i = 0; i < output_num; ++i)
{ {
verify_args(name, x[i], y[i], tolerance); if(x[i].get_shape().type() != y[i].get_shape().type() or x[i].get_shape().lens() != y[i].get_shape().lens())
{
std::cout << "FAILED: " << name << std::endl;
std::cout << "Shape mismatch {" << x[i].get_shape() << "} != {" << y[i].get_shape() << "}" << std::endl;
}
else
{
verify_args(name, x[i], y[i], tolerance);
}
} }
} }
...@@ -143,11 +152,19 @@ void verify_reduced(program p, ...@@ -143,11 +152,19 @@ void verify_reduced(program p,
double tolerance) double tolerance)
{ {
auto* mm = p.get_main_module(); auto* mm = p.get_main_module();
auto last = std::prev(mm->end(), n + 1); auto last = std::prev(mm->end(), n);
mm->remove_instructions(last, mm->end()); mm->remove_instructions(last, mm->end());
std::cout << "Verify: " << n << std::endl; std::cout << "Verify: " << n << std::endl;
std::cout << p << std::endl; std::cout << p << std::endl;
verify_program(std::to_string(n), p, t, options, quantize, inputs, tolerance); try
{
verify_program(std::to_string(n), p, t, options, quantize, inputs, tolerance);
}
catch(const std::exception& e)
{
std::cout << "FAILED: " << n << std::endl;
std::cout << "Exception: " << e.what() << std::endl;
}
} }
void verify_reduced_program(const program& p, void verify_reduced_program(const program& p,
...@@ -160,8 +177,13 @@ void verify_reduced_program(const program& p, ...@@ -160,8 +177,13 @@ void verify_reduced_program(const program& p,
const auto* mm = p.get_main_module(); const auto* mm = p.get_main_module();
auto n = std::distance(mm->begin(), mm->end()); auto n = std::distance(mm->begin(), mm->end());
std::cout << "Verify steps: " << n << std::endl; std::cout << "Verify steps: " << n << std::endl;
for(std::size_t i = 0; i < n; i++) for(std::size_t i = 1; i < n; i++)
{ {
auto last = std::prev(mm->end(), i + 1);
if(contains({"@literal", "@param"}, last->name())) {
std::cout << "Skip: " << i << std::endl;
continue;
}
verify_reduced(p, i, t, options, quantize, inputs, tolerance); verify_reduced(p, i, t, options, quantize, inputs, tolerance);
} }
} }
......
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