CPU significantly outperforming GPU performance #1153
Unanswered
lewisjluck
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hello. Good to hear that you find Anomalib useful 😄. In order to help you more, it'd be great to have entire config.yaml of the model you are trying to train, so please if you can share that. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi anomalib community!
Firstly, would like to thank the team - truly innovative piece of software and looks extremely useful to many applications.
I am experimenting in attempting to apply anomalib to an industrial process, checking to see if it can detect stray fallen objects on a conveyor belt covering mounds of material (from simulated images). In doing so, I have attempted to run inference on a dataset of 294 images using both the "accelerator: cpu" and "accelerator: gpu" options in my .yaml configuration file. I would expect the gpu to be much faster, but on this testing set I get an average of 96ms per sample for CPU, and 336ms per sample for GPU. I have a NVIDIA GeForce RTX 3070. When checking my system diagnostics, predictably using the CPU option consumes over 90% of the CPU, but when using the GPU option, about 50% of my GPU and 50% of my CPU is used simultaenously. Is this perhaps a situation where memory is being copied constantly between RAM and the GPU, meaning that the parallelisation benefit of GPUs are compromised? This significant of a performance decrease using a GPU is surprising to me (I would expect it to be faster than the CPU!).
I am running inference by the suggest command line interface using tools/inference/lightning_inference.py . Inference to my knowledge is running correctly, and my model trained with no issues on a dataset of about 1500 normal images.
Should I perhaps try another inference model like OpenVINO? May this fix my issue?
Fair warning, I am quite inexperienced in anomalib, and the torch semantics in general, so if I am missing something obvious please feel free to point out my shortsightedness.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions