Passing in a function as the work function feature #39
Labels
dcp
Relates to DCP or the Compute API
enhancement
New feature or request
python
Relates to Python code
Having a feature in which users can pass a function to compute_for and have that function be used as the work function would be a powerful feature. For instance if a user had a machine learning function that performs inferences based off of some arbitrary arguments, allowing to the user to pass in that function with no modification as the new work function would provide powerful functionality.
In this case the user's function might look like something:
def inference(input_data, model, hyperparameters):
The user can then pass that function to compute_for and with some type of argument in the compute_for specify what arguments from inference are sliceable and which are shared_args
job = dcp.compute_for(inference, slice = input_data, shared_args = hyperparameter)
I think this would be a powerful tool especially for newer and more casual bifrost users but more thought should be put into what this solution looks like.
The text was updated successfully, but these errors were encountered: