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

Be able to keep intermediate imatrix results #5077

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Conversation

ikawrakow
Copy link
Contributor

@ikawrakow ikawrakow commented Jan 22, 2024

It seems there is a lot of experimentation with the importance matrix going on, and user would like to be able to compute imatrix results for different numbers of tokens in one go.

This PR adds this ability:

./imatrix -m <some_model> -o <some_file> --keep-imatrix 50 [other parameters]

will result in imatrix results being kept for each number of chunks divisible by 50 in some_file.at_50, some_file.at_100, etc.

@ggerganov ggerganov merged commit 15bceec into master Jan 22, 2024
41 of 46 checks passed
@ggerganov ggerganov deleted the ik/keep_imatrix branch January 22, 2024 12:18
@Nexesenex
Copy link
Contributor

Great job!
And because I'm abusive, here's another idea.

As soon as the matrix calculation is not fully offloaded on GPU, calculating thousands of chunks straight ain't short, especially for big models.

Would it be possible to resume iMatrix calculations from a previous checkpoint created by this PR at a given ctx size, considering that (and I'm captain obvious here) at equal ctx size the calculations seem to be identical from one run to another at each given step?

Ideally, there should be a warning if the user selects a matrix file with a different ctx size to resume a Matrix calculation (it's easy to mess batch files with ctx numbers ^^). But not for the model itself, for renaming and fixing typos in model naming is quite common, at least for me!

jordankanter pushed a commit to jordankanter/llama.cpp that referenced this pull request Feb 3, 2024
Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
hodlen pushed a commit to hodlen/llama.cpp that referenced this pull request Apr 1, 2024
Co-authored-by: Iwan Kawrakow <iwan.kawrakow@gmail.com>
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.

4 participants