Skip to content

Recommendation for quantizing models to fp8 that don't fit on a single GPU (Mixtral) #1777

Closed

Description

@bprus

Hi, I want to quantize Mixtral model to fp8. I have a single H100 GPU. The original model doesn't fit on a single GPU (but quantized does). Up until #1598, there was an option to run quantization with the --device cpu option, but it was removed.
What was the motivation behind this decision?
I was able to bring back this functionality by changing the code a bit. I've successfully built the Mixtral engine in fp8 and served it with Triton.
I see some quality issues, as described in #1738 (comment), but I don't think they are related to this.
What should I expect from a model quantized on CPU? Is it a totally wrong approach? Are there any issues with it?
If it's not a proper way to quantize a model, could you suggest an approach I should take?
Probably using a machine with 2xH100 GPUs is a solution, but getting access to such a machine is very hard because of availability 😅

Activity

  1. nv-guomingz commented on Jun 13, 2024

    @nv-guomingz
    Collaborator

    good question.

    @syuoni would u please answer the question about removing --device cpu knob?

  2. syuoni commented on Jun 14, 2024

    @syuoni
    Collaborator

    Thanks @bprus for reporting this. I've started to bring back the device flag to quantize.py.

    Just to double-check with you, running calibration on cpu is extremely slow for a large model like mixtral, right?

  3. bprus commented on Jun 14, 2024

    @bprus
    ContributorAuthor

    Thanks.
    I wouldn't say it's extremely slow. It's much slower than using GPU, but I think the whole process of quantization and engine building takes under 1h. I'll measure the time on Monday.

  4. added
    triaged
    question
    Low Precision
    on Jun 14, 2024
  5. bprus commented on Jun 17, 2024

    @bprus
    ContributorAuthor

    Hi @syuoni
    I measured the time, and it took:
    Quantization done. Total time used: 3022.70 s.
    and additional Total time used 157.01 s. for saving.
    I'm using 24 cores AMD EPYC 9334 CPU.

  6. nv-guomingz commented on Jun 17, 2024

    @nv-guomingz
    Collaborator

    Hi @syuoni I measured the time, and it took: Quantization done. Total time used: 3022.70 s. and additional Total time used 157.01 s. for saving. I'm using 24 cores AMD EPYC 9334 CPU.

    At least,we can run fp8 quantization with single gpu card now.
    The changes @syuoni made will be in coming weekly update and you may have a try again.

    Could we close this ticket now?

  7. bprus commented on Jun 17, 2024

    @bprus
    ContributorAuthor

    Sure, thanks for all the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Low Precisionquestiontriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions