mirror of
https://github.com/zama-ai/concrete.git
synced 2026-04-17 03:00:54 -04: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:
@@ -183,6 +183,12 @@ llvm::cl::opt<bool> emitSDFGOps(
|
||||
" graphs and emit them."),
|
||||
llvm::cl::init(false));
|
||||
|
||||
llvm::cl::opt<bool> unrollLoopsWithSDFGConvertibleOps(
|
||||
"unroll-loops-with-sdfg-convertible-ops",
|
||||
llvm::cl::desc("Causes loops containing SDFG-convertible operations to be "
|
||||
"fully unrolled."),
|
||||
llvm::cl::init(false));
|
||||
|
||||
llvm::cl::opt<bool> dataflowParallelize(
|
||||
"parallelize-dataflow",
|
||||
llvm::cl::desc(
|
||||
@@ -316,6 +322,8 @@ cmdlineCompilationOptions() {
|
||||
options.dataflowParallelize = cmdline::dataflowParallelize;
|
||||
options.batchConcreteOps = cmdline::batchConcreteOps;
|
||||
options.emitSDFGOps = cmdline::emitSDFGOps;
|
||||
options.unrollLoopsWithSDFGConvertibleOps =
|
||||
cmdline::unrollLoopsWithSDFGConvertibleOps;
|
||||
options.optimizeConcrete = cmdline::optimizeConcrete;
|
||||
options.emitGPUOps = cmdline::emitGPUOps;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user