Coder Social home page Coder Social logo

Comments (4)

an-yongqi avatar an-yongqi commented on June 11, 2024

Hi, @liuxiaozhu01. Thank you for your interest in our work! Your observation about the implementation detail is correct. The reason I apply a square operation to the attn_metric but not to the mlp_metric is because I aim to aggregate the group channel metrics of attn_head using the L2 norm, which is represented by the code snippet "W_metric = W_metric.reshape(-1, 128).sum(dim=1)". Ideally, this operation would be followed by a square root to complete the L2 norm calculation. However, I omitted the square root step since it does not affect the ordering of the elements, which is our primary concern in this context. This detail stems from our experimental observations and theoretical considerations, suggesting that treating these components differently could yield optimal pruning results.

I hope this explanation clarifies the reasoning behind our implementation choices. Should you have any further questions or need additional details, feel free to ask!

from flap.

liuxiaozhu01 avatar liuxiaozhu01 commented on June 11, 2024

Thanks for your reply! I think i get your idea.

From my understanding, the WIFV correspond the Eq. (5) in your paper, and after the group channel metrics of attn_head is aggregated, the metrics for every attn_head(attn_metric in the code) is squared actually while mlp's(mlp_metric in the code) is not. Due to the standarlization, attn_metric and mlp_metric are in the same scale so global sort, which means concat and sort, is reasonable.

Is that a correct understanding?

from flap.

an-yongqi avatar an-yongqi commented on June 11, 2024

Thanks for your reply! I think i get your idea.

From my understanding, the WIFV correspond the Eq. (5) in your paper, and after the group channel metrics of attn_head is aggregated, the metrics for every attn_head(attn_metric in the code) is squared actually while mlp's(mlp_metric in the code) is not. Due to the standarlization, attn_metric and mlp_metric are in the same scale so global sort, which means concat and sort, is reasonable.

Is that a correct understanding?

Yes, it is correct. To elaborate, the most meticulous implementation would indeed entail an initial standardization of the attn_metric. Following this, we would proceed to square the attn_metric values. Next, we'd aggregate the group channel metrics derived from attn_head, and take the square root of the resulting value. Finally, we'd carry out a combined sorting of the refined attn_metric and mlp_metric.

In practice, the performance impact resulting from the differences between the two is minimal. This is largely due to the fact that standardization ensures both metrics are normalized to the same scale, which validates the use of a global sorting procedure. I appreciate your astute observation.

from flap.

liuxiaozhu01 avatar liuxiaozhu01 commented on June 11, 2024

It's been very rewarding. Thank you for your generous help!

from flap.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.