Skip to content

Parallel Quantize.sh, add & #106

Closed
Closed

Description

@tljstewart

@prusnak

./quantize "$i" "${i/f16/q4_0}" 2 &

Activity

  1. prusnak commented on Mar 14, 2023

    @prusnak
    Contributor

    The fix need to be more elaborate, because if you pass --remove-f16 then the rm command is called before ./quantize has finished.

    Can you come up with a solution that does not have this issue?

  2. prusnak commented on Mar 14, 2023

    @prusnak
    Contributor

    This should work:

    Yes, this works. But now I realised this completely defeats the purpose of the remove flag. The remove flag is there to save disk space after each conversion has been done. So this means the remove flag only makes sense when processing the files one after each other.

    @ggerganov Do you think it makes sense to run the script in parallel by default and switch to serial processing when --remove-f16 is provided or do we want to have a separate orthogonal flag for parallel/serial processing?

  3. tljstewart commented on Mar 14, 2023

    @tljstewart
    Author

    ah I see what you mean, swapping disk resources

  4. ggerganov commented on Mar 14, 2023

    @ggerganov
    Member

    I think it is better to multi-thread the quantize.cpp program.
    Each tensor is divided in n parts and each of the n threads quantizes the corresponding part.
    This way, even when quantizing the 7B model which has only 1 part, we will utilize all available CPU resources and still gain performance.

    If you agree, either reformulate this issue and add "good first issue" tag or create a new one and close this.

  5. prusnak commented on Mar 14, 2023

    @prusnak
    Contributor

    I think it is better to multi-thread the quantize.cpp program.

    I agree. This makes sense especially for this reason:

    This way, even when quantizing the 7B model which has only 1 part, we will utilize all available CPU resources

    If you agree, ...

    ACK

    FWIW, I really respect your shell skills @tljstewart 👍

  6. prusnak commented on Mar 19, 2023

    @prusnak
    Contributor

    Done another way (rewrite to python) in #222

  7. added a commit that references this issue on Apr 28, 2026
  8. 43 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions