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

[Bug]: LLM retries too fast #4238

Closed
2 tasks done
x66ccff opened this issue Oct 7, 2024 · 4 comments
Closed
2 tasks done

[Bug]: LLM retries too fast #4238

x66ccff opened this issue Oct 7, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@x66ccff
Copy link

x66ccff commented Oct 7, 2024

Is there an existing issue for the same bug?

Describe the bug

i'm using docker to start the openhands. In my task, some commands needs long time to execute. (with slow outputs) The agent may regard this as stucked, but in fact it is not.

the agents tries to retry it frequently. I use this command but these seems useless

the agent retries every 3 seconds, but i don know how to change this

-e LLM_NUM_RETRIES=20  \
 -e LLM_RETRY_MIN_WAIT=30 \
-e LLM_RETRY_MAX_WAIT=700 \
docker run -it --pull=never    \
 -e SANDBOX_RUNTIME_CONTAINER_IMAGE=kk-oh-env  \
  -e SANDBOX_USER_ID=$(id -u)   \
  -e WORKSPACE_MOUNT_PATH=$WORKSPACE_BASE \
 -e RUN_AS_OPENHANDS=False  \
-e MAX_ITERATIONS=1000  \
-e LLM_NUM_RETRIES=20  \
 -e LLM_RETRY_MIN_WAIT=30 \
-e LLM_RETRY_MAX_WAIT=700 \
-e DEBUG=True \
 -v $WORKSPACE_BASE:/opt/workspace_base  \
   -v /var/run/docker.sock:/var/run/docker.sock    \
 -p 3000:3000     \
--add-host host.docker.internal:host-gateway  \
   --name openhands-app-$(date +%Y%m%d%H%M%S)  \
   ghcr.io/all-hands-ai/openhands:0.9.8

Current OpenHands version

openhands:0.9.8

Installation and Configuration

openhands:0.9.8

Model and Agent

qwen2.5:72b

Operating System

linux

Reproduction Steps

No response

Logs, Errors, Screenshots, and Additional Context

No response

@x66ccff x66ccff added the bug Something isn't working label Oct 7, 2024
@enyst
Copy link
Collaborator

enyst commented Oct 7, 2024

@x66ccff Can you please clarify or give an example, what kind of command is being retried too fast?

LLM_*retries variables apply to calls to the LLM, they don't apply to other retries that happen, like those of the runtime environment executing bash commands, etc.

@x66ccff
Copy link
Author

x66ccff commented Oct 7, 2024

The LLM try to run python3 pysr_example.py > script_output.log 2>&1 & when i only ask please run Python pysr_example.py

07:14:42 - openhands:INFO: agent_controller.py:253
USER_ACTION
**MessageAction** (source=EventSource.USER)
CONTENT: please run Python pysr_example.py
07:14:42 - openhands:DEBUG: agent_controller.py:273 - [Agent Controller 2d8503c4-125e-4046-b783-c0f49d1080c3] Setting agent(CodeActAgent) state from AgentState.INIT to AgentState.RUNNING
07:14:42 - openhands:DEBUG: stream.py:135 - Adding AgentStateChangedObservation id=6 from AGENT
07:14:42 - openhands:DEBUG: stream.py:135 - Adding NullObservation id=7 from USER
07:14:42 - openhands:INFO: agent_controller.py:229
OBSERVATION
AgentStateChangedObservation(content='', agent_state=<AgentState.RUNNING: 'running'>, observation='agent_state_changed')
07:14:42 - openhands:INFO: agent_controller.py:229
OBSERVATION
NullObservation(content='', observation='null')
07:14:42 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:42 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:42 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |INFO:     172.17.0.1:33630 - "POST /list_files HTTP/1.1" 200 OK
--------------------------------------------------------------------------------


==============
CodeActAgent LEVEL 0 LOCAL STEP 0 GLOBAL STEP 0

07:14:42 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/prompt_001.log
07:14:42 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:42 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |07:14:42 - openhands:DEBUG: client.py:365 - Running action:
    |FileReadAction(path='.gitignore', start=0, end=-1, thought='', action='read', security_risk=None)
    |07:14:42 - openhands:DEBUG: client.py:307 - Executing command: pwd
    |07:14:42 - openhands:DEBUG: client.py:333 - Requesting exit code...
    |07:14:42 - openhands:DEBUG: client.py:367 - Action output:
    |ErrorObservation(content='File not found: /workspace/.gitignore. Your current working directory is /workspace.', observation='error')
    |INFO:     172.17.0.1:33630 - "POST /execute_action HTTP/1.1" 200 OK
--------------------------------------------------------------------------------
INFO:     192.168.1.100:9291 - "GET /api/list-files HTTP/1.1" 200 OK
07:14:45 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/response_001.log
07:14:45 - openhands:WARNING: llm.py:374 - Cost calculation not supported for this model.
07:14:45 - openhands:INFO: llm.py:308 - Input tokens: 4101 | Output tokens: 40

07:14:45 - openhands:DEBUG: stream.py:135 - Adding CmdRunAction id=8 from AGENT
07:14:45 - openhands:INFO: agent_controller.py:448
ACTION
**CmdRunAction (source=EventSource.AGENT)**
THOUGHT: Sure! Let me first check if the file `pysr_example.py` exists and then run it.
COMMAND:
ls -l pysr_example.py
07:14:45 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:45 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:45 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |07:14:45 - openhands:DEBUG: client.py:365 - Running action:
    |**CmdRunAction (source=EventSource.AGENT)**
    |THOUGHT: Sure! Let me first check if the file `pysr_example.py` exists and then run it.
    |COMMAND:
    |ls -l pysr_example.py
    |07:14:45 - openhands:DEBUG: bash.py:39 - BASH PARSING command: ls -l pysr_example.py
    |07:14:45 - openhands:DEBUG: bash.py:46 - BASH PARSING remaining:
    |07:14:45 - openhands:DEBUG: client.py:307 - Executing command: ls -l pysr_example.py
    |07:14:45 - openhands:DEBUG: client.py:333 - Requesting exit code...
    |07:14:45 - openhands:DEBUG: client.py:367 - Action output:
    |**CmdOutputObservation (source=None, exit code=0)**
    |-rw-r--r-- 1 root root 632 Oct  7 06:07 pysr_example.py
    |
    |[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
    |root@7ca84291a889:/workspace #
    |INFO:     172.17.0.1:33630 - "POST /execute_action HTTP/1.1" 200 OK
--------------------------------------------------------------------------------
07:14:45 - openhands:DEBUG: stream.py:135 - Adding CmdOutputObservation id=9 from AGENT
07:14:45 - openhands:INFO: agent_controller.py:229
OBSERVATION
**CmdOutputObservation (source=EventSource.AGENT, exit code=0)**
-rw-r--r-- 1 root root 632 Oct  7 06:07 pysr_example.py

[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
root@7ca84291a889:/workspace #


==============
CodeActAgent LEVEL 0 LOCAL STEP 1 GLOBAL STEP 1

07:14:45 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/prompt_002.log
07:14:49 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/response_002.log
07:14:49 - openhands:INFO: llm.py:308 - Input tokens: 4239 | Output tokens: 42

07:14:49 - openhands:DEBUG: stream.py:135 - Adding CmdRunAction id=10 from AGENT
07:14:49 - openhands:INFO: agent_controller.py:448
ACTION
**CmdRunAction (source=EventSource.AGENT)**
THOUGHT: The file `pysr_example.py` exists. Let me run it now.
COMMAND:
python3 pysr_example.py > script_output.log 2>&1 &
07:14:49 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:49 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:49 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |07:14:49 - openhands:DEBUG: client.py:365 - Running action:
    |**CmdRunAction (source=EventSource.AGENT)**
    |THOUGHT: The file `pysr_example.py` exists. Let me run it now.
    |COMMAND:
    |python3 pysr_example.py > script_output.log 2>&1 &
    |07:14:49 - openhands:DEBUG: bash.py:39 - BASH PARSING command: python3 pysr_example.py > script_output.log 2>&1 &
    |07:14:49 - openhands:DEBUG: bash.py:46 - BASH PARSING remaining:
    |07:14:49 - openhands:DEBUG: client.py:307 - Executing command: python3 pysr_example.py > script_output.log 2>&1 &
    |07:14:49 - openhands:DEBUG: client.py:333 - Requesting exit code...
    |07:14:49 - openhands:DEBUG: client.py:367 - Action output:
    |**CmdOutputObservation (source=None, exit code=0)**
    |[1] 541
    |
    |[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
    |root@7ca84291a889:/workspace #
    |INFO:     172.17.0.1:33630 - "POST /execute_action HTTP/1.1" 200 OK
--------------------------------------------------------------------------------
07:14:49 - openhands:DEBUG: stream.py:135 - Adding CmdOutputObservation id=11 from AGENT
07:14:49 - openhands:INFO: agent_controller.py:229
OBSERVATION
**CmdOutputObservation (source=EventSource.AGENT, exit code=0)**
[1] 541

[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
root@7ca84291a889:/workspace #


==============
CodeActAgent LEVEL 0 LOCAL STEP 2 GLOBAL STEP 2

07:14:49 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/prompt_003.log
07:14:54 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/response_003.log
07:14:54 - openhands:INFO: llm.py:308 - Input tokens: 4358 | Output tokens: 53

07:14:54 - openhands:DEBUG: stream.py:135 - Adding CmdRunAction id=12 from AGENT
07:14:54 - openhands:INFO: agent_controller.py:448
ACTION
**CmdRunAction (source=EventSource.AGENT)**
THOUGHT: The script `pysr_example.py` is running in the background with PID 541. Let me check the output log to see if there are any initial messages or errors.
COMMAND:
cat script_output.log
07:14:54 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:54 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:54 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |07:14:54 - openhands:DEBUG: client.py:365 - Running action:
    |**CmdRunAction (source=EventSource.AGENT)**
    |THOUGHT: The script `pysr_example.py` is running in the background with PID 541. Let me check the output log to see if there are any initial messages or errors.
    |COMMAND:
    |cat script_output.log
    |07:14:54 - openhands:DEBUG: bash.py:39 - BASH PARSING command: cat script_output.log
    |07:14:54 - openhands:DEBUG: bash.py:46 - BASH PARSING remaining:
    |07:14:54 - openhands:DEBUG: client.py:307 - Executing command: cat script_output.log
    |07:14:54 - openhands:DEBUG: client.py:333 - Requesting exit code...
    |07:14:54 - openhands:DEBUG: client.py:367 - Action output:
    |**CmdOutputObservation (source=None, exit code=0)**
    |Compiling Julia backend...
    |
    |[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
    |root@7ca84291a889:/workspace #
    |INFO:     172.17.0.1:33630 - "POST /execute_action HTTP/1.1" 200 OK
--------------------------------------------------------------------------------
07:14:54 - openhands:DEBUG: stream.py:135 - Adding CmdOutputObservation id=13 from AGENT
07:14:54 - openhands:INFO: agent_controller.py:229
OBSERVATION
**CmdOutputObservation (source=EventSource.AGENT, exit code=0)**
Compiling Julia backend...

[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
root@7ca84291a889:/workspace #


==============
CodeActAgent LEVEL 0 LOCAL STEP 3 GLOBAL STEP 3

07:14:54 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/prompt_004.log
07:14:58 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/response_004.log
07:14:58 - openhands:INFO: llm.py:308 - Input tokens: 4486 | Output tokens: 42

07:14:58 - openhands:DEBUG: stream.py:135 - Adding CmdRunAction id=14 from AGENT
07:14:58 - openhands:INFO: agent_controller.py:448
ACTION
**CmdRunAction (source=EventSource.AGENT)**
THOUGHT: The script is compiling the Julia backend, which might take some time. Let's wait for it to finish and check the log again.
COMMAND:
cat script_output.log
07:14:58 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:58 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:14:58 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |07:14:58 - openhands:DEBUG: client.py:365 - Running action:
    |**CmdRunAction (source=EventSource.AGENT)**
    |THOUGHT: The script is compiling the Julia backend, which might take some time. Let's wait for it to finish and check the log again.
    |COMMAND:
    |cat script_output.log
    |07:14:58 - openhands:DEBUG: bash.py:39 - BASH PARSING command: cat script_output.log
    |07:14:58 - openhands:DEBUG: bash.py:46 - BASH PARSING remaining:
    |07:14:58 - openhands:DEBUG: client.py:307 - Executing command: cat script_output.log
    |07:14:58 - openhands:DEBUG: client.py:333 - Requesting exit code...
    |07:14:58 - openhands:DEBUG: client.py:367 - Action output:
    |**CmdOutputObservation (source=None, exit code=0)**
    |Compiling Julia backend...
    |
    |[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
    |root@7ca84291a889:/workspace #
    |INFO:     172.17.0.1:33630 - "POST /execute_action HTTP/1.1" 200 OK
--------------------------------------------------------------------------------
07:14:58 - openhands:DEBUG: stream.py:135 - Adding CmdOutputObservation id=15 from AGENT
07:14:58 - openhands:INFO: agent_controller.py:229
OBSERVATION
**CmdOutputObservation (source=EventSource.AGENT, exit code=0)**
Compiling Julia backend...

[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
root@7ca84291a889:/workspace #


==============
CodeActAgent LEVEL 0 LOCAL STEP 4 GLOBAL STEP 4

07:14:58 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/prompt_005.log
07:15:01 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/response_005.log
07:15:01 - openhands:INFO: llm.py:308 - Input tokens: 4603 | Output tokens: 38

07:15:01 - openhands:DEBUG: stream.py:135 - Adding CmdRunAction id=16 from AGENT
07:15:01 - openhands:INFO: agent_controller.py:448
ACTION
**CmdRunAction (source=EventSource.AGENT)**
THOUGHT: The compilation of the Julia backend is still in progress. Let's wait a bit longer and check the log again.
COMMAND:
cat script_output.log
07:15:01 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:15:01 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:15:01 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |07:15:01 - openhands:DEBUG: client.py:365 - Running action:
    |**CmdRunAction (source=EventSource.AGENT)**
    |THOUGHT: The compilation of the Julia backend is still in progress. Let's wait a bit longer and check the log again.
    |COMMAND:
    |cat script_output.log
    |07:15:01 - openhands:DEBUG: bash.py:39 - BASH PARSING command: cat script_output.log
    |07:15:01 - openhands:DEBUG: bash.py:46 - BASH PARSING remaining:
    |07:15:01 - openhands:DEBUG: client.py:307 - Executing command: cat script_output.log
    |07:15:01 - openhands:DEBUG: client.py:333 - Requesting exit code...
    |07:15:01 - openhands:DEBUG: client.py:367 - Action output:
    |**CmdOutputObservation (source=None, exit code=0)**
    |Compiling Julia backend...
    |
    |[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
    |root@7ca84291a889:/workspace #
    |INFO:     172.17.0.1:33630 - "POST /execute_action HTTP/1.1" 200 OK
--------------------------------------------------------------------------------
07:15:01 - openhands:DEBUG: stream.py:135 - Adding CmdOutputObservation id=17 from AGENT
07:15:01 - openhands:INFO: agent_controller.py:229
OBSERVATION
**CmdOutputObservation (source=EventSource.AGENT, exit code=0)**
Compiling Julia backend...

[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
root@7ca84291a889:/workspace #


==============
CodeActAgent LEVEL 0 LOCAL STEP 5 GLOBAL STEP 5

07:15:01 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/prompt_006.log
07:15:05 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/response_006.log
07:15:05 - openhands:INFO: llm.py:308 - Input tokens: 4716 | Output tokens: 37

07:15:05 - openhands:DEBUG: stream.py:135 - Adding CmdRunAction id=18 from AGENT
07:15:05 - openhands:INFO: agent_controller.py:448
ACTION
**CmdRunAction (source=EventSource.AGENT)**
THOUGHT: The compilation of the Julia backend is still ongoing. Let's wait a bit longer and check the log again.
COMMAND:
cat script_output.log
07:15:05 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:15:05 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:15:05 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |07:15:05 - openhands:DEBUG: client.py:365 - Running action:
    |**CmdRunAction (source=EventSource.AGENT)**
    |THOUGHT: The compilation of the Julia backend is still ongoing. Let's wait a bit longer and check the log again.
    |COMMAND:
    |cat script_output.log
    |07:15:05 - openhands:DEBUG: bash.py:39 - BASH PARSING command: cat script_output.log
    |07:15:05 - openhands:DEBUG: bash.py:46 - BASH PARSING remaining:
    |07:15:05 - openhands:DEBUG: client.py:307 - Executing command: cat script_output.log
    |07:15:05 - openhands:DEBUG: client.py:333 - Requesting exit code...
    |07:15:05 - openhands:DEBUG: client.py:367 - Action output:
    |**CmdOutputObservation (source=None, exit code=0)**
    |Compiling Julia backend...
    |
    |[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
    |root@7ca84291a889:/workspace #
    |INFO:     172.17.0.1:33630 - "POST /execute_action HTTP/1.1" 200 OK
--------------------------------------------------------------------------------
07:15:05 - openhands:DEBUG: stream.py:135 - Adding CmdOutputObservation id=19 from AGENT
07:15:05 - openhands:INFO: agent_controller.py:229
OBSERVATION
**CmdOutputObservation (source=EventSource.AGENT, exit code=0)**
Compiling Julia backend...

[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python]
root@7ca84291a889:/workspace #


==============
CodeActAgent LEVEL 0 LOCAL STEP 6 GLOBAL STEP 6

07:15:05 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/prompt_007.log
07:15:08 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/response_007.log
07:15:08 - openhands:INFO: llm.py:308 - Input tokens: 4828 | Output tokens: 38

07:15:08 - openhands:DEBUG: stream.py:135 - Adding CmdRunAction id=20 from AGENT
07:15:08 - openhands:INFO: agent_controller.py:448
ACTION
**CmdRunAction (source=EventSource.AGENT)**
THOUGHT: The compilation of the Julia backend is still in progress. Let's wait a bit longer and check the log again.
COMMAND:
cat script_output.log
07:15:08 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:15:08 - openhands:DEBUG: runtime.py:307 - Getting container logs...
07:15:08 - openhands:INFO: runtime.py:316 -
-----------------------------------Container logs:-----------------------------------
    |07:15:08 - openhands:DEBUG: client.py:365 - Running action:
    |**CmdRunAction (source=EventSource.AGENT)**
    |THOUGHT: The compilation of the Julia backend is still in progress. Let's wait a bit longer and check the log again.
    |COMMAND:
    |cat script_output.log
    |07:15:08 - openhands:DEBUG: bash.py:39 - BASH PARSING command: cat script_output.log
    |07:15:08 - openhands:DEBUG: bash.py:46 - BASH PARSING remaining:
    |07:15:08 - openhands:DEBUG: client.py:307 - Executing command: cat script_output.log
    |07:15:08 - openhands:DEBUG: client.py:333 - Requesting exit code...
    |07:15:08 - openhands:DEBUG: client.py:367 - Action output:
    |**CmdOutputObservation (source=None, exit code=0)**
    |Compiling Julia backend...
    |[ Info: Started!
0.0%┣                                              ┫ 0/75 [00:01<-1:-14, -1s/it]Expressions evaluated per second: [.....]. Head worker occupation: 0.0%         Press 'q' and then <enter> to stop execution early.                             Hall of Fame:
1.3%┣▋                                          ┫ 1/75 [00:01<Inf:Inf, InfGs/it]Expression5.3%┣██▋                                             ┫ 4/75 [00:01<00:32, 2it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 68.0%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head wo6.7%┣███▏                                            ┫ 5/75 [00:01<00:25, 3it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 75.1%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head wo8.0%┣███▉                                            ┫ 6/75 [00:01<00:21, 3it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 79.4%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu10.7%┣█████                                          ┫ 8/75 [00:02<00:15, 4it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 83.1%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu12.0%┣█████▋                                         ┫ 9/75 [00:02<00:14, 5it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 85.4%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu13.3%┣██████▏                                       ┫ 10/75 [00:02<00:13, 5it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 86.6%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu14.7%┣██████▊                                       ┫ 11/75 [00:02<00:12, 5it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 88.4%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu16.0%┣███████▍                                      ┫ 12/75 [00:02<00:12, 5it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 89.4%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu17.3%┣████████                                      ┫ 13/75 [00:02<00:11, 6it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 90.4%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu18.7%┣████████▋                                     ┫ 14/75 [00:02<00:11, 6it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 91.3%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu20.0%┣█████████▏                                    ┫ 15/75 [00:02<00:10, 6it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 91.6%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execu21.3%┣█████████▉                                    ┫ 16/75 [00:03<00:10, 6it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 92.0%. This is high, and will pr22.7%┣██████████▍                                   ┫ 17/75 [00:03<00:10, 6it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 92.5%. This is high, and will pr24.0%┣███████████                                   ┫ 18/75 [00:03<00:09, 6it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 92.9%. This is high, and will pr26.7%┣████████████▎                                 ┫ 20/75 [00:03<00:08, 7it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 89.3%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execution early.                             Hall of Fame:                                                                   ---------------------------------------------------------------------------------------------------                                                             Complexity  Loss       Score     Equation                                       2           3.230e+01  7.971e+00  y = exp(1.2803)                               3           3.230e+01  1.854e-05  y = exp(inv(0.79219))                         4           3.210e+01  6.411e-03  y = exp(cos(inv(x₀)))                         5           3.413e+00  2.241e+28.0%┣████████████▉                                 ┫ 21/75 [00:03<00:08, 7it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 89.5%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execution early.                             Hall of Fame:                                                                   ---------------------------------------------------------------------------------------------------                                                             Complexity  Loss       Score     Equation                                       2           3.230e+01  7.971e+00  y = exp(1.2803)                               3           3.230e+01  1.854e-05  y = exp(inv(0.79219))                         4           3.210e+01  6.411e-03  y = exp(cos(inv(x₀)))                         5           3.413e+00  2.241e+29.3%┣█████████████▌                                ┫ 22/75 [00:03<00:08, 7it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 89.6%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execution early.                             Hall of Fame:                                                                   ---------------------------------------------------------------------------------------------------                                                             Complexity  Loss       Score     Equation                                       2           3.230e+01  7.971e+00  y = exp(1.2803)                               3           3.230e+01  1.854e-05  y = exp(inv(0.79219))                         4           3.210e+01  6.411e-03  y = exp(cos(inv(x₀)))                         5           3.413e+00  2.241e+32.0%┣██████████████▊                               ┫ 24/75 [00:03<00:07, 7it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 89.8%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execution early.                             Hall of Fame:                                                                   ---------------------------------------------------------------------------------------------------                                                             Complexity  Loss       Score     Equation                                       2           3.230e+01  7.971e+00  y = exp(1.2803)                               3           3.230e+01  1.854e-05  y = exp(inv(0.79219))                         4           3.210e+01  6.411e-03  y = exp(cos(inv(x₀)))                         5           3.413e+00  2.241e+34.7%┣████████████████                              ┫ 26/75 [00:03<00:06, 8it/s]Expressions evaluated per second: 1.55e+04. Head worker occupation: 90.0%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execution early.                             Hall of Fame:                                                                   ---------------------------------------------------------------------------------------------------                                                             Complexity  Loss       Score     Equation                                       2           3.230e+01  7.971e+00  y = exp(1.2803)                               3           3.230e+01  1.854e-05  y = exp(inv(0.79219))                         4           3.210e+01  6.411e-03  y = exp(cos(inv(x₀)))                         5           3.413e+00  2.241e+36.0%┣████████████████▋                             ┫ 27/75 [00:03<00:06, 8it/s]Expressions evaluated per second: 2.05e+04. Head worker occupation: 90.1%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execution early.                             Hall of Fame:                                                                   ---------------------------------------------------------------------------------------------------                                                             Complexity  Loss       Score     Equation                                       2           3.230e+01  7.971e+00  y = exp(1.2803)                               3           3.230e+01  1.854e-05  y = exp(inv(0.79219))                         4           3.210e+01  6.411e-03  y = exp(cos(inv(x₀)))                         5           3.413e+00  2.241e+37.3%┣█████████████████▏                            ┫ 28/75 [00:03<00:06, 8it/s]Expressions evaluated per second: 2.05e+04. Head worker occupation: 90.4%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head worker.                                             Press 'q' and then <enter> to stop execution early.                             Hall of Fame:                                                                   ---------------------------------------------------------------------------------------------------                                                             Complexity  Loss       Score     Equation                                       2           3.230e+01  7.971e+00  y = exp(1.2803)                               3           3.230e+01  1.854e-05  y = exp(inv(0.79219))                         4           3.210e+01  6.411e-03  y = exp(cos(inv(x₀)))                         5           3.413e+00  2.241e+44.0%┣████████████████████▎                         ┫ 33/75 [00:04<00:05, 8it/s]Expression
    |[1]+  Stopped                 python3 pysr_example.py > script_output.log 2>&1will pr
    | efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head wo
    |[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python] execu
    |root@7ca84291a889:/workspace #     Hall of Fame:
    |INFO:     172.17.0.1:33630 - "POST /execute_action HTTP/1.1" 200 OK------------------
--------------------------------------------------------------------------------
07:15:08 - openhands:DEBUG: stream.py:135 - Adding CmdOutputObservation id=21 from AGENT
07:15:08 - openhands:INFO: agent_controller.py:229                              3
OBSERVATION  4.166e-05  y = 1.8043 + 1.7566                           4           3.196e+0
**CmdOutputObservation (source=EventSource.AGENT, exit code=0)**        3.401e+00  2.240e+
Compiling Julia backend...)                       6           1.312e+00  9.527e-01  y = co
[ Info: Started!)                       8           3.420e-01  6.721e-01  y = (x₀ * x₀) +
0.0%┣                                              ┫ 0/75 [00:01<-1:-14, -1s/it]Expressions evaluated per second: [.....]. Head worker occupation: 0.0%         Press 'q' and then <enter> to stop execution early.                             Hall of Fame:                 1.3%┣▋                                          ┫ 1/75 [00:01<Inf:Inf, InfGs/it]Expression5.3%┣██▋                                             ┫ 4/75 [00:01<00:32, 2it/s]Expressions evaluated per second: 2.24e+03. Head worker occupation: 68.0%. This is high, and will prevent efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head wo44.0%┣████████████████████▎                         ┫ 33/75 [00:04<00:05, 8it/s]Expression
[1]+  Stopped                 python3 pysr_example.py > script_output.log 2>&1 and will pr
event efficient resource usage. Increase `ncycles_per_iteration` to reduce load on head wo
[Python Interpreter: /openhands/poetry/openhands-ai-5O4_aCHf-py3.11/bin/python] stop execu
root@7ca84291a889:/workspace #          Hall of Fame:
                              ------------------------------------------------------------
---------------------------------------
==============lexity  Loss       Score     Equation
CodeActAgent LEVEL 0 LOCAL STEP 7 GLOBAL STEP 73)                               3
  3.230e+01  4.166e-05  y = 1.8043 + 1.7566                           4           3.196e+0
07:15:08 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/prompt_008.log0.96433 * (x₀ * x₀)                       6           1.312e+00  9.527e-01  y = co
07:15:19 - openhands:DEBUG: logger.py:238 - Logging to /app/logs/llm/24-10-07_07-12/response_008.logcos(x₃))            9           2.349e-01  3.758e-01  y = (cos(x₃) * exp(0.84588
07:15:19 - openhands:INFO: llm.py:308 - Input tokens: 8364 | Output tokens: 45 (-0.84113 + (x₀ * x₀))                                                                               07:15:19 - openhands:DEBUG: stream.py:135 - Adding CmdRunAction id=22 from AGENT₀))
07:15:19 - openhands:INFO: agent_controller.py:448                    --------------------
ACTION------------------------------------------------------------------------------------
**CmdRunAction (source=EventSource.AGENT)**---------------------
THOUGHT: It looks like the script was stopped prematurely. Let's restart it and monitor its progress more closely.
COMMAND:

@x66ccff
Copy link
Author

x66ccff commented Oct 7, 2024

pysr_example.py:

import numpy as np

X = 2 * np.random.randn(100, 5)
y = 2.5382 * np.cos(X[:, 3]) + X[:, 0] ** 2 - 0.5

from pysr import PySRRegressor

model = PySRRegressor(
    niterations=5,  # < Increase me for better results
    binary_operators=['+', '*'],
    unary_operators=[
        'cos',
        'exp',
        'sin',
        'inv(x) = 1/x',
        # ^ Custom operator (julia syntax)
    ],
    extra_sympy_mappings={'inv': lambda x: 1 / x},
    # ^ Define operator for SymPy as well
    elementwise_loss='loss(prediction, target) = (prediction - target)^2',
    # ^ Custom loss function (julia syntax)
)

model.fit(X, y)

print(model)

@x66ccff
Copy link
Author

x66ccff commented Oct 7, 2024

Sorry, I misunderstood the situation. This issue isn't necessary, so I'm closing it

@x66ccff x66ccff closed this as completed Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants