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

Loading BitBlasLinear takes a lot of Time #152

Open
MekkCyber opened this issue Aug 23, 2024 · 3 comments
Open

Loading BitBlasLinear takes a lot of Time #152

MekkCyber opened this issue Aug 23, 2024 · 3 comments
Labels
question Further information is requested

Comments

@MekkCyber
Copy link

MekkCyber commented Aug 23, 2024

Hello @LeiWang1999

I am trying to use the BitNet modeling in an other project to use bitblas kernels, when I load the model, and try to replace linear layers, with BitBlas Linear layers, the _get_or_create_bitblas_operator function takes a lot of time to execute and compile kernels based on the weight shape, for a model with 32 layers, with a hidden size of 4096 and intermediate size of 14336 it takes ~8 min. Is this an intended behaviour ? Thank you for your help

@LeiWang1999
Copy link
Contributor

Hi @MekkCyber , Yeah, when bitblas encounters a kernel configuration for the first time, it performs the compilation and stores the result in a database, which is located by default at ~/.cache/bitblas. The next time it encounters the same configuration, it retrieves the precompiled library directly from the database, bypassing the tuning process.

As a result, tuning only occurs the first time a specific model and its initial layer are encountered :)

@LeiWang1999
Copy link
Contributor

We’re also considering bypassing tuning by saving compilation results for different hardware setups, but this is challenging and may take some time to design and implement though :)

@MekkCyber
Copy link
Author

Thanks a lot @LeiWang1999 much clearer now

@LeiWang1999 LeiWang1999 added the question Further information is requested label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants