Skip to content

Commit

Permalink
allow setting master weights and recompute in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ngc92 committed Jun 8, 2024
1 parent 1bf33cc commit 8fbfba2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test_gpt2.cu
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ int main(int argc, char *argv[]) {
size_t L = model.config.num_layers;
size_t C = model.config.channels;

for (int i = 1; i < argc; i+=2) {
if (i + 1 >= argc) { exit(EXIT_FAILURE); } // must have arg after flag
if (argv[i][0] != '-') { exit(EXIT_FAILURE); } // must start with dash
if (argv[i][1] == 'w') { model.use_master_weights = atoi(argv[i+1]); }
else if (argv[i][1] == 'r') { model.recompute = atoi(argv[i+1]); }
}

// load additional information that we will use for debugging and error checking
FILE *state_file = fopenCheck("gpt2_124M_debug_state.bin", "rb");
int state_header[256];
Expand Down

0 comments on commit 8fbfba2

Please sign in to comment.