1. 28 Nov, 2023 1 commit
    • Nicolas Patry's avatar
      Let each model resolve their own default dtype. (#1287) · ba552e1a
      Nicolas Patry authored
      # What does this PR do?
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      ba552e1a
  2. 23 Nov, 2023 1 commit
  3. 27 Sep, 2023 2 commits
    • OlivierDehaene's avatar
      feat: format code (#1070) · 47954b81
      OlivierDehaene authored
      47954b81
    • Nicolas Patry's avatar
      Support eetq weight only quantization (#1068) · 95a4bb69
      Nicolas Patry authored
      # What does this PR do?
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation
      
      ).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      
      ---------
      Co-authored-by: default avatarzhaosida <zhaosida@corp.netease.com>
      95a4bb69
  4. 26 Sep, 2023 2 commits
    • zhangsibo1129's avatar
      fix discard_names bug in safetensors convertion (#1052) · eba6ab1c
      zhangsibo1129 authored
      
      
      # What does this PR do?
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Model Class attributes `_tied_weights_keys`, `
      _keys_to_ignore_on_load_missing` can only be `None` or a List.
      `getattr(class_, "_keys_to_ignore_on_load_missing", [])` will return
      `None` if `_keys_to_ignore_on_load_missing` is None, and
      `discard_names.extend(None)` will trigger an exception, even though
      `_tied_weights_keys` exists.
      
      ## Who can review?
      
      @OlivierDehaene  @Narsil
      
      ---------
      Co-authored-by: default avatarNicolas Patry <patry.nicolas@protonmail.com>
      eba6ab1c
    • zhangsibo1129's avatar
      support local model config file (#1058) · edc95a0e
      zhangsibo1129 authored
      # What does this PR do?
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Support local config file to avoid unexpected `discard_names`, which
      causes #1057.
      
      In the case of launching local mode without `model.safetensors` file,
      the original code will result `discard_names = []` when
      `hf_hub_download` throws an connection error.
      ```python
      # server/text_generation_server/cli.py
          try:
              import transformers
              import json
          
          
              config_filename = hf_hub_download(model_id, revision=revision, filename="config.json")
              with open(config_filename, "r") as f:
                  config = json.load(f)
              architecture = config["architectures"][0]
          
              class_ = getattr(transformers, architecture)
          
              # Name for this varible depends on transformers version.
              discard_names = getattr(class_, "_tied_weights_keys", [])
              discard_names.extend(getattr(class_, "_keys_to_ignore_on_load_missing", []))
          
          except Exception as e:
              discard_names = []
      ```
      
      The expected `_tied_weights_keys` of OPT-1.3b is `["lm_head.weight"]`,
      and its tied weight `"model.decoder.embed_tokens.weight"` will be kept
      in the safetensors conversion. But the above empty `discard_names` will
      lead to `"lm_head.weight"` being kept and
      `"model.decoder.embed_tokens.weight"` being discard in the subsequent
      method `_remove_duplicate_names`, which causes error #1057.
      
      So add a local mode branch to get the expected `discard_names` like
      follows. This modification also applies to other models
      
      ```python
      # server/text_generation_server/cli.py
              if is_local_model:
                  config_filename = os.path.join(model_id, "config.json")
              else:
                  config_filename = hf_hub_download(model_id, revision=revision, filename="config.json")
      ```
      
      
      In addition, when `_tied_weights_keys` or
      `_keys_to_ignore_on_load_missing` is `None`, the above code will also
      throw an error unexpectedly. This is fixed in PR #1052
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [x] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [x] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
      N/A
      - [ ] Did you write any new necessary tests?  N/A
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      @Narsil
      edc95a0e
  5. 25 Sep, 2023 1 commit
    • Nicolas Patry's avatar
      Add AWQ quantization inference support (#1019) (#1054) · c5de7cd8
      Nicolas Patry authored
      # Add AWQ quantization inference support
      
      Fixes
      https://github.com/huggingface/text-generation-inference/issues/781
      
      This PR (partially) adds support for AWQ quantization for inference.
      More information on AWQ [here](https://arxiv.org/abs/2306.00978). In
      general, AWQ is faster and more accurate than GPTQ, which is currently
      supported by TGI.
      
      This PR installs 4-bit GEMM custom CUDA kernels released by AWQ authors
      (in `requirements.txt`, just one line change).
      
      Quick way to test this PR would be bring up TGI as follows:
      
      ```
      text-generation-server download-weights abhinavkulkarni/codellama-CodeLlama-7b-Python-hf-w4-g128-awq
      
      text-generation-launcher \
      --huggingface-hub-cache ~/.cache/huggingface/hub/ \
      --model-id abhinavkulkarni/codellama-CodeLlama-7b-Python-hf-w4-g128-awq \
      --trust-remote-code --port 8080 \
      --max-input-length 2048 --max-total-tokens 4096 --max-batch-prefill-tokens 4096 \
      --quantize awq
      ```
      
      Please note:
      * This PR was tested with FlashAttention v2 and vLLM.
      * This PR adds support for AWQ inference, not quantizing the models.
      That needs to be done outside of TGI, instructions
      
      [here](https://github.com/mit-han-lab/llm-awq/tree/f084f40bd996f3cf3a0633c1ad7d9d476c318aaa).
      * This PR only adds support for `FlashLlama` models for now.
      * Multi-GPU setup has not been tested. 
      * No integration tests have been added so far, will add later if
      maintainers are interested in this change.
      * This PR can be tested on any of the models released
      
      [here](https://huggingface.co/abhinavkulkarni?sort_models=downloads#models).
      
      Please refer to the linked issue for benchmarks for
      
      [abhinavkulkarni/meta-llama-Llama-2-7b-chat-hf-w4-g128-awq](https://huggingface.co/abhinavkulkarni/meta-llama-Llama-2-7b-chat-hf-w4-g128-awq)
      vs
      
      [TheBloke/Llama-2-7b-Chat-GPTQ](https://huggingface.co/TheBloke/Llama-2-7b-Chat-GPTQ).
      
      Please note, AWQ has released faster (and in case of Llama, fused)
      kernels for 4-bit GEMM, currently at the top of the `main` branch at
      https://github.com/mit-han-lab/llm-awq, but this PR uses an older commit
      that has been tested to work. We can switch to latest commit later on.
      
      ## Who can review?
      
      @OlivierDehaene OR @Narsil
      
      ---------
      
      
      
      # What does this PR do?
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation
      
      ).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      
      ---------
      Co-authored-by: default avatarAbhinav M Kulkarni <abhinavkulkarni@gmail.com>
      Co-authored-by: default avatarAbhinav Kulkarni <abhinav@concentric.ai>
      c5de7cd8
  6. 28 Aug, 2023 1 commit
    • Nicolas Patry's avatar
      Fixing the lora adaptation on docker. (#935) · 4486f78c
      Nicolas Patry authored
      # What does this PR do?
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      4486f78c
  7. 11 Aug, 2023 1 commit
    • Nicolas Patry's avatar
      Upgrade transformers (fix protobuf==3.20 issue) (#795) · cc7bb508
      Nicolas Patry authored
      # What does this PR do?
      
      Fixes #531
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      cc7bb508
  8. 03 Aug, 2023 2 commits
    • Nicolas Patry's avatar
      Merge BNB 4bit. (#770) · 16fadcec
      Nicolas Patry authored
      # What does this PR do?
      
      
      See #626 
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation
      
      ).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      
      ---------
      Co-authored-by: default avatarkrzim <zimmerk4@live.com>
      16fadcec
    • Nicolas Patry's avatar
      feat(server): Add native support for PEFT Lora models (#762) · ac736fd8
      Nicolas Patry authored
      - Will detect `peft` model by finding `adapter_config.json`.
      - This triggers a totally dedicated `download-weights` path
      - This path, loads the adapter config, finds the base model_id
      - It loads the base_model
      - Then peft_model
      - Then `merge_and_unload()`
      - Then `save_pretrained(.., safe_serialization=True)
      - Add back the config + tokenizer.merge_and_unload()`
      - Then `save_pretrained(.., safe_serialization=True)
      - Add back the config + tokenizer.
      - The chosen location is a **local folder with the name of the user
        chosen model id**
      
      PROs:
      
      - Easier than to expect user to merge manually
      - Barely any change outside of `download-weights` command.
      - This means everything will work in a single load.
      - Should enable out of the box SM + HFE
      
      CONs:
      
      - Creates a local merged model in unusual location, potentially
        not saved across docker reloads, or ovewriting some files if the PEFT
        itself was local and containing other files in addition to the lora
      
      Alternatives considered:
      - Add `local_files_only=True` every where (discard because of massive
        code change for not a good enough reason)
      - Return something to `launcher` about the new model-id (a cleaner
        location for this new model), but it would
        introduce new communication somewhere where we didn't need it before.
      - Using the HF cache folder and *stopping* the flow after
        `download-weights` and asking user to restart with the actual local
        model location
      
      
      Fix #482 
      
      
      # What does this PR do?
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      ac736fd8
  9. 18 Jul, 2023 1 commit
    • Nicolas Patry's avatar
      feat(server): Reworking the quantization script so it's still universal (not llama specific) (#587) · 4d38a1c4
      Nicolas Patry authored
      but should work on more configurations (no need for 2 GPUs, less RAM
      usage).
      
      
      # What does this PR do?
      
      Reworking the quantization script so it's still universal (not llama
      specific)
      
      but should work on more configurations (no need for 2 GPUs, less RAM
      usage).
      
      Still need to investigate the potential differences in quantization
      results.
      
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      4d38a1c4
  10. 07 Jul, 2023 1 commit
  11. 30 Jun, 2023 1 commit
  12. 26 Jun, 2023 1 commit
    • Nicolas Patry's avatar
      feat(server): Add inference support for GPTQ (llama + falcon tested) + Quantization script (#438) · aefde28b
      Nicolas Patry authored
      Let's start discussing implementation.
      
      - Need to expose the quantization scripts (either included here or add
      doc on how to use https://github.com/qwopqwop200/GPTQ-for-LLaMa)
      - Make sure GPTQ works for multiple models (priority to Falcon).
      
      Currently it means that every place we use `get_{tensor|sharded}` to
      check for quantization.
      
      My idea is to reintegrate as much as possible into `utils/layer.py` by
      expanding `load_multi` to be a bit more generic.
      This might require some thinking, but ultimately the
      `qweight,qzeros,scales,g_idx` should be in a single place, and
      independant of bias presence.
      
      # What does this PR do?
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation
      
      ).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      
      ---------
      Co-authored-by: default avatarUbuntu <ubuntu@ip-172-31-41-161.ec2.internal>
      Co-authored-by: default avatarOlivierDehaene <olivier@huggingface.co>
      aefde28b
  13. 23 May, 2023 1 commit
  14. 12 May, 2023 1 commit
    • Nicolas Patry's avatar
      feat(server): GPTQ quantization (step1) (#277) · 76a48cd3
      Nicolas Patry authored
      Changes only the type from `bool` to `Option<Enum>` pretty much
      everywhere.
      - Use `Optional[str]` in Python (easier to manage than importing type
      everywhere). Except for the cli to get proper validation
      - Updated all models to handle gracefully new values. (Error out if
      unknown value, or gptq since not implemented).
      
      <!--
      Congratulations! You've made it this far! You're not quite done yet
      though.
      
      Once merged, your PR is going to appear in the release notes with the
      title you set, so make sure it's a great title that fully reflects the
      extent of your awesome contribution.
      
      Then, please replace this with a description of the change and which
      issue is fixed (if applicable). Please also include relevant motivation
      and context. List any dependencies (if any) that are required for this
      change.
      
      Once you're done, someone will review your PR shortly (see the section
      "Who can review?" below to tag some potential reviewers). They may
      suggest changes to make the code even better. If no one reviewed your PR
      after a week has passed, don't hesitate to post a new comment
      @-mentioning the same persons---sometimes notifications get lost.
      -->
      
      <!-- Remove if not applicable -->
      
      Fixes # (issue)
      
      
      ## Before submitting
      - [ ] This PR fixes a typo or improves the docs (you can dismiss the
      other checks if that's the case).
      - [ ] Did you read the [contributor
      guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
            Pull Request section?
      - [ ] Was this discussed/approved via a Github issue or the
      [forum](https://discuss.huggingface.co/)? Please add a link
            to it if that's the case.
      - [ ] Did you make sure to update the documentation with your changes?
      Here are the
      [documentation
      guidelines](https://github.com/huggingface/transformers/tree/main/docs),
      and
      [here are tips on formatting
      docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
      - [ ] Did you write any new necessary tests?
      
      
      ## Who can review?
      
      Anyone in the community is free to review the PR once the tests have
      passed. Feel free to tag
      members/contributors who may be interested in your PR.
      
      <!-- Your PR will be replied to more quickly if you can figure out the
      right person to tag with @
      
      
      @OlivierDehaene OR @Narsil
      
       -->
      76a48cd3
  15. 03 May, 2023 1 commit
  16. 16 Apr, 2023 1 commit
  17. 30 Mar, 2023 1 commit
  18. 07 Mar, 2023 1 commit
  19. 14 Feb, 2023 1 commit
  20. 13 Feb, 2023 1 commit
  21. 03 Feb, 2023 1 commit
  22. 31 Jan, 2023 1 commit
  23. 05 Jan, 2023 1 commit
  24. 28 Oct, 2022 1 commit
  25. 27 Oct, 2022 1 commit
  26. 22 Oct, 2022 1 commit
  27. 20 Oct, 2022 1 commit
  28. 17 Oct, 2022 1 commit