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

[Refactor] Just-In-Time Backend #1280

Merged
merged 19 commits into from
Feb 12, 2024
Merged

[Refactor] Just-In-Time Backend #1280

merged 19 commits into from
Feb 12, 2024

Conversation

nathanielsimard
Copy link
Member

@nathanielsimard nathanielsimard commented Feb 8, 2024

Refactor the burn-wgpu crate by introducing a Runtime trait. The new trait is composed of all the necessary types to be implemented so that a backend can be made out of it. The WgpuBackend has been renamed to the JitBackend where the runtime can be passed as an argument as such JitBackend<WgpuRuntime<GraphicsApi, Float, Int>>.

For now, some operations don't use the wgsl::Compiler but are already defined as a String (with WGSL syntax), so the backend isn't ready to be split into a new crate burn-jit. Following PRs will extract the remaining operations into the gpu::Operation dialect, and the wgsl tokens are going to be defined in the Display implementation of the wgsl representation. After that, we could start to introduce new Runtimes with their own compute server and compiler.

@nathanielsimard nathanielsimard marked this pull request as draft February 8, 2024 23:07
@nathanielsimard nathanielsimard marked this pull request as ready for review February 10, 2024 21:51
@nathanielsimard nathanielsimard changed the title [Refactor] make the Gpu Backend generic over the compiler [Refactor] Just-In-Time Backend Feb 10, 2024
Copy link
Member

@louisfd louisfd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very good to me

pub handle: WgpuHandle,
/// The shape of the current tensor.
pub handle: Handle<R::Server>,
/// The shape of the ctensor.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you left a c

@nathanielsimard nathanielsimard merged commit dfc65ab into main Feb 12, 2024
13 checks passed
@nathanielsimard nathanielsimard deleted the refactor/wgpu/compiler branch February 12, 2024 17:15
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