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

[NPU] Optimize Qwen2 lm_head to use INT4 #12072

Merged
merged 20 commits into from
Sep 14, 2024

Conversation

rnwang04
Copy link
Contributor

@rnwang04 rnwang04 commented Sep 12, 2024

Description

Optimize Qwen 2 7B lm_head to use INT4 for sym_int4 on NPU

https://github.com/analytics-zoo/nano/issues/1633#issuecomment-2348451555

verification

  • optimized Qwen2-7B
  • optimized Qwen2-7B with IPEX_LLM_CPU_LM_HEAD=1
  • non-optimized Qwen2-7B
  • optimized Qwen2-7B with save / load

@rnwang04 rnwang04 marked this pull request as draft September 12, 2024 10:12
@Oscilloscope98 Oscilloscope98 changed the title [Test] lm_head experiment [NPU] Optimize Qwen2 lm_head to use INT4 Sep 13, 2024
@rnwang04 rnwang04 marked this pull request as ready for review September 14, 2024 02:22
@rnwang04
Copy link
Contributor Author

rnwang04 commented Sep 14, 2024

@jason-dai Have refactored the whole code structure based on your comments and now this optimization can be easily used for other models. Would you minding take a look again ? 😊

Copy link
Contributor

@jason-dai jason-dai left a comment

Choose a reason for hiding this comment

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

LGTM

@rnwang04 rnwang04 merged commit 081af41 into intel-analytics:main Sep 14, 2024
1 check passed
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.

3 participants