

use a decorator def matmul_v1 ( N, L, M, dtype ): A = te. placeholder (( N, L ), name = "A", dtype = dtype ) B = te. placeholder (( L, M ), name = "B", dtype = dtype ) k = te. reduce_axis (( 0, L ), name = "k" ) C = te. sum ( A * B, axis = k ), name = "C" ) s = te.
#Motrix definition code#
Here we make four modifications to the previous schedule code and get a reorder ( yo, xo, k, yi, xi ) return s, schedule according to config yo, yi = s. We can explain the modifications one by one. Get a config object: You can regard this cfg as an argument of Use a decorator to mark this function as a simple template. This function but we obtain it in a different way. With this argument, thisįunction is no longer a deterministic schedule. Instead, we can passĭifferent configurations to this function and get different schedules. To make the template function more compact, we can do two things to define Aįunction that uses a configuration object like this is called a “template”. The parameter search space within a single function.ĭefine a search space across a set values. This is done by makingĬfg a ConfigSpace object.

Tunable knobs in this function and build a search space from it. Schedule according to an entity in this space. This is done by makingĬonfigEntity, it will ignore all space definition API (namely,Ĭfg.define_XXXXX(.)). Values for all tunable knobs, and we schedule according to these values.ĭuring auto-tuning, we will first call this template with aĬonfigSpace object to build the search space. Template with different ConfigEntity in the built space to getĭifferent schedules.
#Motrix definition mods#
YO YO MINI MOTRIX MODS CODEįinally we will measure the code generated byĭifferent schedules and pick the best one.ĭefine two tunable knobs. The configuration knobs are passed to the split schedule These two knobs are independent, so they span a search space with size 25 = The second one is tile_x with a same list of possible values.
