From 83a82502da87d18b0473e67ed459e72e46a59b90 Mon Sep 17 00:00:00 2001 From: Arjun Date: Wed, 31 Jan 2024 15:31:41 -0800 Subject: [PATCH] Fix nvidia gptj model and data paths --- .../customize.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cm-mlops/script/reproduce-mlperf-inference-nvidia/customize.py b/cm-mlops/script/reproduce-mlperf-inference-nvidia/customize.py index a82072e3e9..964b571504 100644 --- a/cm-mlops/script/reproduce-mlperf-inference-nvidia/customize.py +++ b/cm-mlops/script/reproduce-mlperf-inference-nvidia/customize.py @@ -144,22 +144,26 @@ def preprocess(i): model_name = "retinanet" elif "gptj" in env['CM_MODEL']: - target_data_path = os.path.join(env['MLPERF_SCRATCH_PATH'], 'data', 'cnndm') + target_data_path = os.path.join(env['MLPERF_SCRATCH_PATH'], 'data', 'cnn-daily-mail', 'cnn_eval.json') if not os.path.exists(target_data_path): cmds.append("make download_data BENCHMARKS='gptj'") - fp32_model_path = os.path.join(env['MLPERF_SCRATCH_PATH'], 'models', 'gptj', 'bert_large_v1_1.onnx') + fp32_model_path = os.path.join(env['MLPERF_SCRATCH_PATH'], 'models', 'GPTJ-6B', 'checkpoint-final') + fp8_model_path = os.path.join(env['MLPERF_SCRATCH_PATH'], 'models', 'GPTJ-6B', 'fp8-quantized-ammo', 'GPTJ-07142023.pth') vocab_path = os.path.join(env['MLPERF_SCRATCH_PATH'], 'models', 'bert', 'vocab.txt') if not os.path.exists(os.path.dirname(fp32_model_path)): + cmds.append(f"mkdir -p {os.path.dirname(fp8_model_path)}") + if not os.path.exists(os.path.dirname(fp8_model_path)): cmds.append(f"mkdir -p {os.path.dirname(fp32_model_path)}") if not os.path.exists(fp32_model_path): - cmds.append(f"ln -sf {env['CM_ML_MODEL_BERT_LARGE_FP32_PATH']} {fp32_model_path}") - if not os.path.exists(int8_model_path): - cmds.append(f"ln -sf {env['CM_ML_MODEL_BERT_LARGE_INT8_PATH']} {int8_model_path}") + cmds.append(f"ln -sf {env['GPTJ_CHECKPOINT_DIR']} {fp32_model_path}") + + if not os.path.exists(fp8_model_path): + cmds.append(f"ln -sf {env['CM_ML_MODEL_BERT_LARGE_INT8_PATH']} {fp8_model_path}") model_name = "gptj" - model_path = fp32_model_path + model_path = fp8_model_path #cmds.append(f"make prebuild") if make_command == "download_model": if not os.path.exists(model_path):