Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High (100%) CPU Utilization for Transformer Container. ThreadPoolExecutor not using max_workers defined. #81

Open
pchunduru10 opened this issue Apr 4, 2024 · 0 comments

Comments

@pchunduru10
Copy link

Hi I am trying to run the transformers in kubernetes pod on my instance and its using up all the CPU cores available and throttling other pods in the cluster eventually crashing the sytem.

I tried to create a sed patch in in the dokcer-entrypoint file for the transformers to override ThreadPoolExecutor max workers which is set to. None (by default) to a value that user defines (with an ENV variable)

This doesnt seem to work as well, When I /bin/bash into the container the fix seems to work as below, but its not perofrming as expected and still using all the cores on the instance it was deployed.


class Vectorizer:
    executor: ThreadPoolExecutor

    def __init__(self, model_path: str, cuda_support: bool, cuda_core: str, cuda_per_process_memory_fraction: float,
                 model_type: str, architecture: str, direct_tokenize: bool, onnx_runtime: bool,
                 use_sentence_transformer_vectorizer: bool, model_name: str):
        self.executor = ThreadPoolExecutor(max_workers=2)

Appreciate any help regarding this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant