Skip to content

fix: add default cpu_threads #1948

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

Merged
merged 7 commits into from
Feb 27, 2025
Merged

fix: add default cpu_threads #1948

merged 7 commits into from
Feb 27, 2025

Conversation

vansangpfiev
Copy link
Contributor

Describe Your Changes

This pull request includes several changes to the ModelService and utility files to improve functionality and error handling. The most important changes include adding a method to determine the number of CPU threads, enhancing error handling for file operations, and minor adjustments to file includes.

Enhancements to ModelService:

  • Added a method GetCpuThreads to determine the number of CPU threads based on the hardware and engine mode. This method is used to set a default value for cpu_threads if it is not configured. (engine/services/model_service.cc, engine/services/model_service.h) [1] [2] [3]

Error handling improvements:

  • Improved error handling in GGUFHelper::Load by checking if the file descriptor is valid and logging an error message if the file cannot be opened. (engine/utils/hardware/gguf/gguf_file.h)

Minor adjustments:

  • Rearranged the order of include directives to maintain consistency and potentially resolve dependency issues. (engine/utils/hardware/gguf/gguf_file.h) [1] [2]
  • Moved the initialization of Estimation res in EstimateLLaMACppRun to ensure it is correctly initialized after parsing the GGUF file. (engine/utils/hardware/gguf/gguf_file_estimate.h)

Fixes Issues

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

@vansangpfiev vansangpfiev marked this pull request as ready for review February 11, 2025 02:20
@vansangpfiev vansangpfiev self-assigned this Feb 14, 2025
@vansangpfiev vansangpfiev merged commit 9f1a50f into dev Feb 27, 2025
8 checks passed
@vansangpfiev vansangpfiev deleted the fix/default-cpu-threads branch February 27, 2025 02:22
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.

2 participants