batch.triggerAndWaitAny()
This is the equivalent of Promise.any()
In my particular case I have an ML model that I want to have run on the CPU (slower but more stable) and also on the GPU (faster but more prone to failure). I have two separate Replicate endpoints (one runs on the CPU, the other on the GPU). I want to run these in parallel and await the first successful result.
Comments1
dmabuff
Feb 13, 2025
Also there should be an option (possibly on by default), to have Trigger kill the executions of any still executing runs upon resolving batch.triggerAndWaitAny