# Asynchronous CPU-GPU computation

**URL:** <https://discuss.huggingface.co/t/asynchronous-cpu-gpu-computation/77533>\
**Category:** Beginners\
**Created:** [March 15, 2024, 10:21am UTC](https://discuss.huggingface.co/t/asynchronous-cpu-gpu-computation/77533 "2024-03-15T10:21:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chgrdj](https://avatars.discourse-cdn.com/v4/letter/c/b4bc9f/32.png) [@chgrdj](https://discuss.huggingface.co/u/chgrdj)\
**Post date:** [March 15, 2024, 10:21am UTC](https://discuss.huggingface.co/t/asynchronous-cpu-gpu-computation/77533/1 "2024-03-15T10:21:34Z")

</div>

Hello everyone ,

There is something im not sure about .I saw this class pipeline for inference and i wanted to know if it implements in some sort of way the following setup:  
-the tokenizer is running on the CPU creating the batch for the model  
-the model on the GPU is fed with those tokens that are moved to the GPU.  
I wanted to know if i have to implement the thrading logic myself or is there a native HF way of doing that.Thanks
