Code Monkey home page Code Monkey logo

Comments (4)

linux-leo avatar linux-leo commented on September 27, 2024

I also encountered this issue before, can confirm. Probably works with fp16 though, so a simple conversion built into the script may be enough to get it working.

from mergekit.

ehartford avatar ehartford commented on September 27, 2024

I tried convert to fp16

def decompose_delta_weight(
    new_weight: torch.Tensor,
    base_weight: torch.Tensor,
    reduced_rank: int,
    device: Optional[str] = None,
) -> Tuple[torch.Tensor, torch.Tensor]:
    if device is None:
        device = "cuda" if torch.cuda.is_available() else "cpu"

    new_weight = new_weight.half().to(device)
    base_weight = base_weight.half().to(device)

Then I get:

  File "/home/ehartford/mergekit/mergekit/scripts/extract_lora.py", line 36, in _low_rank_decomposition
    U, S, Vh = torch.linalg.svd(weight, full_matrices=False)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: "svd_cuda_gesvdj" not implemented for 'Half'

from mergekit.

thomasgauthier avatar thomasgauthier commented on September 27, 2024

@ehartford thanks for pointing this out. It seems torch.linalg.svd only works with full precision fp32 (so .float() instead of .half() should work). Working on a fix right now. Should be up in a few minutes.

from mergekit.

thomasgauthier avatar thomasgauthier commented on September 27, 2024

Ok, fix is now live on the lora-extraction branch

@cg123 can we merge it into main and close this?

from mergekit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.