Eladlev / AutoPrompt

A framework for prompt tuning using Intent-based Prompt Calibration
Apache License 2.0
1.86k stars 149 forks source link

Process finished with exit code 137 (interrupted by signal 9:SIGKILL) #50

Closed nadavex closed 3 months ago

nadavex commented 3 months ago

While attempting to execute the code, I encountered the following error message: "Process finished with exit code 137 (interrupted by signal 9: SIGKILL)". Prior to this error, the following log was observed:

"Starting step 0 Dataset is empty; generating initial samples Processing samples: 0%| | 0/1 [00:00<?, ?it/s] Setting pad_token_id to eos_token_id:50256 for open-end generation. Processing samples: 100%|██████████| 1/1 [00:13<00:00, 13.33s/it] Special tokens have been added to the vocabulary; ensure the associated word embeddings are fine-tuned or trained."

The failure occurred in line 53 of the estimator_llm file:

self.chain = ChainWrapper(self.opt.llm, self.opt.prompt, chain_metadata['json_schema'], chain_metadata['parser_func'])

This code is being executed on my Ubuntu 20.04 system using HuggingFacePipeline, with attempts made using various Large Language Models. Upon researching the error message online, it appears to be related to a memory issue. Could you please provide guidance on how to address this problem? Thank you.

Eladlev commented 3 months ago

Indeed, this is a memory issue. In order to reduce memory consumption you can:

  1. Reduce the num_workers to 1 (in the config files)
  2. Reduce samples_generation_batch to a smaller number (although if too low, it will degrade the performances)
  3. Also it's important to change the meta_prompt folder to prompts/meta_prompts_completion

Overall I'm not recommending using HuggingFacePipeline as the optimizer llm, but only as the predictor llm