Closed Antiman-cmyk closed 1 year ago
The program can start normally, but an error occurs suddenly during operation.
Hi @Antiman-cmyk ,
firstly I want to say that I think it is very nice that you are working on introducing parallel execution for operations. We would be happy to see your code be introduced into the project once it is running.
Regarding your question, without having access to your modified code it is unfortunately impossible to debug. It seems that the segfault occurs during a retry in the chat
method of chatgpt.py
and it seems to be the call to the OpenAI's ChatCompletion API. I would investigate whether the API is thread-safe and go from there, but it seems that the issue is not with any non thread-safe data structures within GoT. For that reason I will close the issue, but please reopen it or open a new one if you notice that the segfault is due to a bug in GoT.
@Antiman-cmyk
Since GoT executes a DAG, it is relatively straightforward to have concurrent (i.e., multi-threaded) execution of operations within the DAG since (by the nature of a DAG) all operations that can execute can be executed concurrently.
Thus, if you are trying to execute multiple operations concurrently (e.g., using a ThreadPool
executor), then you can make the following changes:
execution_queue
as a set that includes all operations that can execute concurrently based off their predecessor statuses.execution_queue
in a thread pool and await their completion (either all at once or as completed).execution_queue
as a set.Those 3 changes will enable concurrent execution of operations within the DAG.
I tried to modify the GoT framework using data multi-threading, but a segmentation fault occurred. Is there any solution?