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

First series of P0 patterns to optimize llama #1490

Merged
merged 17 commits into from
May 29, 2024
Merged

Conversation

xadupre
Copy link
Member

@xadupre xadupre commented May 2, 2024

No description provided.

Copy link

codecov bot commented May 2, 2024

Codecov Report

Attention: Patch coverage is 88.77551% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 77.60%. Comparing base (34e410a) to head (36eb15b).

Files Patch % Lines
onnxscript/rewriter/llama_rule_sets.py 86.36% 2 Missing and 4 partials ⚠️
onnxscript/rewriter/llama_rule_sets_test.py 90.74% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1490      +/-   ##
==========================================
+ Coverage   77.56%   77.60%   +0.03%     
==========================================
  Files         216      218       +2     
  Lines       23339    23437      +98     
  Branches     4025     4046      +21     
==========================================
+ Hits        18103    18188      +85     
- Misses       4453     4459       +6     
- Partials      783      790       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xadupre
Copy link
Member Author

xadupre commented May 2, 2024

def example2(X: FLOAT[2, 1024]) -> FLOAT[2, 1024]:, the pattern works for any type, any 2D shape, so I would prefer to avoid to be that precise.

onnxscript/rewriter/llama_rule_sets.py Fixed Show fixed Hide fixed
onnxscript/rewriter/llama_rule_sets.py Fixed Show fixed Hide fixed
onnxscript/rewriter/llama_rule_sets.py Fixed Show fixed Hide fixed
onnxscript/rewriter/llama_rule_sets.py Fixed Show fixed Hide fixed
onnxscript/rewriter/llama_rule_sets.py Fixed Show fixed Hide fixed
@xadupre
Copy link
Member Author

xadupre commented May 3, 2024

I tried to follow the recommandations. I get the following error:

FAILED onnxscript/rewriter/llama_rule_sets_tests.py::LlamaRuleSetsTest::test_llama_p0_rule_set_identity - TypeError: Cannot convert <class 'onnxscript.ir._core.Input'> to ValuePattern
FAILED onnxscript/rewriter/llama_rule_sets_tests.py::LlamaRuleSetsTest::test_llama_p0_rule_set_transpose_transpose - TypeError: Cannot convert <class 'onnxscript.ir._core.Input'> to ValuePattern

CI is passing...

@xadupre xadupre marked this pull request as ready for review May 6, 2024 08:23
Copy link
Collaborator

@justinchuby justinchuby left a comment

Choose a reason for hiding this comment

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

lgtm with minor comments. Thanks!

onnxscript/rewriter/llama_rule_sets.py Outdated Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets.py Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets.py Outdated Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets.py Outdated Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets.py Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets.py Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets.py Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets_tests.py Outdated Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets_tests.py Outdated Show resolved Hide resolved
onnxscript/rewriter/llama_rule_sets_tests.py Outdated Show resolved Hide resolved
@xadupre xadupre merged commit 1b2ecf5 into microsoft:main May 29, 2024
40 of 42 checks passed
@xadupre xadupre self-assigned this Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants