microsoft / microsoft/ai-dev-gallery

Refactoring suggestions

Open
#88 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
1.5k
Forks
223
PR merge metrics
No merged PRs in 30d

Description

Two observations regarding the DeviceUtils class while working on a bug repro for #70:

  • the DeviceUtils class can likely be simplified because both methods do almost the same. I merged them in my bug repro - this could be a possible direction.
  • I noticed at least the GetVram method is called very often (I believe for every AI model, to check whether it can be run on the GPU). However, I think this method only needs to be called when something changes about GPU availability and for the rest the value can be cached. I could imagine that there is a kind of (internal or UI) video adapter selection global in the app, which can provide the data for the VRAM check and the model runners.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DeviceUtils class and its GetVram method, then review the linked comparison for the suggested consolidation and the issue #70 repro context. Determine how GPU availability changes are represented before deciding how caching should be invalidated. Done means reducing duplicated logic and avoiding repeated VRAM checks without changing model-runner behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, performance
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.