-
Notifications
You must be signed in to change notification settings - Fork 163
fix: add cpu usage #1868
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
fix: add cpu usage #1868
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nguyenhoangthuan99
approved these changes
Jan 17, 2025
vansangpfiev
added a commit
that referenced
this pull request
Feb 3, 2025
Co-authored-by: vansangpfiev <sang@jan.ai>
vansangpfiev
added a commit
that referenced
this pull request
Feb 10, 2025
* feat: AMD hardware API (#1797) * feat: add amd gpu windows * chore: remove unused code * feat: get amd gpus * fix: clean * chore: cleanup * fix: set activate * fix: build windows * feat: linux * fix: add patches * fix: map cuda gpus * fix: build * chore: docs * fix: build * chore: clean up * fix: build * fix: build * chore: pack vulkan windows * chore: vulkan linux --------- Co-authored-by: vansangpfiev <sang@jan.ai> * fix: add cpu usage (#1868) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: PATCH method for Thread and Messages management (#1923) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: ignore compute_cap if not present (#1866) * fix: ignore compute_cap if not present * fix: correct gpu info * fix: remove check for toolkit version --------- Co-authored-by: vansangpfiev <sang@jan.ai> * fix: models.cc: symlinked model deletion shouldn't remove original file (#1918) Co-authored-by: vansangpfiev <vansangpfiev@gmail.com> --------- Co-authored-by: vansangpfiev <sang@jan.ai> Co-authored-by: OHaiiBuzzle <23693150+ohaiibuzzle@users.noreply.github.com>
vansangpfiev
added a commit
that referenced
this pull request
Feb 10, 2025
* fix: add metadata * fix: add get models by source * fix: metadata json * fix: get downloaded models * fix: add checkedForSyncHubAt to rc * fix: handle hf download by model id * fix: update model when download from model sources * fix: cortexso model download * feat: AMD hardware API (#1797) * feat: add amd gpu windows * chore: remove unused code * feat: get amd gpus * fix: clean * chore: cleanup * fix: set activate * fix: build windows * feat: linux * fix: add patches * fix: map cuda gpus * fix: build * chore: docs * fix: build * chore: clean up * fix: build * fix: build * chore: pack vulkan windows * chore: vulkan linux --------- Co-authored-by: vansangpfiev <sang@jan.ai> * fix: add cpu usage (#1868) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: handle sub-directory HF * fix: add author in response for /models/sources GET * fix: PATCH method for Thread and Messages management (#1923) Co-authored-by: vansangpfiev <sang@jan.ai> --------- Co-authored-by: vansangpfiev <sang@jan.ai>
vansangpfiev
added a commit
that referenced
this pull request
Feb 18, 2025
* feat: AMD hardware API (#1797) * feat: add amd gpu windows * chore: remove unused code * feat: get amd gpus * fix: clean * chore: cleanup * fix: set activate * fix: build windows * feat: linux * fix: add patches * fix: map cuda gpus * fix: build * chore: docs * fix: build * chore: clean up * fix: build * fix: build * chore: pack vulkan windows * chore: vulkan linux --------- Co-authored-by: vansangpfiev <sang@jan.ai> * fix: add cpu usage (#1868) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: PATCH method for Thread and Messages management (#1923) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: ignore compute_cap if not present (#1866) * fix: ignore compute_cap if not present * fix: correct gpu info * fix: remove check for toolkit version --------- Co-authored-by: vansangpfiev <sang@jan.ai> * fix: models.cc: symlinked model deletion shouldn't remove original file (#1918) Co-authored-by: vansangpfiev <vansangpfiev@gmail.com> * fix: correct gpu info list (#1944) * fix: correct gpu info list * chore: cleanup --------- Co-authored-by: vansangpfiev <sang@jan.ai> * fix: gpu: filter out llvmpipe * fix: add vendor in gpu info (#1952) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: correct get server name method (#1953) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: map nvidia and vulkan uuid (#1954) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: permission issue for default drogon uploads folder (#1870) Co-authored-by: vansangpfiev <sang@jan.ai> * chore: change timeout * fix: make get hardware info function thread-safe (#1956) Co-authored-by: vansangpfiev <sang@jan.ai> * fix: cache data for gpu information (#1959) * fix: wrap vulkan gpu function * fix: init * fix: cpu usage * fix: build windows * fix: buld macos --------- Co-authored-by: vansangpfiev <sang@jan.ai> * fix: handle path with space (#1963) * fix: unload engine before updating (#1970) Co-authored-by: sangjanai <sang@jan.ai> * fix: auto-reload model for remote engine (#1971) Co-authored-by: sangjanai <sang@jan.ai> * fix: use updated configuration for remote model when reload (#1972) Co-authored-by: sangjanai <sang@jan.ai> * fix: correct engine interface order (#1974) Co-authored-by: sangjanai <sang@jan.ai> * fix: improve error handling for remote engine (#1975) Co-authored-by: sangjanai <sang@jan.ai> * fix: temporarily remove model setting recommendation (#1977) Co-authored-by: sangjanai <sang@jan.ai> --------- Co-authored-by: vansangpfiev <sang@jan.ai> Co-authored-by: OHaiiBuzzle <23693150+ohaiibuzzle@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe Your Changes
This pull request introduces significant changes to the CPU information reporting functionality in the codebase. The primary goal is to add CPU usage metrics to the existing hardware information.
Enhancements to CPU Information Reporting:
engine/cli/commands/hardware_list_cmd.cc
: Added a new "Usage" column to the CPU information table and included CPU usage in the row data. [1] [2]engine/common/hardware_common.h
: Added ausage
field to theCPU
struct and updated theToJson
andFromJson
functions to handle the newusage
field. [1] [2] [3]Codebase Refactoring:
engine/common/hardware_common.h
: Moved the#include <assert.h>
directive to the top of the file for better organization.engine/common/hardware_common.h
: Removed unnecessary blank lines and added missing namespace closing comments for better readability. [1] [2] [3]CPU Usage Calculation:
engine/utils/hardware/cpu_info.h
: Integrated theGetCPUUsage
function to retrieve CPU usage metrics and included it in theGetCPUInfo
function. [1] [2]engine/utils/hardware/cpu_usage.h
: Added a new header file to implement theGetCPUUsage
function for different operating systems (Windows, macOS, Linux).Fixes Issues
Self Checklist