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

from_gguf only supports CPU? #1486

Closed
sparqyeti opened this issue Dec 27, 2023 · 4 comments
Closed

from_gguf only supports CPU? #1486

sparqyeti opened this issue Dec 27, 2023 · 4 comments

Comments

@sparqyeti
Copy link

sparqyeti commented Dec 27, 2023

creating a quantized var builder is done with the code below:
in file: candle-transformers/src/quantized_var_builder.rs

impl VarBuilder {
    pub fn from_gguf<P: AsRef<std::path::Path>>(p: P) -> Result<Self> {
        let mut file = std::fs::File::open(p)?;
        let content = candle::quantized::gguf_file::Content::read(&mut file)?;
        let mut data = std::collections::HashMap::new();
        for tensor_name in content.tensor_infos.keys() {
            let tensor = content.tensor(&mut file, tensor_name)?;
            data.insert(tensor_name.to_string(), Arc::new(tensor));
        }
        Ok(Self {
            data: Arc::new(data),
            path: Vec::new(),
            device: Device::Cpu,
        })
    }

this implies GGUF only supports CPU and not GPU? Am I missing something is this actually a constraint.

@LaurentMazare
Copy link
Collaborator

Yes, quantized tensors are only supported on cpu at the moment.

@danielclough
Copy link
Contributor

Related open issues

Support for quantisation: #359
CUDA support for QMatMul: #655
Error: no cuda implementation for qmatmul: #696
Quantized models on Cuda: #1250
You are here: #1486

@hubertshelley
Copy link
Contributor

hubertshelley commented Feb 13, 2024

metal fixed : #1627

@LaurentMazare
Copy link
Collaborator

Closing this now in favor of #1250 , #1754 should also help with cuda support.

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

No branches or pull requests

4 participants