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

Migrate/jit/matmul tiling 2d #1472

Merged
merged 28 commits into from
Mar 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fails on unroll
  • Loading branch information
louisfd committed Mar 13, 2024
commit 11f55fdd889c5a8bdddabd2bab0986c541a0f80e
12 changes: 3 additions & 9 deletions crates/burn-jit/src/kernel/matmul/tiling2d_padded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ impl MatmulTiling2dPaddedShader {
results,
offset_output,
out,
batch,
);
}

Expand Down Expand Up @@ -294,10 +293,9 @@ impl MatmulTiling2dPaddedShader {
let lhs_vec4 = scope.create_local(shared_memory.item());
gpu!(scope, lhs_vec4 = vec4(lhs_0, lhs_1, lhs_2, lhs_3));
gpu!(scope, shared_memory[lhs_sm_position] = lhs_vec4);
}).else(|scope|{
scope.register(Branch::Break); // TODO test if faster, else remove
}));
// }).else(|scope|{
// scope.register(Branch::Break); // TODO test if faster, else remove
// }));
})
);
}
Expand Down Expand Up @@ -388,7 +386,6 @@ impl MatmulTiling2dPaddedShader {
results: Variable,
offset_output: Variable,
out: Variable,
tmp: Variable,
) {
let elem = results.item().elem();

Expand Down Expand Up @@ -446,7 +443,7 @@ impl<R: Runtime> DynamicKernelSource for MatmulTiling2dPaddedEagerKernel<R> {
MatmulTiling2dPaddedShader {
variables: gpu::BinaryOperator { lhs, rhs, out },
config: self.config.clone(),
unroll: false,
unroll: true,
}
.expand(&mut scope);

Expand Down Expand Up @@ -516,8 +513,6 @@ pub fn matmul_tiling_2d_padded<R: Runtime, E: JitElement + Element, const D: usi
}
_ => round_rhs.into_tensor(),
};
println!("{:?}", lhs.shape);
println!("{:?}", rhs.shape);

let rounded_output_shape = shape_out(&lhs, &rhs);

Expand All @@ -529,7 +524,6 @@ pub fn matmul_tiling_2d_padded<R: Runtime, E: JitElement + Element, const D: usi
rounded_output_shape.clone(),
buffer,
);
println!("{:?}", rounded_output.shape);

Execution::start(kernel, client)
.inputs(&[
Expand Down