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

Make wgpu compiler dynamic and determined by adapter #470

Merged
merged 8 commits into from
Feb 10, 2025

Conversation

wingertge
Copy link
Contributor

Makes the cubecl-wgpu compiler dynamic and automatically checks the backend on initialization.

Breaking changes

Manually compiling kernels requires a signature change from Compiler::compile(...) to Compiler::default().compile(...).

Comment on lines +110 to +111
// Minimum supported
max_shared_memory_size: 49152,
Copy link
Member

Choose a reason for hiding this comment

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

Is the comment right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it used to just be hardcoded to that for both CUDA and HIP, so I assume it was the minimum supported? I now check the actual minimum for CUDA (since it's almost always higher than 48k), but I don't fully understand the HIP code and can't really test if my code works so I used the hardcoded constant from before.

compilation_options: &Self::CompilationOptions,
mode: ExecutionMode,
) -> Self::Representation {
match self {
Copy link
Member

Choose a reason for hiding this comment

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

I guess you'll need an extra allow for clippy when spirv isn't enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure what you mean, I don't see any clippy warnings on either CI or locally with SPIR-V disabled

@torsteingrindvik
Copy link
Contributor

torsteingrindvik commented Feb 8, 2025

Since this touches relevant code parts I'll mention this issue: #355

Would be nice if possible to get hold of a client when doing device sharing.
Feel free to ignore if out of scope/not relevant enough ❤️

@wingertge
Copy link
Contributor Author

Since this touches relevant code parts I'll mention this issue: #355

Would be nice if possible to get hold of a client when doing device sharing. Feel free to ignore if out of scope/not relevant enough ❤️

This PR doesn't touch the part that selects an adapter (which is where it errors), so I'd put that in a separate PR.

@nathanielsimard nathanielsimard merged commit 29bcebb into tracel-ai:main Feb 10, 2025
5 checks passed
@wingertge wingertge deleted the feat/dynamic-compiler branch February 10, 2025 17:27
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.

3 participants