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

Implement kernel cache #68

Merged
merged 13 commits into from
Oct 20, 2024
Merged
Changes from 1 commit
Commits
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
Add the duration-time of matmul_forward_dummy to compare GPU's one wi…
…th CPU's one
junjihashimoto committed Oct 18, 2024
commit dd145acd76a00d399ea93760dd837c7927b87cd7
7 changes: 5 additions & 2 deletions experimental/kernels/unittest_llmc/unittest_kernels.cpp
Original file line number Diff line number Diff line change
@@ -327,7 +327,10 @@ void MATMUL_FORWARD_GPU(float* out,
}
if (debug) {
out_exp = new float[B*T*OC];
matmul_forward_dummy(out_exp, inp, weight, bias, B, T, C, OC);
{
DurationTime duration("matmul_forward_cpu", verbose);
matmul_forward_dummy(out_exp, inp, weight, bias, B, T, C, OC);
}
}
struct MatmulParams {
uint32_t B;
@@ -421,8 +424,8 @@ void MATMUL_FORWARD_GPU(float* out,
DurationTime duration("matmul_forward_gpu", verbose);
dispatchKernel(ctx, op, promise);
wait(ctx, future);
toCPU(ctx, out_o, out, b * t * oc * sizeof(float));
}
toCPU(ctx, out_o, out, b * t * oc * sizeof(float));
} else {
DurationTime duration("matmul_forward_cpu", verbose);
matmul_forward_dummy(out, inp, weight, bias, B, T, C, OC);