Fix incorrect sorting of activation_files
causing improper FFN offload
#247
Labels
bug-unconfirmed
Unconfirmed bugs
Prerequisites
Before submitting your issue, please ensure the following:
Current Behavior
Hi! First of all, I want to thank you for your great work! I was reviewing some code and noticed an implementation that seems to behave differently from what was likely intended.
Specifically, in the
powerinfer-py/powerinfer/export_split.py
file, theload_activation_weights
function appears to have an issue with sorting theactivation_files
array.When printing the
activation_files
array using ReluLLaMA-7B model, I observed the following output:['activation_0.pt', 'activation_1.pt', 'activation_10.pt', 'activation_11.pt', 'activation_12.pt', 'activation_13.pt', 'activation_14.pt', 'activation_15.pt', 'activation_16.pt', 'activation_17.pt', 'activation_18.pt', 'activation_19.pt', 'activation_2.pt', 'activation_20.pt', 'activation_21.pt', 'activation_22.pt', 'activation_23.pt', 'activation_24.pt', 'activation_25.pt', 'activation_26.pt', 'activation_27.pt', 'activation_28.pt', 'activation_29.pt', 'activation_3.pt', 'activation_30.pt', 'activation_31.pt', 'activation_4.pt', 'activation_5.pt', 'activation_6.pt', 'activation_7.pt', 'activation_8.pt', 'activation_9.pt']
It looks like the files might not be sorted correctly, which could lead to improper FFN offloading.
Proposed Solution
I tried modifying the function as follows:
With this change, the
activation_files
array is now printed as follows:After this adjustment, I noticed a decrease in eval time.
If I've made any mistakes in my observations, I'd appreciate any corrections!
I've submitted a pull request with this change--please take a look when you have time :)
link to pull request
Environment and Context
Please provide detailed information about your computer setup. This is important in case the issue is not reproducible except for under certain specific conditions.
The text was updated successfully, but these errors were encountered: