Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add phi-3-medium model #1235

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add phi-3-medium model #1235

wants to merge 1 commit into from

Conversation

dsudhakarTT
Copy link
Contributor

No description provided.

@dsudhakarTT dsudhakarTT self-assigned this Feb 18, 2025
Copy link

TestsPassed ✅Skipped ⚠️Failed
TT-Forge-FE Tests601 ran480 passed121 skipped0 failed
TestResult
No test annotations available

1 similar comment
Copy link

TestsPassed ✅Skipped ⚠️Failed
TT-Forge-FE Tests601 ran480 passed121 skipped0 failed
TestResult
No test annotations available

Copy link

TestsPassed ✅Skipped ⚠️Failed
TT-Forge-FE Tests660 ran520 passed140 skipped0 failed
TestResult
No test annotations available

1 similar comment
Copy link

TestsPassed ✅Skipped ⚠️Failed
TT-Forge-FE Tests660 ran520 passed140 skipped0 failed
TestResult
No test annotations available

Copy link
Contributor

@ashokkumarkannan1 ashokkumarkannan1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @dsudhakarTT . Please address the comments given and update the PR description with relevant details.



@pytest.mark.parametrize("variant", variants)
def test_phi3_causal_lm(variant):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

framework_model.eval()
input_prompt = "Africa is an emerging economy because"
inputs = tokenizer(input_prompt, return_tensors="pt").to("cpu")
with torch.no_grad():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens without with torch.no_grad():

op = framework_model(inputs["input_ids"], inputs["attention_mask"])
logger.info(f"op={op}")
module_name = build_module_name(variant, Source.HUGGINGFACE, Framework.PYTORCH, Task.CAUSAL_LM)
compiled_model = forge.compile(framework_model, [inputs["input_ids"], inputs["attention_mask"]], module_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add verify function too

@dsudhakarTT dsudhakarTT force-pushed the dsudhakar/phi-3-medium branch from 4ad89ea to b893bec Compare February 26, 2025 13:38
Copy link

TestsPassed ✅Skipped ⚠️Failed
TT-Forge-FE Tests613 ran481 passed132 skipped0 failed
TestResult
No test annotations available

1 similar comment
Copy link

TestsPassed ✅Skipped ⚠️Failed
TT-Forge-FE Tests613 ran481 passed132 skipped0 failed
TestResult
No test annotations available

Copy link

TestsPassed ✅Skipped ⚠️Failed
TT-Forge-FE Tests672 ran536 passed136 skipped0 failed
TestResult
No test annotations available

1 similar comment
Copy link

TestsPassed ✅Skipped ⚠️Failed
TT-Forge-FE Tests672 ran536 passed136 skipped0 failed
TestResult
No test annotations available

def test_phi3_causal_lm(record_forge_property, variant):

# Build Module Name
module_name = build_module_name(variant, Source.HUGGINGFACE, Framework.PYTORCH, Task.CAUSAL_LM)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's update to

    # Build Module Name
     module_name = build_module_name(
         framework=Framework.PYTORCH,
         model="phi3",
         variant=variant,
         task=Task.CAUSAL_LM,
         source=Source.HUGGINGFACE,
     )

sample_inputs = [inputs["input_ids"], inputs["attention_mask"]]

# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs, module_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add verify function


# Forge compile framework model
compiled_model = forge.compile(framework_model, inputs, module_name)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add verify function

inputs = [inputs["input_ids"]]

# Forge compile framework model
compiled_model = forge.compile(framework_model, inputs, module_name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add verify function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants