Commit 00d90ca8 authored by Khalique Ahmed's avatar Khalique Ahmed
Browse files

Merge branch 'develop' of https://github.com/ROCmSoftwarePlatform/AMDMIGraphX into mi100_opts

parents 439c0838 ee79e9b7
......@@ -25,6 +25,8 @@
namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
using milliseconds = std::chrono::duration<double, std::milli>;
struct program_impl
{
// A map is used to keep references to modules of the program
......@@ -293,10 +295,14 @@ std::vector<argument> program::eval(parameter_map params) const
ctx.finish();
std::cout << "Run instruction: ";
this->debug_print(ins);
timer t{};
auto result = check_context(f);
double t1 = t.record<milliseconds>();
ctx.finish();
double t2 = t.record<milliseconds>();
std::cout << "Time: " << t1 << "ms, " << t2 << "ms" << std::endl;
if(trace_level > 1 and ins->name().front() != '@' and ins->name() != "load")
std::cout << "Ouput: " << result << std::endl;
std::cout << "Output: " << result << std::endl;
return result;
});
}
......@@ -480,8 +486,7 @@ double common_average(const std::vector<double>& v)
void program::perf_report(std::ostream& os, std::size_t n, parameter_map params) const
{
using milliseconds = std::chrono::duration<double, std::milli>;
auto& ctx = this->impl->ctx;
auto& ctx = this->impl->ctx;
// Run once by itself
eval(params);
ctx.finish();
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -6,6 +6,7 @@
#include <migraphx/par_for.hpp>
#include <migraphx/functional.hpp>
#include <migraphx/ranges.hpp>
#include <migraphx/dom_info.hpp>
#include <unordered_map>
#include <unordered_set>
#include <queue>
......@@ -16,6 +17,7 @@
#include <set>
#include <deque>
#include <chrono>
#include <iomanip>
namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
......@@ -88,7 +90,7 @@ struct stream_info
return args.end();
}
const std::size_t min_partition_threshold = 1;
const std::size_t min_partition_threshold = 2;
sort_args_by_weight(args, std::greater<>{});
auto it = std::lower_bound(std::next(args.begin()),
......@@ -353,6 +355,7 @@ struct stream_info
{
std::unordered_map<instruction_ref, std::vector<std::vector<instruction_ref>>> result;
std::unordered_map<instruction_ref, std::unordered_set<instruction_ref>> merge_from;
dominator_info di = compute_dominator(p);
result.reserve(p.size());
merge_from.reserve(p.size());
for(auto ins : reverse_iterator_for(p))
......@@ -366,8 +369,13 @@ struct stream_info
merge_from[ins].insert(merge_from[arg].begin(), merge_from[arg].end());
}
auto streams = this->get_streams(ins);
if(is_split_point(ins))
{
erase_if(merge_from[ins],
[&](auto merge) { return di.strictly_dominate(ins, merge); });
}
auto streams = this->get_streams(ins);
// Collect concur instructions for each merge point.
for(const auto& merge : merge_from[ins])
{
......@@ -396,11 +404,18 @@ struct stream_info
std::unordered_map<instruction_ref, std::unordered_set<instruction_ref>>
get_conflicts(module& p)
{
using conflict_table_type =
std::unordered_map<instruction_ref, std::unordered_set<instruction_ref>>;
conflict_table_type conflict_table;
auto concur_ins = this->find_concurrent_instructions(p);
// Compute an index for each instruction
std::unordered_map<instruction_ref, std::size_t> ins2index;
std::size_t index_total = 0;
for(auto ins : iterator_for(p))
ins2index[ins] = index_total++;
std::vector<conflict_table_type> thread_conflict_tables(
std::thread::hardware_concurrency());
std::vector<instruction_ref> index_to_ins;
......@@ -442,14 +457,13 @@ struct stream_info
for(auto ins1 : ins1_set)
{
auto p1 = std::distance(ins1, merge_first);
auto p1 = ins2index.at(ins1);
for(auto ins2 : ins2_set)
{
if(ins1 == ins2)
continue;
auto p2 = std::distance(ins2, merge_first);
// The smaller distance means the instruction occurs later
if(p1 > p2)
auto p2 = ins2index.at(ins2);
if(p2 > p1)
thrd_table[ins2].insert(ins1);
else
thrd_table[ins1].insert(ins2);
......
#include <migraphx/simplify_algebra.hpp>
#include <migraphx/dead_code_elimination.hpp>
#include <migraphx/program.hpp>
#include <migraphx/op/add.hpp>
#include <migraphx/op/mul.hpp>
#include <migraphx/op/concat.hpp>
#include <migraphx/op/slice.hpp>
#include <migraphx/op/convolution.hpp>
#include <migraphx/op/contiguous.hpp>
#include <migraphx/op/as_shape.hpp>
#include <migraphx/op/broadcast.hpp>
#include <migraphx/op/neg.hpp>
#include <migraphx/op/recip.hpp>
#include <migraphx/op/reshape.hpp>
#include <migraphx/op/rsqrt.hpp>
#include <migraphx/op/transpose.hpp>
#include <migraphx/matcher.hpp>
#include <migraphx/literal.hpp>
......@@ -20,6 +13,7 @@
#include <migraphx/serialize.hpp>
#include <migraphx/algorithm.hpp>
#include <unordered_set>
namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS {
......@@ -403,8 +397,27 @@ struct find_splits
match::any_of[match::outputs()](match::pointwise(), reduction()))));
}
static bool is_dependent(const module& m, instruction_ref ins1, instruction_ref ins2)
{
std::unordered_set<instruction_ref> traversed;
return fix<bool>([&](auto self, auto ins) -> bool {
if(ins == ins2)
return true;
if(contains(traversed, ins))
return false;
traversed.insert(ins);
const auto& inputs = ins->inputs();
return std::any_of(inputs.begin(), inputs.end(), [&](auto in) {
return m.has_instruction(in) and self(in);
});
})(ins1);
}
static std::vector<std::vector<instruction_ref>>
get_split_groups(const std::vector<instruction_ref>& splits)
get_split_groups(const module& m, const std::vector<instruction_ref>& splits)
{
std::vector<std::vector<instruction_ref>> groups;
for(auto out : splits.front()->outputs())
......@@ -421,9 +434,16 @@ struct find_splits
if(it == split->outputs().end())
break;
assert((*it)->name() != "slice");
// If there is a duplicate bail
if(contains(group, *it))
// there are should be no dependency between instructions in the group
if(std::any_of(group.begin(), group.end(), [&](auto i) {
return is_dependent(m, *it, i) or is_dependent(m, i, *it);
}))
{
return {};
}
group.push_back(*it);
}
if(group.size() != splits.size())
......@@ -460,13 +480,12 @@ struct find_splits
void apply(module& p, const match::matcher_result& r) const
{
auto ins = r.result;
auto ins = r.result;
auto splits = get_splits(ins);
if(splits.empty())
return;
for(const auto& group : get_split_groups(splits))
for(const auto& group : get_split_groups(p, splits))
{
auto start = group.front();
auto split_front = splits.front();
......@@ -644,19 +663,6 @@ struct find_add_convs
return x.stride[0] / y.stride[0];
}
static shape compute_stride_shape(const shape& input, std::size_t n)
{
return {input.type(),
{input.lens()[0],
input.lens()[1],
std::size_t(std::max<std::ptrdiff_t>(1, (input.lens()[2] - 1) / n + 1)),
std::size_t(std::max<std::ptrdiff_t>(1, (input.lens()[3] - 1) / n + 1))},
{input.strides()[0],
input.strides()[1],
input.strides()[2] * n,
input.strides()[3] * n}};
}
void apply(module& p, match::matcher_result r) const
{
auto ins = r.result;
......@@ -687,11 +693,7 @@ struct find_add_convs
return;
new_op = a_op;
b_input = p.insert_instruction(
ins,
make_op(
"as_shape",
{{"shape", to_value(compute_stride_shape(b_input->get_shape(), n))}}),
b_input);
ins, make_op("step", {{"axes", {2, 3}}, {"steps", {n, n}}}), b_input);
}
else if(b_op.stride < a_op.stride)
{
......@@ -700,11 +702,7 @@ struct find_add_convs
return;
new_op = b_op;
a_input = p.insert_instruction(
ins,
make_op(
"as_shape",
{{"shape", to_value(compute_stride_shape(a_input->get_shape(), n))}}),
a_input);
ins, make_op("step", {{"axes", {2, 3}}, {"steps", {n, n}}}), a_input);
}
else
return;
......
......@@ -376,9 +376,7 @@ struct find_resize
return;
}
arg_ind.visit([&](auto v) { vec_ind.assign(v.begin(), v.end()); });
std::vector<int> index(out_shape.elements());
std::iota(index.begin(), index.end(), 0);
if(not std::all_of(index.begin(), index.end(), [&](auto i) {
if(not all_of(range(out_shape.elements()), [&](auto i) {
auto out_idx = out_shape.multi(i);
auto in_idx = out_idx;
std::transform(out_idx.begin(),
......
#include <migraphx/dom_info.hpp>
#include <migraphx/program.hpp>
#include <basic_ops.hpp>
#include <test.hpp>
TEST_CASE(dom1)
{
migraphx::module mm;
auto ins1 = mm.add_parameter("entry", {migraphx::shape::float_type});
auto ins2 = mm.add_instruction(pass_op{}, ins1);
auto ins3 = mm.add_instruction(pass_op{}, ins2);
auto ins4 = mm.add_instruction(pass_op{}, ins2);
auto ins5 = mm.add_instruction(pass_op{}, ins3, ins4);
auto ins6 = mm.add_instruction(pass_op{}, ins2);
auto dom = migraphx::compute_dominator(mm);
EXPECT(dom.strictly_dominate(ins1, ins2));
EXPECT(dom.strictly_dominate(ins2, ins3));
EXPECT(dom.strictly_dominate(ins2, ins4));
EXPECT(dom.strictly_dominate(ins2, ins5));
EXPECT(dom.strictly_dominate(ins2, ins6));
EXPECT(not dom.strictly_dominate(ins3, ins6));
EXPECT(not dom.strictly_dominate(ins4, ins6));
EXPECT(not dom.strictly_dominate(ins3, ins5));
EXPECT(not dom.strictly_dominate(ins4, ins5));
}
int main(int argc, const char* argv[]) { test::run(argc, argv); }
......@@ -79,8 +79,7 @@ struct pass_op
return {};
return inputs.front();
}
int output_alias(const std::vector<migraphx::shape>&) const { return 0; }
int output_alias(const std::vector<migraphx::shape>& s) const { return s.empty() ? -1 : 0; }
};
struct mod_pass_op
......
......@@ -46,6 +46,39 @@ bool no_allocate(const migraphx::module& m)
return std::none_of(m.begin(), m.end(), [](auto&& ins) { return ins.name() == "allocate"; });
}
bool is_overlap(std::pair<std::size_t, std::size_t> x, std::pair<std::size_t, std::size_t> y)
{
return std::max(x.first, y.first) < std::min(x.second, y.second);
}
std::pair<std::size_t, std::size_t> get_load_interval(migraphx::instruction_ref a)
{
auto v = a->get_operator().to_value();
auto offset = v.at("offset").to<std::size_t>();
auto s = migraphx::from_value<migraphx::shape>(v.at("shape"));
return {offset, offset + s.bytes()};
}
bool is_overlap_load(migraphx::instruction_ref a, migraphx::instruction_ref b)
{
return is_overlap(get_load_interval(a), get_load_interval(b));
}
bool is_disjoint(const std::vector<migraphx::instruction_ref>& inss)
{
for(auto ins1 : inss)
{
for(auto ins2 : inss)
{
if(ins1 == ins2)
continue;
if(is_overlap_load(ins1, ins2))
return false;
}
}
return true;
}
TEST_CASE(test1)
{
migraphx::module m;
......@@ -57,6 +90,7 @@ TEST_CASE(test1)
run_pass(m);
CHECK(m.get_parameter_shape("scratch").bytes() == 192);
CHECK(no_allocate(m));
CHECK(is_disjoint({a1, a2}));
}
TEST_CASE(test2)
......@@ -680,6 +714,3047 @@ TEST_CASE(test39)
CHECK(no_allocate(*else_mod));
}
// NOLINTNEXTLINE
TEST_CASE(rnn_dom)
{
migraphx::module m;
auto mx0 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 10}});
auto mx1 = m.add_instruction(pass_op{});
auto mr = m.add_parameter("r", migraphx::shape{migraphx::shape::float_type, {1, 15, 5}});
auto mx2 = m.add_instruction(pass_op{}, mr);
auto mx3 = m.add_instruction(pass_op{}, mx2);
auto mx4 = m.add_instruction(pass_op{}, mx3);
m.add_instruction(pass_op{});
auto mx6 = m.add_instruction(pass_op{}, mx0, mx1, mx4);
m.add_instruction(pass_op{});
auto mx8 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 15}});
m.add_instruction(pass_op{}, mx8, mx1, mx0, mx6);
auto mseq = m.add_parameter("seq", migraphx::shape{migraphx::shape::float_type, {3, 2, 8}});
auto mx10 = m.add_instruction(pass_op{}, mseq);
auto mx11 = m.add_instruction(pass_op{}, mx10);
auto mw = m.add_parameter("w", migraphx::shape{migraphx::shape::float_type, {1, 15, 8}});
auto mx12 = m.add_instruction(pass_op{}, mw);
auto mx13 = m.add_instruction(pass_op{}, mx12);
m.add_instruction(pass_op{});
auto mx15 = m.add_instruction(pass_op{}, mx8, mx11, mx13);
m.add_instruction(pass_op{}, mx15, mx1, mx0, mx6);
m.add_instruction(pass_op{});
auto mx18 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{}, mx18, mx6, mx15, mx0, mx1, mx8);
auto mx20 = m.add_instruction(pass_op{}, mx6);
m.add_instruction(pass_op{}, mx20, mx8, mx15, mx18);
auto mx22 = m.add_instruction(pass_op{}, mx15);
m.add_instruction(pass_op{}, mx22, mx1, mx0, mx20, mx6, mx18);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx27 = m.add_instruction(pass_op{}, mx18, mx22, mx20);
m.add_instruction(pass_op{}, mx27, mx15, mx8, mx6, mx20, mx1, mx22, mx0);
m.add_instruction(pass_op{});
auto mx30 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{}, mx30, mx20, mx22, mx1, mx15, mx8, mx6, mx27, mx0, mx18);
auto mx32 = m.add_instruction(pass_op{}, mx15);
m.add_instruction(pass_op{}, mx32, mx20, mx30, mx0, mx18, mx1, mx27, mx6);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx36 = m.add_instruction(pass_op{}, mx30, mx32);
m.add_instruction(pass_op{}, mx36, mx32, mx0, mx27, mx8, mx1, mx15, mx6, mx20, mx22, mx18);
auto mx38 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{}, mx38, mx32, mx0, mx27, mx8, mx1, mx15, mx6, mx20, mx22, mx18);
auto mx40 = m.add_instruction(pass_op{}, mx38, mx36);
m.add_instruction(pass_op{}, mx40, mx32, mx0, mx27, mx8, mx1, mx15, mx6, mx20, mx22, mx18);
m.add_instruction(pass_op{});
auto mx43 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{}, mx43, mx15, mx32, mx27, mx30, mx18, mx8, mx40, mx36, mx22, mx38);
auto mx45 = m.add_instruction(pass_op{}, mx6);
m.add_instruction(pass_op{}, mx45, mx32, mx27, mx30, mx18, mx40, mx36, mx22, mx8, mx15, mx38);
auto mx47 = m.add_instruction(pass_op{}, mx15);
m.add_instruction(
pass_op{}, mx47, mx30, mx18, mx43, mx6, mx1, mx45, mx0, mx27, mx36, mx20, mx40, mx38);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx51 = m.add_instruction(pass_op{}, mx43, mx47, mx45);
m.add_instruction(
pass_op{}, mx51, mx15, mx47, mx32, mx27, mx30, mx18, mx8, mx36, mx22, mx40, mx38);
auto mx53 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(
pass_op{}, mx53, mx15, mx47, mx32, mx27, mx30, mx18, mx8, mx36, mx22, mx40, mx38);
auto mx55 = m.add_instruction(pass_op{}, mx53, mx51, mx1);
m.add_instruction(
pass_op{}, mx55, mx15, mx47, mx32, mx27, mx30, mx18, mx8, mx36, mx22, mx40, mx38);
auto mx57 = m.add_instruction(pass_op{}, mx3);
m.add_instruction(pass_op{});
auto mx59 = m.add_instruction(pass_op{}, mx40, mx55, mx57, mx40);
m.add_instruction(
pass_op{}, mx59, mx15, mx8, mx38, mx18, mx30, mx27, mx47, mx32, mx40, mx36, mx22);
auto mx61 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx61,
mx30,
mx15,
mx1,
mx51,
mx20,
mx59,
mx32,
mx45,
mx22,
mx8,
mx47,
mx40,
mx53,
mx6,
mx55,
mx0,
mx43,
mx38,
mx36);
m.add_instruction(pass_op{});
auto mx64 = m.add_instruction(pass_op{}, mx61, mx27, mx1);
m.add_instruction(pass_op{},
mx64,
mx30,
mx15,
mx1,
mx51,
mx20,
mx59,
mx32,
mx45,
mx22,
mx8,
mx47,
mx40,
mx53,
mx6,
mx55,
mx0,
mx43,
mx38,
mx36);
m.add_instruction(pass_op{});
auto mx67 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx67,
mx18,
mx6,
mx1,
mx51,
mx20,
mx59,
mx27,
mx55,
mx43,
mx38,
mx0,
mx61,
mx45,
mx36,
mx40,
mx53,
mx64,
mx30);
auto mx69 = m.add_instruction(pass_op{});
m.add_instruction(pass_op{},
mx69,
mx18,
mx6,
mx1,
mx51,
mx20,
mx59,
mx27,
mx55,
mx43,
mx38,
mx0,
mx61,
mx45,
mx36,
mx40,
mx53,
mx64,
mx30);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx73 = m.add_instruction(pass_op{}, mx67, mx69, mx27);
m.add_instruction(pass_op{},
mx73,
mx18,
mx6,
mx1,
mx51,
mx20,
mx59,
mx27,
mx55,
mx43,
mx38,
mx0,
mx61,
mx45,
mx36,
mx40,
mx53,
mx64,
mx30);
m.add_instruction(pass_op{});
auto mx76 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx76,
mx64,
mx30,
mx18,
mx40,
mx8,
mx61,
mx38,
mx69,
mx67,
mx73,
mx27,
mx47,
mx32,
mx36,
mx15,
mx22);
m.add_instruction(pass_op{});
auto mx79 = m.add_instruction(pass_op{}, mx76, mx59);
m.add_instruction(pass_op{},
mx79,
mx64,
mx30,
mx18,
mx40,
mx8,
mx61,
mx38,
mx69,
mx67,
mx73,
mx27,
mx47,
mx32,
mx36,
mx15,
mx22);
auto mx81 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx81,
mx36,
mx32,
mx27,
mx47,
mx18,
mx30,
mx73,
mx67,
mx22,
mx15,
mx61,
mx8,
mx64,
mx40,
mx69,
mx38);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx85 = m.add_instruction(pass_op{}, mx81, mx73, mx79, mx64);
m.add_instruction(pass_op{},
mx85,
mx36,
mx32,
mx27,
mx47,
mx18,
mx30,
mx73,
mx67,
mx22,
mx15,
mx61,
mx8,
mx64,
mx40,
mx69,
mx38);
m.add_instruction(pass_op{});
auto mx88 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 10}});
m.add_instruction(pass_op{},
mx88,
mx36,
mx32,
mx27,
mx47,
mx18,
mx30,
mx73,
mx67,
mx22,
mx15,
mx61,
mx8,
mx64,
mx40,
mx69,
mx38);
auto mx90 = m.add_instruction(pass_op{}, mx88, mx85, mx4);
m.add_instruction(pass_op{},
mx90,
mx36,
mx32,
mx27,
mx47,
mx18,
mx30,
mx73,
mx67,
mx22,
mx15,
mx61,
mx8,
mx64,
mx40,
mx69,
mx38);
m.add_instruction(pass_op{});
auto mx93 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 15}});
m.add_instruction(pass_op{},
mx93,
mx51,
mx88,
mx20,
mx64,
mx43,
mx61,
mx53,
mx81,
mx47,
mx6,
mx45,
mx0,
mx55,
mx18,
mx76,
mx1,
mx79,
mx85,
mx90,
mx8,
mx69,
mx67,
mx73,
mx32,
mx59,
mx22,
mx15,
mx27);
auto mx95 = m.add_instruction(pass_op{}, mseq);
auto mx96 = m.add_instruction(pass_op{}, mx95);
m.add_instruction(pass_op{});
auto mx98 = m.add_instruction(pass_op{}, mx93, mx96, mx13);
m.add_instruction(pass_op{},
mx98,
mx51,
mx88,
mx20,
mx64,
mx43,
mx61,
mx53,
mx81,
mx47,
mx6,
mx45,
mx0,
mx55,
mx18,
mx76,
mx1,
mx79,
mx85,
mx90,
mx8,
mx69,
mx67,
mx73,
mx32,
mx59,
mx22,
mx15,
mx27);
m.add_instruction(pass_op{});
auto mx101 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx101,
mx43,
mx40,
mx53,
mx59,
mx51,
mx6,
mx61,
mx81,
mx38,
mx45,
mx20,
mx0,
mx76,
mx55,
mx18,
mx85,
mx1,
mx93,
mx79,
mx90,
mx27,
mx88,
mx64,
mx30,
mx98,
mx36);
auto mx103 = m.add_instruction(pass_op{}, mx90);
m.add_instruction(pass_op{},
mx103,
mx64,
mx101,
mx15,
mx67,
mx73,
mx18,
mx40,
mx8,
mx47,
mx98,
mx27,
mx32,
mx61,
mx22,
mx93,
mx69,
mx36,
mx38,
mx30);
auto mx105 = m.add_instruction(pass_op{}, mx98);
m.add_instruction(pass_op{},
mx105,
mx43,
mx88,
mx53,
mx64,
mx59,
mx6,
mx76,
mx61,
mx81,
mx47,
mx103,
mx22,
mx45,
mx0,
mx55,
mx18,
mx85,
mx51,
mx20,
mx1,
mx79,
mx90,
mx8,
mx101,
mx15,
mx69,
mx67,
mx73,
mx32,
mx27);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx110 = m.add_instruction(pass_op{}, mx101, mx105, mx103);
m.add_instruction(pass_op{},
mx110,
mx88,
mx40,
mx93,
mx59,
mx43,
mx61,
mx53,
mx81,
mx103,
mx6,
mx45,
mx0,
mx55,
mx18,
mx64,
mx20,
mx76,
mx1,
mx79,
mx38,
mx85,
mx90,
mx27,
mx30,
mx105,
mx98,
mx51,
mx36);
m.add_instruction(pass_op{});
auto mx113 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx113,
mx59,
mx20,
mx51,
mx1,
mx79,
mx90,
mx55,
mx85,
mx76,
mx81,
mx47,
mx6,
mx38,
mx88,
mx43,
mx40,
mx0,
mx45,
mx53,
mx93,
mx8,
mx101,
mx15,
mx69,
mx67,
mx73,
mx32,
mx110,
mx22,
mx103,
mx30,
mx36,
mx98,
mx105);
auto mx115 = m.add_instruction(pass_op{}, mx98);
m.add_instruction(pass_op{},
mx115,
mx59,
mx20,
mx51,
mx1,
mx79,
mx90,
mx55,
mx18,
mx85,
mx76,
mx61,
mx81,
mx47,
mx6,
mx88,
mx43,
mx0,
mx45,
mx53,
mx64,
mx8,
mx101,
mx15,
mx69,
mx67,
mx73,
mx113,
mx32,
mx110,
mx22,
mx103,
mx27);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx119 = m.add_instruction(pass_op{}, mx113, mx115);
m.add_instruction(pass_op{},
mx119,
mx59,
mx20,
mx51,
mx1,
mx79,
mx90,
mx55,
mx85,
mx76,
mx81,
mx47,
mx6,
mx38,
mx88,
mx43,
mx40,
mx0,
mx45,
mx53,
mx93,
mx8,
mx101,
mx15,
mx69,
mx67,
mx73,
mx32,
mx110,
mx22,
mx103,
mx30,
mx36,
mx115,
mx98,
mx105);
auto mx121 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx121,
mx59,
mx20,
mx51,
mx1,
mx79,
mx90,
mx55,
mx85,
mx76,
mx81,
mx47,
mx6,
mx38,
mx88,
mx43,
mx40,
mx0,
mx45,
mx53,
mx93,
mx8,
mx101,
mx15,
mx69,
mx67,
mx73,
mx32,
mx110,
mx22,
mx103,
mx30,
mx36,
mx115,
mx98,
mx105);
auto mx123 = m.add_instruction(pass_op{}, mx121, mx119);
m.add_instruction(pass_op{},
mx123,
mx59,
mx20,
mx51,
mx1,
mx79,
mx90,
mx55,
mx85,
mx76,
mx81,
mx47,
mx6,
mx38,
mx88,
mx43,
mx40,
mx0,
mx45,
mx53,
mx93,
mx8,
mx101,
mx15,
mx69,
mx67,
mx73,
mx32,
mx110,
mx22,
mx103,
mx30,
mx36,
mx115,
mx98,
mx105);
m.add_instruction(pass_op{});
auto mx126 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx126,
mx115,
mx113,
mx8,
mx67,
mx61,
mx73,
mx18,
mx123,
mx119,
mx32,
mx15,
mx36,
mx110,
mx27,
mx101,
mx22,
mx98,
mx47,
mx40,
mx93,
mx38,
mx69,
mx121,
mx64,
mx30,
mx105);
auto mx128 = m.add_instruction(pass_op{}, mx90);
m.add_instruction(pass_op{},
mx128,
mx93,
mx98,
mx8,
mx67,
mx73,
mx18,
mx123,
mx61,
mx40,
mx47,
mx27,
mx32,
mx101,
mx22,
mx15,
mx110,
mx36,
mx119,
mx38,
mx64,
mx30,
mx69,
mx121,
mx113,
mx115,
mx105);
auto mx130 = m.add_instruction(pass_op{}, mx98);
m.add_instruction(pass_op{},
mx130,
mx119,
mx64,
mx22,
mx110,
mx126,
mx128,
mx121,
mx113,
mx67,
mx90,
mx69,
mx15,
mx20,
mx8,
mx27,
mx51,
mx85,
mx79,
mx123,
mx103,
mx18,
mx55,
mx32,
mx0,
mx45,
mx61,
mx53,
mx76,
mx6,
mx47,
mx59,
mx73,
mx81,
mx88,
mx1,
mx43,
mx101);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx134 = m.add_instruction(pass_op{}, mx126, mx130, mx128);
m.add_instruction(pass_op{},
mx134,
mx130,
mx8,
mx67,
mx61,
mx73,
mx18,
mx123,
mx119,
mx32,
mx15,
mx36,
mx110,
mx27,
mx101,
mx22,
mx113,
mx115,
mx98,
mx47,
mx40,
mx93,
mx38,
mx69,
mx121,
mx64,
mx30,
mx105);
auto mx136 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx136,
mx130,
mx8,
mx67,
mx61,
mx73,
mx18,
mx123,
mx119,
mx32,
mx15,
mx36,
mx110,
mx27,
mx101,
mx22,
mx113,
mx115,
mx98,
mx47,
mx40,
mx93,
mx38,
mx69,
mx121,
mx64,
mx30,
mx105);
auto mx138 = m.add_instruction(pass_op{}, mx136, mx134, mx85);
m.add_instruction(pass_op{},
mx138,
mx130,
mx8,
mx67,
mx61,
mx73,
mx18,
mx123,
mx119,
mx32,
mx15,
mx36,
mx110,
mx27,
mx101,
mx22,
mx113,
mx115,
mx98,
mx47,
mx40,
mx93,
mx38,
mx69,
mx121,
mx64,
mx30,
mx105);
m.add_instruction(pass_op{});
auto mx141 = m.add_instruction(pass_op{}, mx123, mx138, mx57, mx123);
m.add_instruction(pass_op{},
mx141,
mx113,
mx115,
mx130,
mx105,
mx38,
mx93,
mx61,
mx98,
mx27,
mx64,
mx30,
mx119,
mx121,
mx69,
mx8,
mx67,
mx40,
mx47,
mx32,
mx101,
mx22,
mx36,
mx110,
mx15,
mx73,
mx18,
mx123);
auto mx143 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx143,
mx8,
mx73,
mx121,
mx67,
mx101,
mx110,
mx69,
mx15,
mx138,
mx88,
mx43,
mx79,
mx53,
mx61,
mx45,
mx18,
mx0,
mx6,
mx27,
mx22,
mx134,
mx32,
mx1,
mx119,
mx59,
mx85,
mx103,
mx126,
mx64,
mx128,
mx55,
mx76,
mx47,
mx81,
mx90,
mx136,
mx51,
mx141,
mx20,
mx113,
mx123);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx147 = m.add_instruction(pass_op{}, mx143, mx69, mx110);
m.add_instruction(pass_op{},
mx147,
mx8,
mx73,
mx121,
mx67,
mx101,
mx110,
mx69,
mx15,
mx138,
mx88,
mx43,
mx79,
mx53,
mx61,
mx45,
mx18,
mx0,
mx6,
mx27,
mx22,
mx134,
mx32,
mx1,
mx119,
mx59,
mx85,
mx103,
mx126,
mx64,
mx128,
mx55,
mx76,
mx47,
mx81,
mx90,
mx136,
mx51,
mx141,
mx20,
mx113,
mx123);
m.add_instruction(pass_op{});
auto mx150 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx150,
mx30,
mx121,
mx115,
mx98,
mx130,
mx85,
mx88,
mx90,
mx79,
mx1,
mx93,
mx64,
mx18,
mx53,
mx61,
mx38,
mx27,
mx147,
mx0,
mx6,
mx51,
mx40,
mx134,
mx43,
mx119,
mx59,
mx45,
mx76,
mx128,
mx81,
mx136,
mx55,
mx138,
mx123,
mx126,
mx141,
mx103,
mx20,
mx105,
mx113,
mx143,
mx36);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx154 = m.add_instruction(pass_op{}, mx150, mx110, mx85);
m.add_instruction(pass_op{},
mx154,
mx30,
mx121,
mx115,
mx98,
mx130,
mx85,
mx88,
mx90,
mx79,
mx1,
mx93,
mx64,
mx18,
mx53,
mx61,
mx38,
mx27,
mx147,
mx0,
mx6,
mx51,
mx40,
mx134,
mx43,
mx119,
mx59,
mx45,
mx76,
mx128,
mx81,
mx136,
mx55,
mx138,
mx123,
mx126,
mx141,
mx103,
mx20,
mx105,
mx113,
mx143,
mx36);
m.add_instruction(pass_op{});
auto mx157 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx157,
mx101,
mx8,
mx115,
mx130,
mx105,
mx38,
mx147,
mx93,
mx64,
mx61,
mx98,
mx40,
mx27,
mx121,
mx30,
mx154,
mx113,
mx73,
mx119,
mx36,
mx150,
mx69,
mx67,
mx47,
mx110,
mx32,
mx22,
mx15,
mx18,
mx123,
mx143);
m.add_instruction(pass_op{});
auto mx160 = m.add_instruction(pass_op{}, mx157, mx141);
m.add_instruction(pass_op{},
mx160,
mx101,
mx8,
mx115,
mx130,
mx105,
mx38,
mx147,
mx93,
mx64,
mx61,
mx98,
mx40,
mx27,
mx121,
mx30,
mx154,
mx113,
mx73,
mx119,
mx36,
mx150,
mx69,
mx67,
mx47,
mx110,
mx32,
mx22,
mx15,
mx18,
mx123,
mx143);
auto mx162 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx162,
mx101,
mx8,
mx115,
mx130,
mx105,
mx38,
mx147,
mx93,
mx64,
mx61,
mx98,
mx40,
mx27,
mx121,
mx30,
mx154,
mx113,
mx73,
mx119,
mx36,
mx150,
mx69,
mx67,
mx47,
mx110,
mx32,
mx22,
mx15,
mx18,
mx123,
mx143);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx166 = m.add_instruction(pass_op{}, mx162, mx147, mx160, mx154);
m.add_instruction(pass_op{},
mx166,
mx101,
mx8,
mx115,
mx130,
mx105,
mx38,
mx147,
mx93,
mx64,
mx61,
mx98,
mx40,
mx27,
mx121,
mx30,
mx154,
mx113,
mx73,
mx119,
mx36,
mx150,
mx69,
mx67,
mx47,
mx110,
mx32,
mx22,
mx15,
mx18,
mx123,
mx143);
m.add_instruction(pass_op{});
auto mx169 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 15}});
m.add_instruction(pass_op{},
mx169,
mx154,
mx90,
mx88,
mx79,
mx126,
mx15,
mx103,
mx22,
mx134,
mx166,
mx30,
mx73,
mx20,
mx128,
mx160,
mx8,
mx45,
mx0,
mx6,
mx157,
mx53,
mx136,
mx93,
mx47,
mx81,
mx141,
mx85,
mx110,
mx59,
mx1,
mx162,
mx101,
mx36,
mx38,
mx76,
mx143,
mx67,
mx147,
mx150,
mx138,
mx115,
mx105,
mx51,
mx69,
mx40,
mx32,
mx43,
mx55,
mx130,
mx98);
auto mx171 = m.add_instruction(pass_op{}, mseq);
auto mx172 = m.add_instruction(pass_op{}, mx171);
m.add_instruction(pass_op{});
auto mx174 = m.add_instruction(pass_op{}, mx169, mx172, mx13);
m.add_instruction(pass_op{},
mx174,
mx154,
mx90,
mx88,
mx79,
mx126,
mx15,
mx103,
mx22,
mx134,
mx166,
mx30,
mx73,
mx20,
mx128,
mx160,
mx8,
mx45,
mx0,
mx6,
mx157,
mx53,
mx136,
mx93,
mx47,
mx81,
mx141,
mx85,
mx110,
mx59,
mx1,
mx162,
mx101,
mx36,
mx38,
mx76,
mx143,
mx67,
mx147,
mx150,
mx138,
mx115,
mx105,
mx51,
mx69,
mx40,
mx32,
mx43,
mx55,
mx130,
mx98);
m.add_instruction(pass_op{});
auto mx177 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 10}});
m.add_instruction(pass_op{},
mx177,
mx101,
mx8,
mx115,
mx130,
mx105,
mx38,
mx147,
mx93,
mx64,
mx154,
mx61,
mx98,
mx40,
mx27,
mx174,
mx121,
mx30,
mx113,
mx73,
mx119,
mx36,
mx150,
mx69,
mx67,
mx47,
mx110,
mx32,
mx22,
mx169,
mx15,
mx18,
mx123,
mx143);
m.add_instruction(pass_op{});
auto mx180 = m.add_instruction(pass_op{}, mx177, mx166, mx4);
m.add_instruction(pass_op{},
mx180,
mx101,
mx8,
mx115,
mx130,
mx105,
mx38,
mx147,
mx93,
mx64,
mx154,
mx61,
mx98,
mx40,
mx27,
mx174,
mx121,
mx30,
mx113,
mx73,
mx119,
mx36,
mx150,
mx69,
mx67,
mx47,
mx110,
mx32,
mx22,
mx169,
mx15,
mx18,
mx123,
mx143);
m.add_instruction(pass_op{});
auto mx183 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx183,
mx67,
mx90,
mx150,
mx138,
mx88,
mx79,
mx126,
mx15,
mx103,
mx22,
mx134,
mx180,
mx166,
mx174,
mx73,
mx20,
mx154,
mx32,
mx43,
mx55,
mx157,
mx18,
mx0,
mx113,
mx6,
mx76,
mx53,
mx61,
mx177,
mx136,
mx81,
mx141,
mx85,
mx110,
mx64,
mx45,
mx8,
mx169,
mx59,
mx1,
mx162,
mx101,
mx119,
mx51,
mx69,
mx128,
mx160,
mx27,
mx47,
mx123,
mx121);
auto mx185 = m.add_instruction(pass_op{}, mx180);
m.add_instruction(pass_op{},
mx185,
mx101,
mx8,
mx115,
mx130,
mx105,
mx38,
mx147,
mx93,
mx64,
mx154,
mx61,
mx98,
mx40,
mx27,
mx183,
mx174,
mx121,
mx30,
mx113,
mx73,
mx119,
mx36,
mx150,
mx69,
mx67,
mx47,
mx110,
mx32,
mx22,
mx169,
mx15,
mx18,
mx123,
mx143);
auto mx187 = m.add_instruction(pass_op{}, mx174);
m.add_instruction(pass_op{},
mx187,
mx150,
mx128,
mx67,
mx15,
mx88,
mx43,
mx79,
mx126,
mx103,
mx22,
mx90,
mx180,
mx183,
mx166,
mx141,
mx30,
mx20,
mx59,
mx55,
mx38,
mx160,
mx0,
mx32,
mx85,
mx6,
mx76,
mx157,
mx45,
mx162,
mx138,
mx154,
mx53,
mx177,
mx136,
mx51,
mx47,
mx81,
mx93,
mx73,
mx8,
mx110,
mx101,
mx69,
mx185,
mx36,
mx143,
mx147,
mx134,
mx1,
mx130,
mx115,
mx105,
mx40,
mx98);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx192 = m.add_instruction(pass_op{}, mx183, mx187, mx185);
m.add_instruction(pass_op{},
mx192,
mx150,
mx128,
mx67,
mx187,
mx15,
mx88,
mx43,
mx79,
mx126,
mx103,
mx64,
mx22,
mx90,
mx180,
mx141,
mx20,
mx59,
mx134,
mx1,
mx55,
mx113,
mx160,
mx0,
mx32,
mx85,
mx6,
mx76,
mx157,
mx45,
mx162,
mx138,
mx154,
mx53,
mx61,
mx177,
mx174,
mx136,
mx119,
mx185,
mx51,
mx47,
mx81,
mx73,
mx8,
mx110,
mx18,
mx169,
mx101,
mx69,
mx27,
mx123,
mx166,
mx121);
m.add_instruction(pass_op{});
auto mx195 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx195,
mx115,
mx105,
mx98,
mx123,
mx27,
mx126,
mx103,
mx64,
mx183,
mx174,
mx136,
mx177,
mx141,
mx51,
mx93,
mx113,
mx38,
mx160,
mx55,
mx30,
mx61,
mx138,
mx53,
mx76,
mx85,
mx6,
mx20,
mx59,
mx0,
mx40,
mx43,
mx88,
mx79,
mx180,
mx90,
mx187,
mx81,
mx128,
mx157,
mx45,
mx162,
mx134,
mx1,
mx130,
mx147,
mx166,
mx121,
mx18,
mx169,
mx143,
mx119,
mx36,
mx185,
mx192);
auto mx197 = m.add_instruction(pass_op{}, mx174);
m.add_instruction(pass_op{},
mx197,
mx128,
mx150,
mx101,
mx69,
mx126,
mx103,
mx22,
mx166,
mx183,
mx136,
mx177,
mx141,
mx30,
mx73,
mx93,
mx38,
mx160,
mx55,
mx76,
mx32,
mx85,
mx6,
mx20,
mx59,
mx0,
mx43,
mx15,
mx88,
mx79,
mx180,
mx90,
mx67,
mx81,
mx138,
mx154,
mx53,
mx157,
mx45,
mx162,
mx51,
mx47,
mx195,
mx110,
mx8,
mx143,
mx147,
mx134,
mx1,
mx130,
mx115,
mx105,
mx40,
mx98,
mx36,
mx185,
mx192);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx201 = m.add_instruction(pass_op{}, mx195, mx197);
m.add_instruction(pass_op{},
mx201,
mx115,
mx105,
mx98,
mx123,
mx27,
mx126,
mx103,
mx64,
mx183,
mx174,
mx136,
mx177,
mx141,
mx51,
mx93,
mx113,
mx38,
mx160,
mx55,
mx30,
mx61,
mx138,
mx53,
mx76,
mx85,
mx6,
mx20,
mx59,
mx0,
mx40,
mx43,
mx197,
mx88,
mx79,
mx180,
mx90,
mx187,
mx81,
mx128,
mx157,
mx45,
mx162,
mx134,
mx1,
mx130,
mx147,
mx166,
mx121,
mx18,
mx169,
mx143,
mx119,
mx36,
mx185,
mx192);
auto mx203 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx203,
mx115,
mx105,
mx98,
mx123,
mx27,
mx126,
mx103,
mx64,
mx183,
mx174,
mx136,
mx177,
mx141,
mx51,
mx93,
mx113,
mx38,
mx160,
mx55,
mx30,
mx61,
mx138,
mx53,
mx76,
mx85,
mx6,
mx20,
mx59,
mx0,
mx40,
mx43,
mx197,
mx88,
mx79,
mx180,
mx90,
mx187,
mx81,
mx128,
mx157,
mx45,
mx162,
mx134,
mx1,
mx130,
mx147,
mx166,
mx121,
mx18,
mx169,
mx143,
mx119,
mx36,
mx185,
mx192);
auto mx205 = m.add_instruction(pass_op{}, mx203, mx201);
m.add_instruction(pass_op{},
mx205,
mx115,
mx105,
mx98,
mx123,
mx27,
mx126,
mx103,
mx64,
mx183,
mx174,
mx136,
mx177,
mx141,
mx51,
mx93,
mx113,
mx38,
mx160,
mx55,
mx30,
mx61,
mx138,
mx53,
mx76,
mx85,
mx6,
mx20,
mx59,
mx0,
mx40,
mx43,
mx197,
mx88,
mx79,
mx180,
mx90,
mx187,
mx81,
mx128,
mx157,
mx45,
mx162,
mx134,
mx1,
mx130,
mx147,
mx166,
mx121,
mx18,
mx169,
mx143,
mx119,
mx36,
mx185,
mx192);
m.add_instruction(pass_op{});
auto mx208 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx208,
mx30,
mx40,
mx64,
mx93,
mx18,
mx98,
mx115,
mx143,
mx38,
mx147,
mx183,
mx197,
mx150,
mx119,
mx32,
mx8,
mx105,
mx101,
mx110,
mx195,
mx47,
mx27,
mx22,
mx205,
mx121,
mx67,
mx187,
mx113,
mx73,
mx201,
mx130,
mx203,
mx169,
mx69,
mx15,
mx154,
mx61,
mx174,
mx123,
mx36,
mx192);
auto mx210 = m.add_instruction(pass_op{}, mx180);
m.add_instruction(pass_op{},
mx210,
mx143,
mx115,
mx18,
mx93,
mx150,
mx47,
mx187,
mx15,
mx169,
mx69,
mx205,
mx32,
mx119,
mx113,
mx73,
mx201,
mx30,
mx67,
mx121,
mx22,
mx27,
mx40,
mx98,
mx174,
mx61,
mx154,
mx64,
mx147,
mx38,
mx203,
mx130,
mx8,
mx110,
mx105,
mx101,
mx195,
mx183,
mx197,
mx123,
mx36,
mx192);
auto mx212 = m.add_instruction(pass_op{}, mx174);
m.add_instruction(pass_op{},
mx212,
mx32,
mx67,
mx90,
mx15,
mx138,
mx126,
mx103,
mx38,
mx136,
mx180,
mx141,
mx51,
mx30,
mx22,
mx201,
mx59,
mx134,
mx154,
mx150,
mx1,
mx160,
mx45,
mx6,
mx76,
mx88,
mx53,
mx47,
mx183,
mx81,
mx157,
mx93,
mx79,
mx85,
mx0,
mx210,
mx73,
mx8,
mx110,
mx20,
mx69,
mx177,
mx36,
mx143,
mx162,
mx147,
mx130,
mx115,
mx55,
mx105,
mx40,
mx98,
mx208,
mx203,
mx128,
mx205,
mx195,
mx101,
mx185,
mx43,
mx166,
mx192);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx216 = m.add_instruction(pass_op{}, mx208, mx212, mx210);
m.add_instruction(pass_op{},
mx216,
mx121,
mx30,
mx64,
mx93,
mx123,
mx143,
mx119,
mx36,
mx150,
mx8,
mx101,
mx169,
mx147,
mx110,
mx27,
mx61,
mx40,
mx205,
mx115,
mx32,
mx69,
mx67,
mx98,
mx187,
mx195,
mx73,
mx105,
mx183,
mx197,
mx22,
mx113,
mx201,
mx47,
mx130,
mx154,
mx15,
mx212,
mx18,
mx174,
mx38,
mx203,
mx192);
auto mx218 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx218,
mx121,
mx30,
mx64,
mx93,
mx123,
mx143,
mx119,
mx36,
mx150,
mx8,
mx101,
mx169,
mx147,
mx110,
mx27,
mx61,
mx40,
mx205,
mx115,
mx32,
mx69,
mx67,
mx98,
mx187,
mx195,
mx73,
mx105,
mx183,
mx197,
mx22,
mx113,
mx201,
mx47,
mx130,
mx154,
mx15,
mx212,
mx18,
mx174,
mx38,
mx203,
mx192);
auto mx220 = m.add_instruction(pass_op{}, mx218, mx216, mx166);
m.add_instruction(pass_op{},
mx220,
mx121,
mx30,
mx64,
mx93,
mx123,
mx143,
mx119,
mx36,
mx150,
mx8,
mx101,
mx169,
mx147,
mx110,
mx27,
mx61,
mx40,
mx205,
mx115,
mx32,
mx69,
mx67,
mx98,
mx187,
mx195,
mx73,
mx105,
mx183,
mx197,
mx22,
mx113,
mx201,
mx47,
mx130,
mx154,
mx15,
mx212,
mx18,
mx174,
mx38,
mx203,
mx192);
m.add_instruction(pass_op{});
auto mx223 = m.add_instruction(pass_op{}, mx205, mx220, mx57, mx205);
m.add_instruction(pass_op{},
mx223,
mx38,
mx192,
mx203,
mx130,
mx47,
mx143,
mx123,
mx169,
mx121,
mx147,
mx110,
mx27,
mx36,
mx150,
mx119,
mx101,
mx8,
mx64,
mx61,
mx115,
mx32,
mx69,
mx67,
mx98,
mx187,
mx195,
mx73,
mx105,
mx183,
mx197,
mx22,
mx113,
mx201,
mx174,
mx18,
mx93,
mx205,
mx40,
mx30,
mx154,
mx15,
mx212);
auto mx225 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx225,
mx45,
mx59,
mx76,
mx90,
mx218,
mx67,
mx126,
mx103,
mx136,
mx138,
mx15,
mx32,
mx1,
mx160,
mx150,
mx110,
mx51,
mx30,
mx6,
mx157,
mx93,
mx79,
mx85,
mx88,
mx53,
mx154,
mx134,
mx141,
mx180,
mx38,
mx81,
mx223,
mx183,
mx220,
mx210,
mx0,
mx208,
mx20,
mx69,
mx73,
mx185,
mx101,
mx201,
mx22,
mx203,
mx47,
mx128,
mx205,
mx195,
mx8,
mx177,
mx36,
mx55,
mx216,
mx105,
mx115,
mx130,
mx40,
mx98,
mx43,
mx166,
mx192,
mx162,
mx147,
mx143);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx229 = m.add_instruction(pass_op{}, mx225, mx69, mx192);
m.add_instruction(pass_op{},
mx229,
mx45,
mx59,
mx76,
mx90,
mx218,
mx67,
mx126,
mx103,
mx136,
mx138,
mx15,
mx32,
mx1,
mx160,
mx150,
mx110,
mx51,
mx30,
mx6,
mx157,
mx93,
mx79,
mx85,
mx88,
mx53,
mx154,
mx134,
mx141,
mx180,
mx38,
mx81,
mx223,
mx183,
mx220,
mx210,
mx0,
mx208,
mx20,
mx69,
mx73,
mx185,
mx101,
mx201,
mx22,
mx203,
mx47,
mx128,
mx205,
mx195,
mx8,
mx177,
mx36,
mx55,
mx216,
mx105,
mx115,
mx130,
mx40,
mx98,
mx43,
mx166,
mx192,
mx162,
mx147,
mx143);
m.add_instruction(pass_op{});
auto mx232 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx232,
mx160,
mx154,
mx76,
mx43,
mx67,
mx55,
mx187,
mx88,
mx126,
mx197,
mx225,
mx136,
mx59,
mx64,
mx15,
mx212,
mx128,
mx32,
mx218,
mx150,
mx216,
mx110,
mx169,
mx103,
mx113,
mx141,
mx79,
mx223,
mx90,
mx6,
mx18,
mx138,
mx210,
mx85,
mx53,
mx61,
mx45,
mx134,
mx119,
mx180,
mx166,
mx20,
mx0,
mx177,
mx81,
mx208,
mx157,
mx185,
mx1,
mx69,
mx201,
mx174,
mx101,
mx51,
mx22,
mx162,
mx220,
mx203,
mx47,
mx195,
mx73,
mx27,
mx205,
mx229,
mx8,
mx123,
mx121);
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx236 = m.add_instruction(pass_op{}, mx232, mx192, mx166);
m.add_instruction(pass_op{},
mx236,
mx160,
mx154,
mx76,
mx43,
mx67,
mx55,
mx187,
mx88,
mx126,
mx197,
mx225,
mx136,
mx59,
mx64,
mx15,
mx212,
mx128,
mx32,
mx218,
mx150,
mx216,
mx110,
mx169,
mx103,
mx113,
mx141,
mx79,
mx223,
mx90,
mx6,
mx18,
mx138,
mx210,
mx85,
mx53,
mx61,
mx45,
mx134,
mx119,
mx180,
mx166,
mx20,
mx0,
mx177,
mx81,
mx208,
mx157,
mx185,
mx1,
mx69,
mx201,
mx174,
mx101,
mx51,
mx22,
mx162,
mx220,
mx203,
mx47,
mx195,
mx73,
mx27,
mx205,
mx229,
mx8,
mx123,
mx121);
m.add_instruction(pass_op{});
auto mx239 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{},
mx239,
mx38,
mx192,
mx232,
mx203,
mx229,
mx183,
mx154,
mx201,
mx113,
mx174,
mx110,
mx197,
mx36,
mx115,
mx150,
mx98,
mx130,
mx32,
mx101,
mx169,
mx8,
mx64,
mx27,
mx225,
mx22,
mx147,
mx67,
mx205,
mx73,
mx61,
mx105,
mx18,
mx47,
mx123,
mx93,
mx195,
mx119,
mx69,
mx40,
mx187,
mx30,
mx15,
mx143,
mx236,
mx121,
mx212);
m.add_instruction(pass_op{});
auto mx242 = m.add_instruction(pass_op{}, mx239, mx223);
m.add_instruction(pass_op{},
mx242,
mx38,
mx192,
mx232,
mx203,
mx229,
mx183,
mx154,
mx201,
mx113,
mx174,
mx110,
mx197,
mx36,
mx115,
mx150,
mx98,
mx130,
mx32,
mx101,
mx169,
mx8,
mx64,
mx27,
mx225,
mx22,
mx147,
mx67,
mx205,
mx73,
mx61,
mx105,
mx18,
mx47,
mx123,
mx93,
mx195,
mx119,
mx69,
mx40,
mx187,
mx30,
mx15,
mx143,
mx236,
mx121,
mx212);
auto mx244 = add_alloc(m, migraphx::shape{migraphx::shape::float_type, {2, 5}});
m.add_instruction(pass_op{});
m.add_instruction(pass_op{});
auto mx247 = m.add_instruction(pass_op{}, mx244, mx229, mx242, mx236);
auto moutput =
m.add_parameter("output", migraphx::shape{migraphx::shape::float_type, {3, 1, 2, 5}});
auto mx248 = m.add_instruction(pass_op{}, mx247);
auto mx249 = m.add_instruction(pass_op{}, mx166);
auto mx250 = m.add_instruction(pass_op{}, mx85);
m.add_instruction(pass_op{}, moutput, mx250, mx249, mx248);
run_pass(m);
CHECK(m.get_parameter_shape("scratch").bytes() == 1600);
CHECK(no_allocate(m));
CHECK(is_disjoint({mx0, mx8}));
CHECK(is_disjoint({mx0, mx8}));
CHECK(is_disjoint({mx0, mx18, mx8}));
CHECK(is_disjoint({mx0, mx18, mx8}));
CHECK(is_disjoint({mx0, mx18, mx8}));
CHECK(is_disjoint({mx0, mx18, mx8}));
CHECK(is_disjoint({mx0, mx18, mx8}));
CHECK(is_disjoint({mx0, mx18, mx30, mx8}));
CHECK(is_disjoint({mx0, mx18, mx30, mx8}));
CHECK(is_disjoint({mx30, mx8}));
CHECK(is_disjoint({mx0, mx18, mx30, mx8}));
CHECK(is_disjoint({mx0, mx18, mx38, mx8}));
CHECK(is_disjoint({mx30, mx38}));
CHECK(is_disjoint({mx0, mx18, mx38, mx8}));
CHECK(is_disjoint({mx18, mx30, mx38, mx43, mx8}));
CHECK(is_disjoint({mx0, mx18, mx30, mx38, mx8}));
CHECK(is_disjoint({mx0, mx18, mx30, mx38, mx43, mx8}));
CHECK(is_disjoint({mx0, mx43, mx8}));
CHECK(is_disjoint({mx18, mx30, mx38, mx43, mx8}));
CHECK(is_disjoint({mx18, mx30, mx38, mx53, mx8}));
CHECK(is_disjoint({mx43, mx53}));
CHECK(is_disjoint({mx18, mx30, mx38, mx53, mx8}));
CHECK(is_disjoint({mx38, mx53}));
CHECK(is_disjoint({mx18, mx30, mx38, mx8}));
CHECK(is_disjoint({mx0, mx30, mx38, mx43, mx53, mx61, mx8}));
CHECK(is_disjoint({mx18, mx61}));
CHECK(is_disjoint({mx0, mx30, mx38, mx43, mx53, mx61, mx8}));
CHECK(is_disjoint({mx0, mx18, mx30, mx38, mx43, mx53, mx61, mx67}));
CHECK(is_disjoint({mx0, mx18, mx30, mx38, mx43, mx53, mx61}));
CHECK(is_disjoint({mx18, mx67}));
CHECK(is_disjoint({mx0, mx18, mx30, mx38, mx43, mx53, mx61, mx67}));
CHECK(is_disjoint({mx18, mx30, mx38, mx61, mx67, mx76, mx8}));
CHECK(is_disjoint({mx38, mx76}));
CHECK(is_disjoint({mx18, mx30, mx38, mx61, mx67, mx76, mx8}));
CHECK(is_disjoint({mx18, mx30, mx38, mx61, mx67, mx8, mx81}));
CHECK(is_disjoint({mx61, mx67, mx76, mx81}));
CHECK(is_disjoint({mx18, mx30, mx38, mx61, mx67, mx8, mx81}));
CHECK(is_disjoint({mx18, mx30, mx38, mx61, mx67, mx8, mx88}));
CHECK(is_disjoint({mx81, mx88}));
CHECK(is_disjoint({mx18, mx30, mx38, mx61, mx67, mx8, mx88}));
CHECK(is_disjoint({mx0, mx18, mx38, mx43, mx53, mx61, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx0, mx18, mx38, mx43, mx53, mx61, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx0, mx101, mx18, mx30, mx38, mx43, mx53, mx61, mx76, mx81, mx88, mx93}));
CHECK(is_disjoint({mx101, mx18, mx30, mx38, mx61, mx67, mx8, mx88, mx93}));
CHECK(
is_disjoint({mx0, mx101, mx18, mx38, mx43, mx53, mx61, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx101, mx88, mx93}));
CHECK(is_disjoint({mx0, mx101, mx18, mx30, mx38, mx43, mx53, mx61, mx76, mx81, mx88, mx93}));
CHECK(is_disjoint(
{mx0, mx101, mx113, mx30, mx38, mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint(
{mx0, mx101, mx113, mx18, mx38, mx43, mx53, mx61, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx113, mx93}));
CHECK(is_disjoint(
{mx0, mx101, mx113, mx30, mx38, mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint(
{mx0, mx101, mx121, mx30, mx38, mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx113, mx121}));
CHECK(is_disjoint(
{mx0, mx101, mx121, mx30, mx38, mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx101, mx113, mx121, mx126, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint({mx101, mx113, mx121, mx18, mx30, mx38, mx61, mx67, mx8, mx88, mx93}));
CHECK(is_disjoint({mx0,
mx101,
mx113,
mx121,
mx126,
mx18,
mx38,
mx43,
mx53,
mx61,
mx67,
mx76,
mx8,
mx81,
mx88,
mx93}));
CHECK(is_disjoint({mx126, mx88, mx93}));
CHECK(is_disjoint({mx101, mx113, mx121, mx126, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint({mx101, mx113, mx121, mx136, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint({mx126, mx136, mx81}));
CHECK(is_disjoint({mx101, mx113, mx121, mx136, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint({mx121, mx136}));
CHECK(is_disjoint({mx101, mx113, mx121, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint({mx0,
mx101,
mx113,
mx121,
mx126,
mx136,
mx143,
mx18,
mx38,
mx43,
mx53,
mx61,
mx67,
mx76,
mx8,
mx81,
mx88}));
CHECK(is_disjoint({mx101, mx143}));
CHECK(is_disjoint({mx0,
mx101,
mx113,
mx121,
mx126,
mx136,
mx143,
mx18,
mx38,
mx43,
mx53,
mx61,
mx67,
mx76,
mx8,
mx81,
mx88}));
CHECK(is_disjoint({mx0,
mx113,
mx121,
mx126,
mx136,
mx143,
mx150,
mx18,
mx30,
mx38,
mx43,
mx53,
mx61,
mx76,
mx81,
mx88,
mx93}));
CHECK(is_disjoint({mx101, mx150, mx81}));
CHECK(is_disjoint({mx0,
mx113,
mx121,
mx126,
mx136,
mx143,
mx150,
mx18,
mx30,
mx38,
mx43,
mx53,
mx61,
mx76,
mx81,
mx88,
mx93}));
CHECK(is_disjoint(
{mx101, mx113, mx121, mx143, mx150, mx157, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint({mx121, mx157}));
CHECK(is_disjoint(
{mx101, mx113, mx121, mx143, mx150, mx157, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint(
{mx101, mx113, mx121, mx143, mx150, mx162, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint({mx143, mx150, mx157, mx162}));
CHECK(is_disjoint(
{mx101, mx113, mx121, mx143, mx150, mx162, mx18, mx30, mx38, mx61, mx67, mx8, mx93}));
CHECK(is_disjoint({mx0, mx101, mx121, mx126, mx136, mx143, mx150, mx157, mx162, mx169,
mx30, mx38, mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx0, mx101, mx121, mx126, mx136, mx143, mx150, mx157, mx162, mx169,
mx30, mx38, mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx177,
mx18,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx162, mx177}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx177,
mx18,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx0, mx101, mx113, mx121, mx126, mx136, mx150, mx157, mx162, mx169, mx177,
mx18, mx183, mx38, mx43, mx53, mx61, mx67, mx76, mx8, mx81, mx88}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx177,
mx18,
mx183,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(
is_disjoint({mx0, mx101, mx121, mx126, mx136, mx143, mx150, mx157, mx162, mx169, mx177,
mx183, mx30, mx38, mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx169, mx177, mx183}));
CHECK(is_disjoint({mx0, mx101, mx113, mx121, mx126, mx136, mx150, mx157, mx162, mx169, mx177,
mx18, mx183, mx38, mx43, mx53, mx61, mx67, mx76, mx8, mx81, mx88}));
CHECK(
is_disjoint({mx0, mx113, mx121, mx126, mx136, mx143, mx157, mx162, mx169, mx177, mx18,
mx183, mx195, mx30, mx38, mx43, mx53, mx61, mx76, mx81, mx88, mx93}));
CHECK(is_disjoint({mx0, mx101, mx121, mx126, mx136, mx143, mx150, mx157,
mx162, mx169, mx177, mx183, mx195, mx30, mx38, mx43,
mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx169, mx195}));
CHECK(
is_disjoint({mx0, mx113, mx121, mx126, mx136, mx143, mx157, mx162, mx169, mx177, mx18,
mx183, mx195, mx30, mx38, mx43, mx53, mx61, mx76, mx81, mx88, mx93}));
CHECK(
is_disjoint({mx0, mx113, mx121, mx126, mx136, mx143, mx157, mx162, mx169, mx177, mx18,
mx183, mx203, mx30, mx38, mx43, mx53, mx61, mx76, mx81, mx88, mx93}));
CHECK(is_disjoint({mx195, mx203}));
CHECK(
is_disjoint({mx0, mx113, mx121, mx126, mx136, mx143, mx157, mx162, mx169, mx177, mx18,
mx183, mx203, mx30, mx38, mx43, mx53, mx61, mx76, mx81, mx88, mx93}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx18,
mx183,
mx195,
mx203,
mx208,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx177,
mx18,
mx183,
mx195,
mx203,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx0, mx101, mx121, mx126, mx136, mx143, mx150, mx157, mx162,
mx169, mx177, mx183, mx195, mx203, mx208, mx30, mx38, mx43,
mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx169, mx177, mx208}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx18,
mx183,
mx195,
mx203,
mx208,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx18,
mx183,
mx195,
mx203,
mx218,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx162, mx208, mx218}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx18,
mx183,
mx195,
mx203,
mx218,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx203, mx218}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx18,
mx183,
mx195,
mx203,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx0, mx101, mx121, mx126, mx136, mx143, mx150, mx157, mx162,
mx177, mx183, mx195, mx203, mx208, mx218, mx225, mx30, mx38,
mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx183, mx225}));
CHECK(is_disjoint({mx0, mx101, mx121, mx126, mx136, mx143, mx150, mx157, mx162,
mx177, mx183, mx195, mx203, mx208, mx218, mx225, mx30, mx38,
mx43, mx53, mx67, mx76, mx8, mx81, mx88, mx93}));
CHECK(is_disjoint({mx0, mx101, mx113, mx121, mx126, mx136, mx150, mx157, mx162,
mx169, mx177, mx18, mx195, mx203, mx208, mx218, mx225, mx232,
mx38, mx43, mx53, mx61, mx67, mx76, mx8, mx81, mx88}));
CHECK(is_disjoint({mx162, mx183, mx232}));
CHECK(is_disjoint({mx0, mx101, mx113, mx121, mx126, mx136, mx150, mx157, mx162,
mx169, mx177, mx18, mx195, mx203, mx208, mx218, mx225, mx232,
mx38, mx43, mx53, mx61, mx67, mx76, mx8, mx81, mx88}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx18,
mx183,
mx195,
mx203,
mx225,
mx232,
mx239,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx203, mx239}));
CHECK(is_disjoint({mx101,
mx113,
mx121,
mx143,
mx150,
mx169,
mx18,
mx183,
mx195,
mx203,
mx225,
mx232,
mx239,
mx30,
mx38,
mx61,
mx67,
mx8,
mx93}));
CHECK(is_disjoint({mx225, mx232, mx239, mx244}));
CHECK(is_disjoint({mx162, mx244, mx81}));
}
TEST_CASE(literal_test)
{
migraphx::program p;
......
......@@ -1549,4 +1549,23 @@ TEST_CASE(prefix_scan_sum)
}
}
TEST_CASE(step_test)
{
migraphx::shape s1{migraphx::shape::float_type, {1, 2, 4}};
{
migraphx::shape s2{migraphx::shape::float_type, {1, 1, 2}, {8, 8, 3}};
expect_shape(s2, migraphx::make_op("step", {{"axes", {1, 2}}, {"steps", {2, 3}}}), s1);
}
{
migraphx::shape s{migraphx::shape::float_type, {1, 2, 4}};
throws_shape(migraphx::make_op("step", {{"axes", {1, 2}}, {"steps", {1}}}), s1);
}
{
migraphx::shape s{migraphx::shape::float_type, {1, 2, 4}};
throws_shape(migraphx::make_op("step", {{"axes", {2, 3}}, {"steps", {2, 3}}}), s1);
}
}
int main(int argc, const char* argv[]) { test::run(argc, argv); }
......@@ -3847,6 +3847,42 @@ TEST_CASE(squeeze_test)
}
}
TEST_CASE(step_test)
{
{
migraphx::program p;
auto* mm = p.get_main_module();
std::vector<float> data(2 * 4 * 6);
std::iota(data.begin(), data.end(), 2);
migraphx::shape s1{migraphx::shape::float_type, {2, 1, 4, 6}};
auto l0 = mm->add_literal(migraphx::literal{s1, data});
auto r = mm->add_instruction(
migraphx::make_op("step", {{"axes", {0, 2, 3}}, {"steps", {2, 2, 3}}}), l0);
mm->add_return({r});
p.compile(migraphx::ref::target{});
auto result = p.eval({}).back();
migraphx::shape s2{migraphx::shape::float_type, {1, 1, 2, 2}};
EXPECT(result.get_shape() == s2);
}
{
migraphx::program p;
auto* mm = p.get_main_module();
std::vector<float> data(2 * 4 * 6);
std::iota(data.begin(), data.end(), 2);
migraphx::shape s1{migraphx::shape::float_type, {2, 1, 4, 6}};
auto l0 = mm->add_literal(migraphx::literal{s1, data});
auto tl = mm->add_instruction(migraphx::make_op("transpose", {{"dims", {0, 2, 3, 1}}}), l0);
auto r = mm->add_instruction(
migraphx::make_op("step", {{"axes", {0, 1, 2}}, {"steps", {2, 2, 3}}}), tl);
mm->add_return({r});
p.compile(migraphx::ref::target{});
auto result = p.eval({}).back();
migraphx::shape s2{migraphx::shape::float_type, {1, 2, 2, 1}};
EXPECT(result.get_shape() == s2);
}
}
TEST_CASE(sub_test)
{
migraphx::program p;
......
......@@ -774,6 +774,31 @@ TEST_CASE(inception_resnet)
t.check_conflicts(m, {c1, {i1}});
}
TEST_CASE(dominate_conflicts)
{
scheduler t{};
migraphx::module m;
auto one = m.add_literal(1);
auto onep1 = m.add_instruction(unary_op{}, one);
auto onep2 = m.add_instruction(unary_op{}, one);
auto binary1 = m.add_instruction(nary_op{}, onep1, onep2);
auto onep3 = m.add_instruction(unary_op{}, binary1);
auto onep4 = m.add_instruction(unary_op{}, binary1);
auto binary2 = m.add_instruction(nary_op{}, onep3, onep4);
t.run_pass(m);
EXPECT(t.get_stream(onep1) != t.get_stream(onep2));
EXPECT(t.get_stream(onep3) != t.get_stream(onep4));
EXPECT(get_wait_for(binary1) ==
get_wait_for(t.get_stream(binary1), {t.get_stream(onep1), t.get_stream(onep2)}));
t.check_conflicts(m, {{onep1}, {onep2}});
t.check_conflicts(m, {{onep3}, {onep4}});
t.check_conflicts(m, {{onep1, onep2}, {onep3, onep4}}, false);
t.check_conflicts(m, {{binary1}, {binary2}}, false);
}
TEST_CASE(inception1)
{
scheduler t{};
......
......@@ -2132,4 +2132,32 @@ TEST_CASE(reorder_slice_trans_diff_perm)
test(4);
}
TEST_CASE(reorder_slice_ins_deps)
{
auto create_module = [] {
migraphx::module m;
migraphx::shape sx{migraphx::shape::float_type, {4, 2}};
migraphx::shape sy{migraphx::shape::float_type, {2, 2}};
std::vector<float> datax = {0, 1, 2, 3, 4, 5, 6, 7};
std::vector<float> datay = {0, 1, 2, 3};
auto inx = m.add_literal(migraphx::literal(sx, datax));
auto iny = m.add_literal(migraphx::literal(sy, datay));
auto slc0 = m.add_instruction(
migraphx::make_op("slice", {{"axes", {0}}, {"starts", {0}}, {"ends", {2}}}), inx);
auto slc1 = m.add_instruction(
migraphx::make_op("slice", {{"axes", {0}}, {"starts", {2}}, {"ends", {4}}}), inx);
auto n0 = m.add_instruction(migraphx::make_op("neg"), slc0);
auto a0 = m.add_instruction(migraphx::make_op("add"), n0, slc1);
auto m0 = m.add_instruction(migraphx::make_op("mul"), a0, iny);
auto r = m.add_instruction(migraphx::make_op("add"), m0, slc0);
m.add_return({r});
return m;
};
auto m = create_module();
run_pass(m);
EXPECT(m == create_module());
}
int main(int argc, const char* argv[]) { test::run(argc, argv); }
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct test_step : verify_program<test_step>
{
migraphx::program create_program() const
{
migraphx::program p;
auto* mm = p.get_main_module();
migraphx::shape s1{migraphx::shape::float_type, {2, 1, 4, 6}};
auto l0 = mm->add_parameter("x", s1);
auto r = mm->add_instruction(
migraphx::make_op("step", {{"axes", {0, 2, 3}}, {"steps", {2, 2, 3}}}), l0);
mm->add_return({r});
return p;
}
};
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct test_step_broadcast_transpose : verify_program<test_step_broadcast_transpose>
{
migraphx::program create_program() const
{
migraphx::program p;
auto* mm = p.get_main_module();
migraphx::shape s1{migraphx::shape::float_type, {1, 1, 1, 6}};
auto l0 = mm->add_parameter("x", s1);
auto ml = mm->add_instruction(
migraphx::make_op("multibroadcast", {{"output_lens", {2, 1, 4, 6}}}), l0);
auto tl = mm->add_instruction(migraphx::make_op("transpose", {{"dims", {0, 2, 3, 1}}}), ml);
auto r = mm->add_instruction(
migraphx::make_op("step", {{"axes", {0, 1, 2}}, {"steps", {2, 2, 3}}}), tl);
mm->add_return({r});
return p;
}
};
#include "verify_program.hpp"
#include <migraphx/program.hpp>
#include <migraphx/generate.hpp>
#include <migraphx/make_op.hpp>
struct test_step_transpose : verify_program<test_step_transpose>
{
migraphx::program create_program() const
{
migraphx::program p;
auto* mm = p.get_main_module();
migraphx::shape s1{migraphx::shape::float_type, {2, 1, 4, 6}};
auto l0 = mm->add_parameter("x", s1);
auto tl = mm->add_instruction(migraphx::make_op("transpose", {{"dims", {0, 2, 3, 1}}}), l0);
auto r = mm->add_instruction(
migraphx::make_op("step", {{"axes", {0, 1, 2}}, {"steps", {2, 2, 3}}}), tl);
mm->add_return({r});
return p;
}
};
......@@ -12,23 +12,15 @@ PREFIX=/usr/local
REQ_FILE_DIR=""
if [ "$#" -ge 2 ]; then
PREFIX=$1
REQ_FILE_DIR=$2
cd $2
elif [ "$#" -eq 1 ]; then
PREFIX=$1
fi
echo "Dependencies are install at $PREFIX"
# Manually ignore rocm dependencies
cget -p $PREFIX ignore \
RadeonOpenCompute/clang-ocl \
ROCm-Developer-Tools/HIP \
ROCmSoftwarePlatform/MIOpen \
ROCmSoftwarePlatform/MIOpenGEMM \
ROCmSoftwarePlatform/rocBLAS
cget -p $PREFIX init --cxx /opt/rocm/llvm/bin/clang++ --cc /opt/rocm/llvm/bin/clang
cget -p $PREFIX install -f ${REQ_FILE_DIR}dev-requirements.txt
cget -p $PREFIX install oneapi-src/oneDNN@v1.7
# Install deps with rbuild
rbuild prepare -d $PREFIX -s develop
# install onnx package for unit tests
pip3 install onnx==1.8.1 numpy==1.18.5 typing==3.7.4 pytest==6.0.1 packaging==16.8
......
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