Skip to content

Conversation

@abhilash1910
Copy link
Contributor

@abhilash1910 abhilash1910 requested a review from a team as a code owner November 27, 2024 07:55

// create host memory of random numbers
float* out = (float*)malloc(B * T * OC * sizeof(float));
float* inp = make_random_float(B * T * C);
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. there is no definitaion of make_random_float.
  2. I prefer using fixed input than using random input. Fixed input => fixed output is more convenient to compare the result in cuda and sycl.

cudaCheck(cudaMemcpy(d_inp, inp, B * T * C * sizeof(float), cudaMemcpyHostToDevice));
cudaCheck(cudaMemcpy(d_weight, weight, C * OC * sizeof(float), cudaMemcpyHostToDevice));
cudaCheck(cudaMemcpy(d_bias, bias, OC * sizeof(float), cudaMemcpyHostToDevice));
matmul_forward(out, inp, weight, bias, B, T, C, OC);
Copy link
Contributor

@zhiweij1 zhiweij1 Nov 27, 2024

Choose a reason for hiding this comment

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

Please also check the output result. (Prepare reference data, compare the output with the reference data.)

@zhiweij1 zhiweij1 closed this Dec 9, 2024
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