Currently, SmartSim cannot be built correctly (i.e. with all necessary dependencies) without the ML backends.
To reproduce this, build SmartSim using smart build --no_tf --no_pt and start an Orchestrator with the following Python snippet taken from the tutorials:
from smartsim import Experiment
exp = Experiment("tutorial-smartredis", launcher="local")
db = exp.create_database(db_nodes=1,port=6899,interface="lo")
exp.start(db)
The code will fail due to a missing RedisAI installation with the error
smartsim.error.errors.SSConfigError: RedisAI dependency not found. Build with `smart` cli or specify RAI_PATH
The reason is that after RedisAI is built using the smart tool, the resulting library is only installed to the lib folder if and only if the folder backends/ exists, which it does not if no backends are installed. Since after this step the original build folder is deleted and with it the compiled library.
This problem does not occur if any of the backends (TF, PT, ONNX) is installed. However, since they are not needed for many applications it would additional complications and effort to compile them if not necessary. Also compiling RedisAI by itself on pointing RAI_PATH to the installation also works, but poses additional effort.
To circumvent this problem this PR proposes to simply install the RedisAI library by itself if it was built.
Currently, SmartSim cannot be built correctly (i.e. with all necessary dependencies) without the ML backends. To reproduce this, build SmartSim using
smart build --no_tf --no_pt
and start an Orchestrator with the following Python snippet taken from the tutorials:The code will fail due to a missing RedisAI installation with the error
The reason is that after RedisAI is built using the
smart
tool, the resulting library is only installed to thelib
folder if and only if the folderbackends/
exists, which it does not if no backends are installed. Since after this step the original build folder is deleted and with it the compiled library.This problem does not occur if any of the backends (TF, PT, ONNX) is installed. However, since they are not needed for many applications it would additional complications and effort to compile them if not necessary. Also compiling RedisAI by itself on pointing
RAI_PATH
to the installation also works, but poses additional effort.To circumvent this problem this PR proposes to simply install the RedisAI library by itself if it was built.