bytedance / MRECG

Apache License 2.0
34 stars 3 forks source link

python implementation of module capacity calculation #5

Open shoayi opened 11 months ago

shoayi commented 11 months ago

Hello! After reading your paper carefully, the method proposed in the paper is effective for PTQ, and I am very interested in your method. As for the module capacity calculation method mentioned in the question, I want to know the specific python implementation of this method, but I did not find the relevant code in the project. Could you please provide the code of this part?

BobxmuMa commented 9 months ago

Sorry for not seeing the message in time.

There are many repositories for calculating the number of parameters of a model. You can use these repositories to calculate the number of parameters for each module. You can calculate the ModCap of each module according to equation 3 in the paper, and the corresponding hyperparameters are also provided in the paper. After getting the ModCap you can construct the optimization problem and solve it according to Eq. 4.

Our approach to solving this optimization problem involved a selective manual process. We observed that using a loss metric to obtain a quantization model yielded more effective results than incorporating the ModCap. Therefore, we chose not to include the ModCap component in our final approach.

Best wishes.