Skip to content

Commit

Permalink
Correct naming for model name property #1049 (#1050)
Browse files Browse the repository at this point in the history
Currently, we're storing invalid test property for our model tests. As
consequence, model names aren't properly tracked as part of our CI and
DB. This change should correct it.

Fix #1049
  • Loading branch information
nvukobratTT authored Jan 15, 2025
1 parent 773304e commit 2b3e0f0
Show file tree
Hide file tree
Showing 78 changed files with 173 additions and 173 deletions.
2 changes: 1 addition & 1 deletion forge/test/models/pytorch/audio/stereo/test_stereo.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_stereo(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="stereo", variant=variant)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

framework_model, processor = load_model(variant)

Expand Down
6 changes: 3 additions & 3 deletions forge/test/models/pytorch/audio/whisper/test_whisper_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_whisper(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="whisper", variant=variant)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

framework_model, inputs = generate_model_whisper_congen_hf_pytorch(variant)

Expand All @@ -124,7 +124,7 @@ def test_whisper_pipeline(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="whisper", variant=variant, suffix="pipeline")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Configurations
compiler_cfg = forge.config._get_global_compiler_config()
Expand Down Expand Up @@ -187,7 +187,7 @@ def test_whisper_encoder(record_forge_property, test_device, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="whisper", variant=variant, suffix="encoder")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Configurations
compiler_cfg = _get_global_compiler_config()
Expand Down
6 changes: 3 additions & 3 deletions forge/test/models/pytorch/audio/whisper/test_whisper_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_whisper_dec_past_cache(record_forge_property, test_device, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="whisper", variant=variant, suffix="pipeline")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

model, inputs, other = generate_model_whisper_decoder_past_cache(variant)
compile_inputs = other["compile_inputs"]
Expand Down Expand Up @@ -87,7 +87,7 @@ def test_whisper_enc_dec(record_forge_property, test_device, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="whisper", variant=variant, suffix="enc_dec")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

compiler_cfg = _get_global_compiler_config()
compiler_cfg.enable_tvm_cpu_fallback = False # Run full model on silicon
Expand Down Expand Up @@ -325,7 +325,7 @@ def test_whisper_enc_dec_pipeline(record_forge_property, test_device, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

compiler_cfg = _get_global_compiler_config()
compiler_cfg.enable_tvm_cpu_fallback = False # Run full model on silicon
Expand Down
2 changes: 1 addition & 1 deletion forge/test/models/pytorch/audio/whisper/test_whisper_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def test_whisper_large_v3_speech_translation(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

processor = WhisperProcessor.from_pretrained(variant)
framework_model = WhisperForConditionalGeneration.from_pretrained(variant)
Expand Down
2 changes: 1 addition & 1 deletion forge/test/models/pytorch/multimodal/clip/test_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_clip_pytorch(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="clip", variant=variant, suffix="text")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load processor and model from HuggingFace
model = download_model(CLIPModel.from_pretrained, variant, torchscript=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_stable_diffusion_pytorch(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="stable_diffusion", variant=variant)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

batch_size = 1

Expand Down
4 changes: 2 additions & 2 deletions forge/test/models/pytorch/multimodal/vilt/test_vilt.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_vilt_question_answering_hf_pytorch(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

framework_model, inputs, _ = generate_model_vilt_question_answering_hf_pytorch(variant)

Expand Down Expand Up @@ -113,7 +113,7 @@ def test_vilt_maskedlm_hf_pytorch(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

framework_model, inputs, _ = generate_model_vilt_maskedlm_hf_pytorch(variant)

Expand Down
4 changes: 2 additions & 2 deletions forge/test/models/pytorch/text/albert/test_albert.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_albert_masked_lm_pytorch(record_forge_property, size, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

model_ckpt = f"albert-{size}-{variant}"

Expand Down Expand Up @@ -77,7 +77,7 @@ def test_albert_token_classification_pytorch(record_forge_property, size, varian
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# NOTE: These model variants are pre-trined only. They need to be fine-tuned
# on a downstream task. Code is for demonstration purposes only.
Expand Down
2 changes: 1 addition & 1 deletion forge/test/models/pytorch/text/bart/test_bart.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_pt_bart_classifier(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

model = download_model(BartForSequenceClassification.from_pretrained, variant, torchscript=True)
tokenizer = download_model(BartTokenizer.from_pretrained, variant, pad_to_max_length=True)
Expand Down
8 changes: 4 additions & 4 deletions forge/test/models/pytorch/text/bert/test_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_bert_masked_lm_pytorch(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="bert", variant=variant, task=Task.MASKED_LM)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

framework_model, inputs, _ = generate_model_bert_maskedlm_hf_pytorch(variant)

Expand Down Expand Up @@ -95,7 +95,7 @@ def test_bert_question_answering_pytorch(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="bert", variant=variant, task=Task.QA)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

framework_model, inputs, _ = generate_model_bert_qa_hf_pytorch(variant)

Expand Down Expand Up @@ -137,7 +137,7 @@ def test_bert_sequence_classification_pytorch(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

framework_model, inputs, _ = generate_model_bert_seqcls_hf_pytorch(variant)

Expand Down Expand Up @@ -185,7 +185,7 @@ def test_bert_token_classification_pytorch(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

framework_model, inputs, _ = generate_model_bert_tkcls_hf_pytorch(variant)

Expand Down
2 changes: 1 addition & 1 deletion forge/test/models/pytorch/text/codegen/test_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_codegen(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="codegen", variant=variant, task=Task.CAUSAL_LM)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load model (with tokenizer)
tokenizer = download_model(AutoTokenizer.from_pretrained, variant)
Expand Down
8 changes: 4 additions & 4 deletions forge/test/models/pytorch/text/distilbert/test_distilbert.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_distilbert_masked_lm_pytorch(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load DistilBert tokenizer and model from HuggingFace
# Variants: distilbert-base-uncased, distilbert-base-cased,
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_distilbert_question_answering_pytorch(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="distilbert", variant=variant, task=Task.QA)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load Bert tokenizer and model from HuggingFace
tokenizer = download_model(DistilBertTokenizer.from_pretrained, variant)
Expand Down Expand Up @@ -119,7 +119,7 @@ def test_distilbert_sequence_classification_pytorch(record_forge_property, varia
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load DistilBert tokenizer and model from HuggingFace
tokenizer = download_model(DistilBertTokenizer.from_pretrained, variant)
Expand Down Expand Up @@ -157,7 +157,7 @@ def test_distilbert_token_classification_pytorch(record_forge_property, variant)
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load DistilBERT tokenizer and model from HuggingFace
tokenizer = download_model(DistilBertTokenizer.from_pretrained, variant)
Expand Down
6 changes: 3 additions & 3 deletions forge/test/models/pytorch/text/dpr/test_dpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_dpr_context_encoder_pytorch(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="dpr", variant=variant, suffix="context_encoder")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load Bert tokenizer and model from HuggingFace
# Variants: facebook/dpr-ctx_encoder-single-nq-base, facebook/dpr-ctx_encoder-multiset-base
Expand Down Expand Up @@ -74,7 +74,7 @@ def test_dpr_question_encoder_pytorch(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load Bert tokenizer and model from HuggingFace
# Variants: facebook/dpr-question_encoder-single-nq-base, facebook/dpr-question_encoder-multiset-base
Expand Down Expand Up @@ -120,7 +120,7 @@ def test_dpr_reader_pytorch(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="dpr", variant=variant, suffix="reader")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load Bert tokenizer and model from HuggingFace
# Variants: facebook/dpr-reader-single-nq-base, facebook/dpr-reader-multiset-base
Expand Down
2 changes: 1 addition & 1 deletion forge/test/models/pytorch/text/falcon/test_falcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_falcon(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="falcon", variant=variant)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

tokenizer = AutoTokenizer.from_pretrained(variant)
model = FalconForCausalLM.from_pretrained(variant)
Expand Down
4 changes: 2 additions & 2 deletions forge/test/models/pytorch/text/fuyu/test_fuyu_8b.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_fuyu8b(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="fuyu", variant=variant)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

config = FuyuConfig.from_pretrained(variant)
config_dict = config.to_dict()
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_fuyu8b_past_cache(record_forge_property, variant, test_device):
module_name = build_module_name(framework=Framework.PYTORCH, model="fuyu", variant=variant)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Set Forge configuration parameters
compiler_cfg = forge.config._get_global_compiler_config()
Expand Down
16 changes: 8 additions & 8 deletions forge/test/models/pytorch/text/gemma/test_gemma_2b.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_gemma_2b_rotary_embedding(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Random see for reproducibility
torch.manual_seed(42)
Expand Down Expand Up @@ -108,7 +108,7 @@ def test_gemma_2b_rms_norm(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="gemma", variant=variant, suffix="rms_norm")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Random see for reproducibility
torch.manual_seed(42)
Expand Down Expand Up @@ -153,7 +153,7 @@ def test_gemma_2b_attention(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="gemma", variant=variant, suffix="attention")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Random see for reproducibility
torch.manual_seed(42)
Expand Down Expand Up @@ -200,7 +200,7 @@ def test_gemma_2b_mlp(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="gemma", variant=variant, suffix="mlp")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Random see for reproducibility
torch.manual_seed(42)
Expand Down Expand Up @@ -246,7 +246,7 @@ def test_gemma_2b_single_decoder(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Random see for reproducibility
torch.manual_seed(42)
Expand Down Expand Up @@ -291,7 +291,7 @@ def test_gemma_2b(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="gemma", variant=variant)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Random see for reproducibility
torch.manual_seed(42)
Expand Down Expand Up @@ -340,7 +340,7 @@ def test_gemma_2b_gen(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="gemma", variant=variant, suffix="gen")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Random seed for reproducibility
torch.manual_seed(42)
Expand Down Expand Up @@ -405,7 +405,7 @@ def test_gemma_2b_1x1_gen(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="gemma", variant=variant, suffix="gen_1x1")

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Random seed for reproducibility
torch.manual_seed(42)
Expand Down
4 changes: 2 additions & 2 deletions forge/test/models/pytorch/text/gpt2/test_gpt2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_gpt2_text_gen(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load tokenizer and model from HuggingFace
config = GPT2Config.from_pretrained(variant)
Expand Down Expand Up @@ -80,7 +80,7 @@ def test_gpt2_past_cache(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

compiler_cfg = forge.config._get_global_compiler_config()
compiler_cfg.compile_subgraphs = True
Expand Down
4 changes: 2 additions & 2 deletions forge/test/models/pytorch/text/gptneo/test_gptneo.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_gptneo_causal_lm(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="gptneo", variant=variant, task=Task.CAUSAL_LM)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Set random seed for repeatability
torch.manual_seed(42)
Expand Down Expand Up @@ -95,7 +95,7 @@ def test_gptneo_sequence_classification(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load tokenizer and model from HuggingFace
# Variants: # EleutherAI/gpt-neo-125M, EleutherAI/gpt-neo-1.3B,
Expand Down
4 changes: 2 additions & 2 deletions forge/test/models/pytorch/text/llama/test_llama3.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_llama3_causal_lm(record_forge_property, variant):
module_name = build_module_name(framework=Framework.PYTORCH, model="llama3", variant=variant, task=Task.CAUSAL_LM)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load model (with tokenizer)
tokenizer = download_model(AutoTokenizer.from_pretrained, variant)
Expand Down Expand Up @@ -185,7 +185,7 @@ def test_llama3_sequence_classification(record_forge_property, variant):
)

# Record Forge Property
record_forge_property("module_name", module_name)
record_forge_property("model_name", module_name)

# Load model (with tokenizer)
tokenizer = download_model(AutoTokenizer.from_pretrained, variant)
Expand Down
Loading

0 comments on commit 2b3e0f0

Please sign in to comment.