Requirements :
- Linux or Macos
- Python 310.10 or 3.11
Install the latest version by tag, such as
pip install git+https://github.com/acceleratedscience/openad_service_utils.git@0.3.0
Look under the examples folder for implementations of models.
set the following variables in the os host or python script to your private s3 buckets:
import os
os.environ["GT4SD_S3_HOST"] = "s3.<region>.amazonaws.com"
os.environ["GT4SD_S3_ACCESS_KEY"] = ""
os.environ["GT4SD_S3_SECRET_KEY"] = ""
os.environ["GT4SD_S3_HOST_HUB"] = "s3.<region>.amazonaws.com"
os.environ["GT4SD_S3_ACCESS_KEY_HUB"] = ""
os.environ["GT4SD_S3_SECRET_KEY_HUB"] = ""
This feature allows you to define a service as ansynchronously capable. It generates a unique id for the job at random using UUID and will store the result for 3 days before deleting. the user can request the result at any time in the 3 days.
the environment variable 'ASYNC_ALLOW' mut be set for it to work.
import os
os.environ["ASYNC_ALLOW"] = True
Example:
OpenAD:DEFAULT >> pserve generate with MySimpleGenerator data for "{'<esol>': -3.2}" sample 4 async
✔ Request Returned
{'id': '8c2cfb68-b037-11ef-9223-acde48001122'}
OpenAD:DEFAULT >> get model service 'pserve' result '8c2cfb68-b037-11ef-9223-acde48001122'
job is still running
OpenAD:DEFAULT >> get model service 'pserve' result '8c2cfb68-b037-11ef-9223-acde48001122'
pred1 pred2
------- -------
1 2
Next up, you can run: result open/edit/copy/display/as dataframe/save [as '<filename.csv>']
The following are Experimental or Advanced Settings that can be included as Environmental Variables
Clears the GPU memory for an Inference call
Default: AUTO_CLEAR_GPU_MEM: bool = True
Calls the Garbage Collector after an Inference call
Default AUTO_GARABAGE_COLLECT: bool = True
Enables Multi-Processing of synchronous Calls, Defaults to 1 Thread for safety, depends on performance sizing whether you choose to use more than 1.
Default: SERVE_MAX_WORKERS: int = -1
Enables Caching of Results for command requests, this should only be activated for Deterministic Requests, no functions that use random seeds should this be activated for.
Default: ENABLE_CACHE_RESULTS: bool = False
The Default value for Asynchronous requests is 1, this is so server capacity is managed to the minimum. It is up to the developer and Deployer of a service to set this higher than 1 based on benchmarking.
Default ASYNC_POOL_MAX: int = 1
~/.openad_models / algorithms / algorithm_type / algorithm_name / algorithm_application / algorithm_version
~/.openad_models / properties / domain / algorithm_name / algorithm_application / algorithm_version