From 2bf128fa95a160e1f5d070eaca1aea616c1a0f33 Mon Sep 17 00:00:00 2001 From: mtairum Date: Sat, 20 Jul 2024 09:34:30 +0000 Subject: [PATCH] #5337: Updated Mistral CI weight and cache path location --- models/demos/wormhole/mistral7b/demo/demo.py | 10 +++++----- .../demos/wormhole/mistral7b/demo/demo_with_prefill.py | 10 +++++----- .../wormhole/mistral7b/tests/test_mistral_attention.py | 6 +++--- .../mistral7b/tests/test_mistral_attention_prefill.py | 6 +++--- .../wormhole/mistral7b/tests/test_mistral_decoder.py | 6 +++--- .../mistral7b/tests/test_mistral_decoder_prefill.py | 6 +++--- .../wormhole/mistral7b/tests/test_mistral_embedding.py | 6 +++--- .../demos/wormhole/mistral7b/tests/test_mistral_mlp.py | 6 +++--- .../wormhole/mistral7b/tests/test_mistral_model.py | 6 +++--- .../mistral7b/tests/test_mistral_model_prefill.py | 6 +++--- .../wormhole/mistral7b/tests/test_mistral_perf.py | 6 +++--- .../wormhole/mistral7b/tests/test_mistral_rms_norm.py | 6 +++--- .../wormhole/mistral7b/tests/test_mistral_torch.py | 6 +++--- 13 files changed, 43 insertions(+), 43 deletions(-) diff --git a/models/demos/wormhole/mistral7b/demo/demo.py b/models/demos/wormhole/mistral7b/demo/demo.py index 34e79bef05e9..f5dc0d4e224d 100644 --- a/models/demos/wormhole/mistral7b/demo/demo.py +++ b/models/demos/wormhole/mistral7b/demo/demo.py @@ -88,9 +88,9 @@ def preprocess_inputs(input_prompts, tokenizer, model_args, dtype, embd, instruc def run_mistral_demo(user_input, batch_size, device, instruct_mode, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs @@ -278,8 +278,8 @@ def run_mistral_demo(user_input, batch_size, device, instruct_mode, is_ci_env): ids=["general_weights", "instruct_weights"], ) def test_mistral7B_demo(device, use_program_cache, input_prompts, instruct_weights, is_ci_env): - if is_ci_env and instruct_weights == False: - pytest.skip("CI demo test only runs instruct weights (to reduce CI pipeline load)") + if is_ci_env and instruct_weights == True: + pytest.skip("CI demo test only runs general weights (to reduce CI pipeline load)") return run_mistral_demo( user_input=input_prompts, batch_size=32, device=device, instruct_mode=instruct_weights, is_ci_env=is_ci_env diff --git a/models/demos/wormhole/mistral7b/demo/demo_with_prefill.py b/models/demos/wormhole/mistral7b/demo/demo_with_prefill.py index 83f029289af3..45d499c86791 100644 --- a/models/demos/wormhole/mistral7b/demo/demo_with_prefill.py +++ b/models/demos/wormhole/mistral7b/demo/demo_with_prefill.py @@ -129,9 +129,9 @@ def preprocess_inputs_prefill(input_prompts, tokenizer, model_args, dtype, embd, def run_mistral_demo(user_input, batch_size, device, instruct_mode, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs @@ -357,8 +357,8 @@ def run_mistral_demo(user_input, batch_size, device, instruct_mode, is_ci_env): ids=["general_weights", "instruct_weights"], ) def test_mistral7B_demo(device, use_program_cache, input_prompts, instruct_weights, is_ci_env): - if is_ci_env and instruct_weights == False: - pytest.skip("CI demo test only runs instruct weights (to reduce CI pipeline load)") + if is_ci_env and instruct_weights == True: + pytest.skip("CI demo test only runs general weights (to reduce CI pipeline load)") return run_mistral_demo( user_input=input_prompts, batch_size=32, device=device, instruct_mode=instruct_weights, is_ci_env=is_ci_env diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_attention.py b/models/demos/wormhole/mistral7b/tests/test_mistral_attention.py index 45821b547b1d..f44937722c91 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_attention.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_attention.py @@ -24,9 +24,9 @@ def test_mistral_attention_inference(device, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_attention_prefill.py b/models/demos/wormhole/mistral7b/tests/test_mistral_attention_prefill.py index daf13bc1c7c1..cb09519229d0 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_attention_prefill.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_attention_prefill.py @@ -34,9 +34,9 @@ def test_mistral_attention_inference(seq_len, device, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_decoder.py b/models/demos/wormhole/mistral7b/tests/test_mistral_decoder.py index df3fc8c9fbf2..9613545420bd 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_decoder.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_decoder.py @@ -24,9 +24,9 @@ def test_mistral_decoder_inference(device, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_decoder_prefill.py b/models/demos/wormhole/mistral7b/tests/test_mistral_decoder_prefill.py index 7644ecd9488e..16bc5b930c44 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_decoder_prefill.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_decoder_prefill.py @@ -34,9 +34,9 @@ def test_mistral_decoder_inference(device, seq_len, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_embedding.py b/models/demos/wormhole/mistral7b/tests/test_mistral_embedding.py index ca9b81b3b4ed..1c13fe1f580c 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_embedding.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_embedding.py @@ -28,9 +28,9 @@ def forward(self, x): def test_mistral_embedding(device, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_mlp.py b/models/demos/wormhole/mistral7b/tests/test_mistral_mlp.py index 1ef717b65c25..da3c23c76c40 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_mlp.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_mlp.py @@ -31,9 +31,9 @@ def test_mistral_mlp_inference(device, seq_len, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_model.py b/models/demos/wormhole/mistral7b/tests/test_mistral_model.py index 0cf9ec3b54b6..cca733e48c25 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_model.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_model.py @@ -40,9 +40,9 @@ def forward(self, x): def test_mistral_model_inference(device, iterations, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_model_prefill.py b/models/demos/wormhole/mistral7b/tests/test_mistral_model_prefill.py index b481ab0c5f6b..ce853dc37431 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_model_prefill.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_model_prefill.py @@ -46,9 +46,9 @@ def forward(self, x): def test_mistral_model_inference(device, seq_len, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" os.environ["MISTRAL_REF_OUTPUT_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/Mixtral-8x7B-v0.1/prefill/" # This module requires the env paths above for CI runs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_perf.py b/models/demos/wormhole/mistral7b/tests/test_mistral_perf.py index d5bbe9eb8228..3ca287071078 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_perf.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_perf.py @@ -51,9 +51,9 @@ def test_mistral_model_perf( ): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_rms_norm.py b/models/demos/wormhole/mistral7b/tests/test_mistral_rms_norm.py index 09b0108aea6f..3312dff2f7b4 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_rms_norm.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_rms_norm.py @@ -19,9 +19,9 @@ def test_mistral_rms_norm_inference(device, use_program_cache, reset_seeds, is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs diff --git a/models/demos/wormhole/mistral7b/tests/test_mistral_torch.py b/models/demos/wormhole/mistral7b/tests/test_mistral_torch.py index 5154c3090661..b34f11c61bda 100644 --- a/models/demos/wormhole/mistral7b/tests/test_mistral_torch.py +++ b/models/demos/wormhole/mistral7b/tests/test_mistral_torch.py @@ -29,9 +29,9 @@ def forward(self, x): def test_mistral_torch_inference(is_ci_env): # Set Mistral flags for CI if is_ci_env: - os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" - os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/ttnn/models/demos/mistral7b/" + os.environ["MISTRAL_CKPT_DIR"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_TOKENIZER_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" + os.environ["MISTRAL_CACHE_PATH"] = "/mnt/MLPerf/tt_dnn-models/Mistral/mistral-7B-v0.1/" # This module requires the env paths above for CI runs from models.demos.wormhole.mistral7b.tt.model_config import TtModelArgs