phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

feat(main): ability to specify concurrency in run_experiment and evaluate_experiment

Open anton164 opened this issue 1 year ago • 4 comments

(Arize-AI#4186)

anton164 avatar Aug 08 '24 23:08 anton164

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

github-actions[bot] avatar Aug 08 '24 23:08 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

anton164 avatar Aug 08 '24 23:08 anton164

This MR might be misguided as I'm not really observing any concurrency in the current implementation 🤔 .. Seems like tasks are always evaluated in sequence? Curious to get your guidance

anton164 avatar Aug 09 '24 16:08 anton164

Hi @anton164, this PR does correctly wire up configuring the concurrency of our experiment runners—if the tasks that are being run are async. We generate a sequence of tasks to run (concurrently if possible) then submit them to our executor.

Would it be possible to rewrite your task as a coroutine function instead and report back if the default level of concurrency works for you?

anticorrelator avatar Aug 09 '24 17:08 anticorrelator

Thanks @anticorrelator -- concurrency works in my experiments with a coroutine task, but the level of concurrency is not sufficient. I’d like to use ~20 concurrency for my batch experiments.

I’ve updated the PR to fix a typo and add docs about the task needing to be a coroutine

anton164 avatar Aug 12 '24 08:08 anton164

To fully wire this up we need to add a one more thing:

On line 416 we should pass the concurrency parameter to evaluate_experiment.

Good catch @anticorrelator, updated! Thanks for the quick reviews

anton164 avatar Aug 13 '24 09:08 anton164

Thanks for your contribution @anton164 ! 💯

mikeldking avatar Aug 13 '24 13:08 mikeldking

@anton164 Looks like there's a line length linting issue in the docstring before we can merge

anticorrelator avatar Aug 13 '24 16:08 anticorrelator

@anticorrelator argh, sorry about that. Hadn't set up linting in my dev environment. I set it up now and confirmed that linting for this file no longer fails after fixing the line ending.

anton164 avatar Aug 13 '24 16:08 anton164