Skip to content

Commit f2994a4

Browse files
jeremiaswernerreggeenr
authored andcommitted
add GPU example
1 parent 5863cce commit f2994a4

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

experimental/serverless-fleets/tutorials/docling/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ cat commands.jsonl
5757

5858
### Step 3 - Run the Fleet
5959

60-
Now run the fleet to process the PDFs. In this tutorial we use the static array index with `--tasks-from-file commands.jsonl` to specify the tasks for the 11 pdfs. We give each task 24 vCPU, run docling with `--num-threads 24` and choose a mx3d-24x240 worker profile with 24 vCPU. Therefore we run only 1 docling command per worker at a time and utilize the full worker per pdf processing. We run `--max-scale 4` instances and workers in parallel. Launch the fleet with the following command in the `tutorials/docling` directory.
60+
Now run the fleet to process the PDFs. In this tutorial we use the static array index with `--tasks-from-file commands.jsonl` to specify the tasks for the 11 pdfs. We give each task 24 vCPU, run docling with `--num-threads 24` and choose a mx3d-24x240 worker profile with 24 vCPU. Therefore we run only 1 docling command per worker at a time and utilize the full worker per pdf processing. We run `--max-scale 4` instances and workers in parallel.
61+
62+
Launch the fleet with the following command in the `tutorials/docling` directory.
6163
```
6264
./run
6365
```
@@ -173,6 +175,10 @@ If you want to modify the tutorial to add some more parallism, e.g. to run 4 doc
173175
2. the cpu per task to `--cpu 6`
174176
Now, with `--max-scale 4` you would only get a single worker. Modify `--max-scale 8` to get 2 workers, each processing 4 docling commands.
175177

178+
#### Run with a Serverless GPU
179+
180+
Run `./run_gpu` to launch the docling commands on a GPU. This example, is bringing up a single `gx3-24x120x1l40s` and runs the 11 pdfs sequentially.
181+
176182

177183
### Step 4 - Download results
178184

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}')
6+
7+
# https://github.com/docling-project/docling-serve?tab=readme-ov-file#container-images
8+
IMAGE="quay.io/docling-project/docling-serve"
9+
10+
echo ibmcloud code-engine experimental fleet run --name "fleet-${uuid}-1"
11+
echo " "--image $IMAGE
12+
echo " "--registry-secret fleet-registry-secret
13+
echo " "--worker-profile gx3-24x120x1l40s
14+
echo " "--max-scale 1
15+
echo " "--tasks-from-file commands.jsonl
16+
echo " "--cpu 24
17+
echo " "--memory 120G
18+
19+
ibmcloud code-engine experimental fleet run --name "fleet-${uuid}-1" \
20+
--image $IMAGE \
21+
--registry-secret fleet-registry-secret \
22+
--worker-profile gx3-24x120x1l40s \
23+
--max-scale 1 \
24+
--tasks-from-file commands.jsonl \
25+
--cpu 24 \
26+
--memory 120G \
27+
28+
ibmcloud code-engine experimental fleet get --name "fleet-${uuid}-1"
29+

0 commit comments

Comments
 (0)