-
Notifications
You must be signed in to change notification settings - Fork 9
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
base: main
Are you sure you want to change the base?
Add phi-3-medium model #1235
Conversation
|
1 similar comment
|
|
1 similar comment
|
There was a problem hiding this 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): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have same test structure followed here?
Pls refer - https://github.com/tenstorrent/tt-forge-fe/blob/main/forge/test/models/pytorch/audio/stereo/test_stereo.py
framework_model.eval() | ||
input_prompt = "Africa is an emerging economy because" | ||
inputs = tokenizer(input_prompt, return_tensors="pt").to("cpu") | ||
with torch.no_grad(): |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
4ad89ea
to
b893bec
Compare
|
1 similar comment
|
|
1 similar comment
|
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) | ||
|
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls add verify function
No description provided.