Skip to content

Commit

Permalink
fix bug pretty sure this should just be a void* pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
karpathy committed May 24, 2024
1 parent 613a125 commit 1d10e78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion train_gpt2.cu
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,7 @@ void gpt2_build_from_checkpoint(GPT2 *model, const char* checkpoint_path) {
model->params_memory = malloc_and_point_parameters(&model->params, model->param_elements, model->param_sizeof);

// read in all the parameters from file and copy them to device
float* params_memory_cpu = (float*)mallocCheck(model->num_parameters_bytes);
void* params_memory_cpu = (void*)mallocCheck(model->num_parameters_bytes);
freadCheck(params_memory_cpu, 1, model->num_parameters_bytes, model_file);
cudaCheck(cudaMemcpy(model->params_memory, params_memory_cpu, model->num_parameters_bytes, cudaMemcpyHostToDevice));
free(params_memory_cpu);
Expand Down

0 comments on commit 1d10e78

Please sign in to comment.