Skip to content

Commit

Permalink
fix(compiler): [GPU+DFR runtime] add sanity check to prevent both dat…
Browse files Browse the repository at this point in the history
…aflow parallelization and GPU offload to be activated jointly as this is not yet supported.
  • Loading branch information
antoniupop committed Jul 23, 2024
1 parent 1ff6e84 commit cf32638
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,6 @@ CompilerEngine::compile(mlir::ModuleOp moduleOp, Target target,
if (loopParallelize)
mlir::concretelang::dfr::_dfr_set_use_omp(true);

if (dataflowParallelize)
mlir::concretelang::dfr::_dfr_set_required(true);

// Sanity checks for enabling GPU usage: the compiler must have been
// compiled with Cuda support (especially important when building
// python wheels), and at least one device must be available to
Expand Down Expand Up @@ -340,8 +337,22 @@ CompilerEngine::compile(mlir::ModuleOp moduleOp, Target target,
options.batchTFHEOps = false;
}
}

// Finally for now we cannot allow dataflow parallelization at the
// same time as GPU usage. This restriction will be relaxed later.
if (dataflowParallelize) {
warnx("Dataflow parallelization and GPU offloading have both been "
"requested. This is not currently supported. Continuing without "
"dataflow parallelization.");
dataflowParallelize = false;
}
}

// If dataflow parallelization will proceed, mark it for
// initialising the runtime
if (dataflowParallelize)
mlir::concretelang::dfr::_dfr_set_required(true);

mlir::OwningOpRef<mlir::ModuleOp> mlirModuleRef(moduleOp);
res.mlirModuleRef = std::move(mlirModuleRef);
mlir::ModuleOp module = res.mlirModuleRef->get();
Expand Down

0 comments on commit cf32638

Please sign in to comment.