Fleet: parallel runs
Run the same block many times in parallel with Fleet.
Fleet runs the same blocks many times in parallel, once for each item in a list. Use it to process each ticker, each date or each parameter set at the same time, instead of one after another. You don't set up clusters or write any special parallel code.
How it works
In a block, call
spread()with a list. The blocks that follow it fan out into one copy for each item in the list.Each copy runs in parallel, on its own compute, with its own item.
An Aggregator block uses
gather()to collect the results from every copy into a single list, which the rest of the notebook can use.
Example
This runs a backtest for each ticker in parallel, then combines the results.
# Block 1: start the fleet, one run per ticker
tickers = ["AAPL", "MSFT", "NVDA", "AMZN", "GOOGL"]
ticker = spread(tickers)# Block 2: runs once for each ticker, in parallel
result = run_backtest(ticker)# Aggregator block: collect every run's result into one list
results = gather(result)Common uses
Processing by entity
Running the same analysis for each stock, fund or region
Hyperparameter tuning
Training a model with many parameter combinations at once
Processing by category
Processing each category in a large dataset separately
Model evaluation
Testing a model or prompt against many inputs at once
Limits
Runs in one Fleet
Up to 250
How many run at once
You can set a limit for a Fleet, within your organization's overall concurrency limit. Runs over the limit wait in a queue.
Following and managing a Fleet
You can see the status and results of every run in a Fleet.
Stop a Fleet
Stop it as a whole, which stops all its runs
Retry failed runs
Retry just the runs that failed, including ones that finished with an error, without rerunning the ones that succeeded
Fleet and superagents
Superagents have their own way of running work in parallel, called batches, which run whole agents rather than blocks of code.
Last updated
Was this helpful?
