Automatic scheduling with custom IO times

It is possible to specify the IO times and provide those to the scheduling.

from b_asic.core_operations import Butterfly, ConstantMultiplication
from b_asic.list_schedulers import HybridScheduler
from b_asic.logger import getLogger
from b_asic.schedule import Schedule
from b_asic.scheduler import ALAPScheduler, ASAPScheduler
from b_asic.sfg_generators import radix_2_dif_fft

getLogger("list_scheduler", console_log_level="debug")

points = 8
sfg = radix_2_dif_fft(points=points)

The SFG is:

sfg
%3 in0 in0 bfly0 bfly0 in0->bfly0 0 bfly1 bfly1 bfly0->bfly1 0 0 bfly2 bfly2 bfly0->bfly2 0 1 in1 in1 bfly8 bfly8 in1->bfly8 0 cmul2 cmul2 bfly8->cmul2 1 bfly7 bfly7 bfly8->bfly7 0 0 in2 in2 bfly11 bfly11 in2->bfly11 0 bfly11->bfly1 1 0 cmul0 cmul0 bfly11->cmul0 1 in3 in3 bfly6 bfly6 in3->bfly6 0 cmul3 cmul3 bfly6->cmul3 1 bfly6->bfly7 1 0 in4 in4 in4->bfly0 1 in5 in5 in5->bfly8 1 in6 in6 in6->bfly11 1 in7 in7 in7->bfly6 1 out0 out0 bfly9 bfly9 bfly9->out0 0 out4 out4 bfly9->out4 1 out1 out1 bfly3 bfly3 bfly3->out1 0 out5 out5 bfly3->out5 1 out2 out2 bfly10 bfly10 bfly10->out2 0 out6 out6 bfly10->out6 1 out3 out3 bfly4 bfly4 bfly4->out3 0 out7 out7 bfly4->out7 1 bfly1->bfly9 0 0 bfly1->bfly10 0 1 bfly2->bfly3 0 0 bfly2->bfly4 0 1 cmul0->bfly2 1 cmul1 cmul1 cmul1->bfly4 1 bfly5 bfly5 bfly5->bfly3 1 0 bfly5->cmul1 1 cmul2->bfly5 0 cmul3->bfly5 1 bfly7->bfly9 1 0 cmul4 cmul4 bfly7->cmul4 1 cmul4->bfly10 1


Set latencies and execution times.

sfg.set_latency_of_type_name(Butterfly.type_name(), 1)
sfg.set_latency_of_type_name(ConstantMultiplication.type_name(), 3)
sfg.set_execution_time_of_type_name(Butterfly.type_name(), 1)
sfg.set_execution_time_of_type_name(ConstantMultiplication.type_name(), 1)

Generate an ASAP schedule for reference with custom IO times.

input_times = {f"in{i}": i for i in range(points)}
output_delta_times = {f"out{i}": i for i in range(points)}
schedule1 = Schedule(sfg, scheduler=ASAPScheduler(input_times, output_delta_times))
schedule1.show()
auto scheduling with custom io times

Generate an ALAP schedule for reference with custom IO times..

schedule_t = Schedule(sfg, scheduler=ALAPScheduler(input_times, output_delta_times))
schedule_t.show()
auto scheduling with custom io times

Generate a non-cyclic Schedule from HybridScheduler with custom IO times, one input and output per time unit and one butterfly/multiplication per time unit.

auto scheduling with custom io times

Generate a new Schedule with cyclic scheduling enabled.

schedule3 = Schedule(
    sfg,
    scheduler=HybridScheduler(
        resources,
        input_times=input_times,
        output_delta_times=output_delta_times,
    ),
    schedule_time=14,
    cyclic=True,
)
schedule3.show()
auto scheduling with custom io times

Generate a new Schedule with even less scheduling time.

schedule4 = Schedule(
    sfg,
    scheduler=HybridScheduler(
        resources,
        input_times=input_times,
        output_delta_times=output_delta_times,
    ),
    schedule_time=13,
    cyclic=True,
)
schedule4.show()
auto scheduling with custom io times

Try scheduling for 12 cycles, which gives full butterfly usage.

schedule5 = Schedule(
    sfg,
    scheduler=HybridScheduler(
        resources,
        input_times=input_times,
        output_delta_times=output_delta_times,
    ),
    schedule_time=12,
    cyclic=True,
)
schedule5.show()
auto scheduling with custom io times

Total running time of the script: (0 minutes 2.529 seconds)

Gallery generated by Sphinx-Gallery