mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-09 03:55:04 -05:00
feat: throw clear error if DF jit-exec is not supported
was previously getting an undefined symbol error as the runtime lib didn't support dataflow execution
This commit is contained in:
@@ -38,6 +38,8 @@ public:
|
||||
llvm::Expected<std::unique_ptr<clientlib::PublicResult>>
|
||||
call(clientlib::PublicArguments &args);
|
||||
|
||||
void setUseDataflow(bool option) { this->useDataflow = option; }
|
||||
|
||||
private:
|
||||
/// invokeRaw execute the jit lambda with a list of Argument, the last one is
|
||||
/// used to store the result of the computation.
|
||||
@@ -52,6 +54,10 @@ private:
|
||||
mlir::LLVM::LLVMFunctionType type;
|
||||
std::string name;
|
||||
std::unique_ptr<mlir::ExecutionEngine> engine;
|
||||
// Tell if the DF parallelization was on or during compilation. This will be
|
||||
// useful to abort execution if the runtime doesn't support dataflow
|
||||
// execution, instead of having undefined symbol issues
|
||||
bool useDataflow = false;
|
||||
};
|
||||
|
||||
} // namespace concretelang
|
||||
|
||||
@@ -45,6 +45,9 @@ JITSupport::compile(llvm::SourceMgr &program, CompilationOptions options) {
|
||||
}
|
||||
auto result = std::make_unique<JitCompilationResult>();
|
||||
result->lambda = std::shared_ptr<concretelang::JITLambda>(std::move(*lambda));
|
||||
// Mark the lambda as compiled using DF parallelization
|
||||
result->lambda->setUseDataflow(options.dataflowParallelize ||
|
||||
options.autoParallelize);
|
||||
result->clientParameters =
|
||||
compilationResult.get().clientParameters.getValue();
|
||||
return std::move(result);
|
||||
|
||||
@@ -77,6 +77,13 @@ uint64_t numArgOfRankedMemrefCallingConvention(uint64_t rank) {
|
||||
|
||||
llvm::Expected<std::unique_ptr<clientlib::PublicResult>>
|
||||
JITLambda::call(clientlib::PublicArguments &args) {
|
||||
#ifndef CONCRETELANG_PARALLEL_EXECUTION_ENABLED
|
||||
if (this->useDataflow) {
|
||||
return StreamStringError(
|
||||
"call: current runtime doesn't support dataflow execution, while "
|
||||
"compilation used dataflow parallelization");
|
||||
}
|
||||
#endif
|
||||
// invokeRaw needs to have pointers on arguments and a pointers on the result
|
||||
// as last argument.
|
||||
// Prepare the outputs vector to store the output value of the lambda.
|
||||
|
||||
Reference in New Issue
Block a user