Skip to content

Commit

Permalink
Merge pull request #547 from ngc92/includes
Browse files Browse the repository at this point in the history
made implicit includes of standard headers explicit
  • Loading branch information
karpathy authored Jun 4, 2024
2 parents cb40f45 + b02aab1 commit c73b466
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions llmc/cublas_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ cuBLAS related utils
#ifndef CUBLAS_COMMON_H
#define CUBLAS_COMMON_H

#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <cublas_v2.h>
#include <cublasLt.h>

Expand Down
3 changes: 3 additions & 0 deletions llmc/cuda_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ Common utilities for CUDA code.
#ifndef CUDA_COMMON_H
#define CUDA_COMMON_H

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string>
#include <cuda_runtime.h>
#include <nvtx3/nvToolsExt.h>
#include <cuda_profiler_api.h>
#include <cuda_bf16.h>
#include <cuda_fp16.h>

// ----------------------------------------------------------------------------
// Global defines and settings
Expand Down
3 changes: 2 additions & 1 deletion llmc/encoder.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ In the forward pass, both encodings are added together
In the backward pass, the gradients flow to both, handled by different kernels
*/
#include <assert.h>
#include <stdint.h>
#include <utility> // std::pair
#include <vector>
#include <algorithm>
#include <functional>
#include <unordered_map>
// llmc internal imports
#include "cuda_common.h"
Expand Down
1 change: 1 addition & 0 deletions llmc/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The Logger object is stateless and uses append mode to write to log files.
#define LOGGER_H

#include <assert.h>
#include <stdio.h>
#include <string.h>
// defines: fopenCheck, freadCheck, fcloseCheck, fseekCheck, mallocCheck
#include "utils.h"
Expand Down
1 change: 1 addition & 0 deletions llmc/matmul.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Matrix Multiplication, with help from cuBLASLt
*/
#include <assert.h>
#include <type_traits> // std::bool_constant
// llmc internal imports
#include "cuda_common.h"
#include "cuda_utils.cuh"
Expand Down
2 changes: 1 addition & 1 deletion llmc/tokenizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const char *tokenizer_decode(Tokenizer *tokenizer, uint32_t token_id) {
if (token_id < tokenizer->vocab_size) {
return tokenizer->token_table[token_id];
} else {
printf("invalid token id %d!\n", token_id);
printf("invalid token id %u!\n", token_id);
return NULL;
}
}
Expand Down
1 change: 1 addition & 0 deletions llmc/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifndef UTILS_H
#define UTILS_H

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
Expand Down

0 comments on commit c73b466

Please sign in to comment.