Skip to content

Run Inference in Parallel #56

Run Inference in Parallel

Run Inference in Parallel #56

name: Run Inference in Parallel
on:
workflow_dispatch:
inputs:
model-id:
required: true
type: string
sample-only:
required: false
type: string
permissions:
contents: read
jobs:
start-time:
runs-on: ubuntu-latest
outputs:
start-time: ${{ steps.start-time.outputs.start-time }}
steps:
- name: Get start time
id: start-time
run: echo "start-time=$(date +%s)" >> "$GITHUB_OUTPUT"
matrix-inference:
if: github.repository != 'ersilia-os/eos-template'
strategy:
matrix:
numerator: [
1,2,3,4,5,6,7,8,9,10,
11,12,13,14,15,16,17,18,19,20,
21,22,23,24,25,26,27,28,29,30,
31,32,33,34,35,36,37,38,39,40,
41,42,43,44,45,46,47,48,49,50
]
# numerator: [1,2]
uses: ./.github/workflows/predict.yml
with:
numerator: ${{ matrix.numerator }}
denominator: 50
model-id: ${{ inputs.model-id }}
sample-only: ${{ inputs.sample-only }}
SHA: ${{ github.sha }}
secrets: inherit
trigger-serve-pipeline:
needs: [start-time, matrix-inference]
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.API_TOKEN_GITHUB }}
repository: ersilia-os/model-inference-pipeline
event-type: dispatch-serving-after-prediction
client-payload: '{"model-id": "${{ inputs.model-id }}", "sha": "${{ github.sha }}", "start-time": "${{ needs.start-time.outputs.start-time }}"}'