Skip to content

PR: number_of_cpu function logic for Darwin and some error handling#19

Open
beiyonder wants to merge 3 commits intosb-ai-lab:mainfrom
beiyonder:main
Open

PR: number_of_cpu function logic for Darwin and some error handling#19
beiyonder wants to merge 3 commits intosb-ai-lab:mainfrom
beiyonder:main

Conversation

@beiyonder
Copy link

Heyy, I've

Updated regex for multi-digit CPU numbers on Windows (eco2ai/tools/tools_cpu.py).

Refined cpu_num logic for Darwin (eco2ai/tools/tools_cpu.py). My reasoning:
Ensures sysctl probes fail before raising errors.
Distinguishes "no packages data" (subprocess error) from "zero packages" (bad data).
Falls back to hw.physicalcpu instead of silently returning 1 on macOS.

Enhancements:
Added try/except statements in eco2ai/tools/tools_gpu.py, tools_ram.py, and utils.py for robust error handling.

Thanks much.

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

Successfully merging this pull request may close these issues.

1 participant