qat.frontend.builder module

class BuilderFrontend(model, pipeline=None)

Bases: BaseFrontend

Allows a PurrInstructionBuilder to be used as an input to the compiler.

Parses the PurrInstructionBuilder into a InstructionBuilder containing QAT IR instructions, and then runs a pipeline to sanitise the IR.

Parameters:

model (PhysicalHardwareModel) – The hardware model is used to validate that the instruction builder is compatible with the target hardware.

check_and_return_source(src)

Checks that the source is a PurrInstructionBuilder and returns it.

Return type:

bool | InstructionBuilder

emit(src, res_mgr, met_mgr, *args, **kwargs)

Parses the PuRR instruction builder and returns it as QAT IR.

Parameters:

src (InstructionBuilder) – The source instruction builder to parse. Must be a PurrInstructionBuilder.

Return type:

InstructionBuilder