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

[API Proposal]: provide igp+npu access from dotnet #111550

Open
mprevot opened this issue Jan 17, 2025 · 2 comments
Open

[API Proposal]: provide igp+npu access from dotnet #111550

mprevot opened this issue Jan 17, 2025 · 2 comments
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners untriaged New issue has not been triaged by the area owner

Comments

@mprevot
Copy link

mprevot commented Jan 17, 2025

Background and motivation

I am not sure if this goes do to dotnet roslyn or ruyJIT or both.

At the loud era of AI, it will be very interesting to be able to access to local igp (integrated GPU) and NPU accelerators (for instance) from dotnet code.
The API proposal will likely require significant work. I nevertheless suggest a few examples.

API Proposal

namespace System.Collections.Generic;

public abstract class GPUarray<T> : IEnumerable<T>
{
public abstract void Upload();
public abstract void Download();
public abstract bool IsOnDevice {get;}
public abstract GPUarray<T> Operation(Func<T,T>);
//etc
}

API Usage

BitmapImage b = Factory.GetImage();
b.ToGPUArray().Upload();
b.Operation(someFilterOnImage);
b.Operation(addAnotherImage);

//display
b.Show(UIElementTarget); //do not download, but inject in visual element

// or save b
b.Download();
b.Save(heifTargetFileWithParameters);

Alternative Designs

No response

Risks

No response

@mprevot mprevot added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Jan 17, 2025
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jan 17, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jan 17, 2025
@colejohnson66
Copy link

A generic “operation” is way too abstract to mean anything. Not to mention that CPU code can not be executed on a GPU.

@jkotas
Copy link
Member

jkotas commented Jan 18, 2025

Check the discussion in #8220. Number of independent projects provide GPU access from .NET. We have not found strong reason for these capabilities to be included in the core .NET runtime project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-suggestion Early API idea and discussion, it is NOT ready for implementation needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants