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

feat: User Selectable GPUs and GPU-based Model Recommendations #1730

Merged
merged 9 commits into from Feb 6, 2024

Conversation

hiento09
Copy link
Collaborator

@hiento09 hiento09 commented Jan 23, 2024

Changes

  • Added a field to settings.json to manage selected GPUs
  • Implemented functionality to get list of GPUs from file
  • Added GPU monitor to bottom bar
  • Implemented model recommendations in hub based on GPU vRam in GPU mode
  • Increased interval time to get System Resource from 0.5s to 2s

Reason for changes

  • To allow users to select and monitor their GPUs
  • To provide model recommendations based on GPU vRam
  • To improve system resource retrieval performance

Fixes Issues

Images

  • By default, the most powerful GPU will be selected if the user enables GPU mode for the first time. After that, the system will not intervene, allowing the user to choose the GPU they want to use. The next time the app is launched, it will load the GPU according to the user's configuration.

  • When GPU mode is enabled, a model must certainly be selected. The user will not be able to deselect all GPUs
    image

  • When the user chooses to use more than one GPU, a warning will be displayed to remind the user about multi-GPUs mode.

  • The bottom bar monitoring GPU resources will also display the corresponding selected GPUs.
    image

  • The current Hub will also display suggested models depending on whether it's in RAM mode or GPU mode. For GPU mode, it will base its suggestions on the total VRAM of the selected GPUs

  • This is a suggestion if I enable all three GPUs. Notice the bottom bar below is enabling three GPUs, so I can load a heavy model up to 18GB as suggested here.
    image

  • And here, when I try to disable one GPU, you will see that the Hub will recommend differently.

image

Example settings.json file

{"notify":true,"run_mode":"gpu","nvidia_driver":{"exist":true,"version":"531.18"},"cuda":{"exist":true,"version":"12"},"gpus":[{"id":"0","vram":"12282","name":"NVIDIA GeForce RTX 4070 Ti\r"},{"id":"1","vram":"6144","name":"NVIDIA GeForce GTX 1660 Ti\r"},{"id":"2","vram":"6144","name":"NVIDIA GeForce GTX 1660 Ti"}],"gpu_highest_vram":"0","gpus_in_use":["0","1"],"is_initial":false}

@hiento09 hiento09 added P1: important Important feature / fix type: feature request A new feature labels Jan 23, 2024
@hiento09 hiento09 added this to the v0.4.5 milestone Jan 23, 2024
@hiento09 hiento09 requested a review from a team January 23, 2024 11:58
@hiento09 hiento09 self-assigned this Jan 23, 2024
@Van-QA Van-QA modified the milestones: v0.4.5, v0.4.6 Jan 24, 2024
@hiento09 hiento09 modified the milestones: v0.4.6, v0.4.5 Jan 24, 2024
@hiento09 hiento09 changed the title Feature user select gpus feat: allow user to select multiple gpus Jan 24, 2024
@hiento09 hiento09 mentioned this pull request Jan 24, 2024
7 tasks
@hiento09 hiento09 modified the milestones: v0.4.5, v0.4.6 Jan 24, 2024
@hiento09
Copy link
Collaborator Author

hiento09 commented Jan 24, 2024

image
image

@Van-QA
Copy link
Contributor

Van-QA commented Jan 24, 2024

hi @hiento09, from the screenshot, looks like we are missing the separation line between the GPU and Experimental option, can you double check?

On the other hand, I would recommend shortening the warning message if possible 🤔 e.g. Enabling abc, xyz..., may ....

Many thanks

@hiento09 hiento09 changed the title feat: allow user to select multiple gpus feat: User Selectable GPUs and GPU-based Model Recommendations Jan 25, 2024
@Van-QA Van-QA modified the milestones: v0.4.6, v0.4.7 Jan 29, 2024
@imtuyethan
Copy link
Contributor

I included the design in this ticket for this implementation:
Related design ticket: #1646
Related FE implementation ticket from @urmauur : #1851


Design

Figma link: https://www.figma.com/file/ytn1nRZ17FUmJHTlhmZB9f/Jan-App?type=design&node-id=2596-81009&mode=design&t=vDzqYrfNOU0W8KmX-4

When users have compatible GPU(s)

  • GPU Acceleration is turned on by default if users have GPU
  • Auto-select the GPU with the highest VRAM
  • GPU monitoring shown on the footer
Screenshot 2024-02-02 at 9 18 28 AM

When click on choosing GPU, there are 2 cases:

  • If we only detect 1 type of GPU: Show checkbox selection for all the GPU detected.
  • If we detect more than 1 type of GPU (Nvidia, AMD,...): Show the type group selection + checkboxes for each GPU. Reason for this is because we only allow users to select multiple GPU within 1 type.
Screenshot 2024-02-02 at 9 18 47 AM

When users select more than 1 GPU

  • Show warning If multi-GPU is enabled with different GPU models or without NVLink, it could impact token speed
  • Number of GPU shown on footer -> when hover, users will see the detailed specs of each GPU.
Screenshot 2024-02-02 at 9 24 08 AM

When users turn off GPU acceleration although they have compatible GPU

Show warning icon -> when hover, users see tooltip suggestion that users should turn it on: Disabling GPU Acceleration may result in reduced performance. It's recommended to keep this enabled for optimal user experience.

Screenshot 2024-02-02 at 9 26 43 AM

When users don't have any compatible GPU

  • GPU acceleration is turned off by default if users don’t have GPU
  • Users cannot turn on
  • If users try to turn on by clicking on the toggle -> show tooltip Your current device does not have a compatible GPU for monitoring. To enable GPU monitoring, please ensure your device has a supported Nvidia or AMD GPU with updated drivers.
Screenshot 2024-02-02 at 9 29 51 AM

@hiento09 hiento09 merged commit 4471b2c into dev Feb 6, 2024
7 checks passed
@hiento09 hiento09 deleted the feature/user-select-gpus branch February 6, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1: important Important feature / fix type: feature request A new feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

feat: machine with multiple GPUs enables users of both Windows and Linux to select a preferred GPU
5 participants