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] Error executing with n-CPU cores #628

Open
AlanThinks opened this issue Nov 11, 2024 · 2 comments
Open

[BUG] Error executing with n-CPU cores #628

AlanThinks opened this issue Nov 11, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@AlanThinks
Copy link

AlanThinks commented Nov 11, 2024

Describe the bug

When running:
sample Single Agent code from https://docs.swarms.world/en/latest/swarms/install/quickstart/

agent.run(
    "How can I establish a ROTH ...",
    device="cpu",
    device_id = 0 // or any variation here
)

terminal output:

python .\my_first_swarm.py
(ProxyActor pid=43904) INFO 2024-11-11 17:41:04,501 proxy 127.0.0.1 proxy.py:1191 - Proxy starting on node 913180a87fc228a16b60f641ccd175289aaa4e2b096ab91c95ab90de (HTTP port: 8000).
2024-11-11T17:41:04.577002-0500 | INFO | Autosaved prompt 29139c5a0d2742d6841edf87c2b0a9e5 to agent_workspace\prompts\prompt-id-29139c5a0d2742d6841edf87c2b0a9e5.json.
2024-11-11T17:41:07.783685-0500 Attempting to run on device: cpu
2024-11-11T17:41:07.784686-0500 Device set to CPU
2024-11-11T17:41:07.785684-0500 Using all available CPU cores: 24
2024-11-11T17:41:07.786685-0500 Available CPUs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
2024-11-11T17:41:07.786685-0500 Error executing with 24 CPU cores: Invalid core count: 24. Available CPUs are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].
2024-11-11T17:41:08.786990-0500 Available CPUs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
2024-11-11T17:41:08.787991-0500 Error executing with 24 CPU cores: Invalid core count: 24. Available CPUs are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].
2024-11-11T17:41:09.794937-0500 Available CPUs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
2024-11-11T17:41:09.885148-0500 Error executing with 24 CPU cores: Invalid core count: 24. Available CPUs are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].
2024-11-11T17:41:09.885148-0500 An error occurred during execution: RetryError[<Future at 0x200aaed3a60 state=finished raised ValueError>]
Traceback (most recent call last):
  File "C:\...\miniconda3\envs\swarm\lib\site-packages\tenacity\__init__.py", line 478, in __call__
    result = fn(*args, **kwargs)
  File "C:\...\miniconda3\envs\swarm\lib\site-packages\clusterops\main.py", line 199, in execute_with_cpu_cores
    raise ValueError(
ValueError: Invalid core count: 24. Available CPUs are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\...\my_first_swarm.py", line 28, in <module>
    out = out = agent.run(
  File "C:\...\miniconda3\envs\swarm\lib\site-packages\swarms\structs\agent.py", line 2308, in run
    raise e
  File "C:\...\miniconda3\envs\swarm\lib\site-packages\swarms\structs\agent.py", line 2289, in run
    return execute_with_cpu_cores(
  File "C:\...\miniconda3\envs\swarm\lib\site-packages\tenacity\__init__.py", line 336, in wrapped_f
    return copy(f, *args, **kw)
  File "C:\...\miniconda3\envs\swarm\lib\site-packages\tenacity\__init__.py", line 475, in __call__
    do = self.iter(retry_state=retry_state)
  File "C:\...\miniconda3\envs\swarm\lib\site-packages\tenacity\__init__.py", line 376, in iter
    result = action(retry_state)
  File "C:\...\miniconda3\envs\swarm\lib\site-packages\tenacity\__init__.py", line 419, in exc_check
    raise retry_exc from fut.exception()
tenacity.RetryError: RetryError[<Future at 0x200aaed3a60 state=finished raised ValueError>]
Sentry is attempting to send 2 pending events
Waiting up to 2 seconds
Press Ctrl-Break to quit

/prompts/Financial-Analysis-Agent.log

�[32m2024-11-11 18:02:46.362�[0m | �[1mINFO    �[0m | �[36mswarms.structs.agent�[0m:�[36mrun�[0m:�[36m2277�[0m - �[1mAttempting to run on device: cpu�[0m
�[32m2024-11-11 18:02:46.365�[0m | �[1mINFO    �[0m | �[36mswarms.structs.agent�[0m:�[36mrun�[0m:�[36m2279�[0m - �[1mDevice set to CPU�[0m
�[32m2024-11-11 18:02:46.366�[0m | �[1mINFO    �[0m | �[36mswarms.structs.agent�[0m:�[36mrun�[0m:�[36m2282�[0m - �[1mUsing all available CPU cores: 24�[0m
�[32m2024-11-11 18:02:46.366�[0m | �[1mINFO    �[0m | �[36mclusterops.main�[0m:�[36mlist_available_cpus�[0m:�[36m51�[0m - �[1mAvailable CPUs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]�[0m
�[32m2024-11-11 18:02:46.366�[0m | �[31m�[1mERROR   �[0m | �[36mclusterops.main�[0m:�[36mexecute_with_cpu_cores�[0m:�[36m221�[0m - �[31m�[1mError executing with 24 CPU cores: Invalid core count: 24. Available CPUs are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].�[0m
�[32m2024-11-11 18:02:47.382�[0m | �[1mINFO    �[0m | �[36mclusterops.main�[0m:�[36mlist_available_cpus�[0m:�[36m51�[0m - �[1mAvailable CPUs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]�[0m
�[32m2024-11-11 18:02:47.382�[0m | �[31m�[1mERROR   �[0m | �[36mclusterops.main�[0m:�[36mexecute_with_cpu_cores�[0m:�[36m221�[0m - �[31m�[1mError executing with 24 CPU cores: Invalid core count: 24. Available CPUs are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].�[0m
�[32m2024-11-11 18:02:48.393�[0m | �[1mINFO    �[0m | �[36mclusterops.main�[0m:�[36mlist_available_cpus�[0m:�[36m51�[0m - �[1mAvailable CPUs: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]�[0m
�[32m2024-11-11 18:02:48.393�[0m | �[31m�[1mERROR   �[0m | �[36mclusterops.main�[0m:�[36mexecute_with_cpu_cores�[0m:�[36m221�[0m - �[31m�[1mError executing with 24 CPU cores: Invalid core count: 24. Available CPUs are [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].�[0m
�[32m2024-11-11 18:02:48.394�[0m | �[31m�[1mERROR   �[0m | �[36mswarms.structs.agent�[0m:�[36mrun�[0m:�[36m2307�[0m - �[31m�[1mAn error occurred during execution: RetryError[<Future at 0x23ad1dc7cd0 state=finished raised ValueError>]�[0m

To Reproduce
Steps to reproduce the behavior:

  1. Using Conda for environment
  2. Running sample Single Agent code from https://docs.swarms.world/en/latest/swarms/install/quickstart/
  3. In VS Code click "Run" button

Additional context

Windows 11
VS Code latest
Conda 24.9.2
Python 3.10.15
pip 24.2
swarms 6.0.9
swarms-memory 0.1.2
swarms-models 0.1.3

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@AlanThinks AlanThinks added the bug Something isn't working label Nov 11, 2024
Copy link

Hello there, thank you for opening an Issue ! 🙏🏻 The team was notified and they will get back to you asap.

@kyegomez
Copy link
Owner

@AlanThinks this error should be fixed now, let me know if you're still facing the same issue. I've also made it optional to use clusterops which is where this error originated from .

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