Repository navigation
ink inference: document running several infer.py processes per GPU - #2213
Closed
phippsrtyler wants to merge 4 commits into
Closed
phippsrtyler wants to merge 4 commits into
phippsrtyler wants to merge 4 commits into
Conversation
… GPU Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@phippsrtyler is attempting to deploy a commit to the scroll Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
while currently true the gpu not being fed is a problem of the ink pipeline which should be addressed directly rather than running concurrent preds. this also will likely become out of date as the pipeline becomes more optimized. |
Contributor
Author
|
Makes sense, thanks. I've been working on the feeding side directly too: #2226 reads remote full-3D ink patches through vc_reader and is about 2x faster on 45 PHerc Paris 4 patches (36.6 → 18.1 s on a 3080, similar on an R9700 and MI50), with all 45 patches identical to main. It's ready for review if you have time to take a look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #2189 (
--gpu-normalize); review/merge after it.In one sentence: A short doc shows how to run 2–4
infer.pyprocesses on one GPU, which inks the same windings 1.2–1.4× faster.One real example: On a Radeon AI PRO R9700, six Reader v3 windings take 74.7 s with one process and 51.9 s with four processes (1.44×), and the output is byte-identical.
Before: One process leaves the GPU idle between batches, while CPU workers read and normalize tiles.
After this PR:
ink-detection/koine_machines/inference/CONCURRENCY.mdgives measured times per card and a copy-paste loop that splits the segments into one--folderper process. No code changes.Proof:
Six Reader v3 windings (PHerc0800, 0125, 0211 and 0268 surface volumes),
--stride 192 --amp-dtype fp16 --no-compile, MIOpen off on the AMD cards, windings split round-robin over the processes, time until every process is done. Each value is the median of 3 interleaved rounds after a discarded warm-up, with nothing else running on the machine.--gpu-normalizegave no gain in these runs: within 3% on the R9700 and MI50, and 1–4% slower on the RTX 3080.--batch-size 8with--amp-dtype fp16gave no gain on any card.R9700 rows come from one fair re-take (ABBA x3, byte-identical outputs), which agrees with an earlier run. The card is on loan to another project, so no further R9700 re-takes are planned for this PR.
Why / where this is useful:
One
infer.pyprocess leaves the GPU idle while tiles are being read and normalized. Running 2–4 processes per card inks the same windings 1.2–1.4× faster with no code changes, which makes inking a whole scroll on one GPU much faster.Details
Parity check for one segment.
SEGis the segment to check;OTHER1–OTHER3are three other segments that keep the GPU shared during the concurrent run.