mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 20:25:34 -05:00
feat(compiler): Add support for full unrolling of loops with SDFG-convertible ops
This adds a new option `--unroll-loops-with-sdfg-convertible-ops`, which causes loops containing SDFG-convertible operations to be fully unrolled upon the extraction of SDFG-operations using the `--emit-sdfg-ops` switch. This avoids constant roundtrips between an SDFG-capable accelerator and the host during execution of a loop. The option is limited to `scf.for` loops with static bounds and a static step size. Since full unrolling of loops with large bounds results in a large number of operations, the option is disabled by default.
This commit is contained in:
@@ -399,8 +399,9 @@ CompilerEngine::compile(llvm::SourceMgr &sm, Target target, OptionalLib lib) {
|
||||
// Extract SDFG data flow graph from BConcrete representation
|
||||
|
||||
if (options.emitSDFGOps) {
|
||||
if (mlir::concretelang::pipeline::extractSDFGOps(mlirContext, module,
|
||||
enablePass)
|
||||
if (mlir::concretelang::pipeline::extractSDFGOps(
|
||||
mlirContext, module, enablePass,
|
||||
options.unrollLoopsWithSDFGConvertibleOps)
|
||||
.failed()) {
|
||||
return errorDiag(
|
||||
"Extraction of SDFG operations from BConcrete representation failed");
|
||||
|
||||
Reference in New Issue
Block a user