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

JIT Migration: PRNG #1433

Merged
merged 14 commits into from
Mar 11, 2024
Merged

JIT Migration: PRNG #1433

merged 14 commits into from
Mar 11, 2024

Conversation

louisfd
Copy link
Member

@louisfd louisfd commented Mar 8, 2024

PRNG kernels for #1422

@louisfd louisfd changed the title Migrate/jit/prng JIT Migration: PRNG Mar 8, 2024
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 87.77293% with 84 lines in your changes are missing coverage. Please review.

Project coverage is 85.80%. Comparing base (b12646d) to head (762fa8f).
Report is 6 commits behind head on main.

Files Patch % Lines
crates/burn-jit/src/codegen/kernel.rs 71.83% 60 Missing ⚠️
crates/burn-jit/src/fusion/tracing/builder.rs 0.00% 20 Missing ⚠️
.../burn-jit/src/codegen/dialect/gpu/vectorization.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1433       /-   ##
==========================================
  Coverage   85.67%   85.80%    0.13%     
==========================================
  Files         637      640        3     
  Lines       70329    71145      816     
==========================================
  Hits        60251    61043      792     
- Misses      10078    10102       24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 383 to 397
// It is crucial that scalars follow this order: float, int, uint
let scalar_priorities: Vec<usize> = [E1::gpu_elem(), E2::gpu_elem(), E3::gpu_elem()]
.iter()
.map(|ty: &Elem| match ty {
Elem::Float => 0,
Elem::Int => 1,
Elem::UInt => 2,
Elem::Bool => panic!("Bool scalars are not supported"),
})
.collect();

let mut handles_scalars = Vec::new();
for i in 0..3 {
for (j, scalar_priority) in scalar_priorities.iter().enumerate() {
if scalar_priority == &i {
Copy link
Member

Choose a reason for hiding this comment

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

Create an array instead of a vec. We know it's 3 in length, so it's gonna be way more efficient.

@louisfd louisfd merged commit 093cbd3 into main Mar 11, 2024
15 checks passed
@louisfd louisfd deleted the migrate/jit/prng branch March 11, 2024 15:40
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.

None yet

2 participants