GithubHelp home page GithubHelp logo

graphcore / gradient-huggingface Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 8.0 84.46 MB

Tasks and tutorials using Graphore's IPU with Hugging Face. Originally at https://github.com/gradient-ai/Graphcore-HuggingFace

Home Page: https://ipu.dev/3BFkBCt

License: MIT License

Shell 0.35% Python 34.64% Jupyter Notebook 63.62% C++ 1.39%

gradient-huggingface's Issues

Can you add support for unequal division with tensor parallelism for Llama 2

In the self-attention with tensor parallel implementaion (modelling/attention.py), the following check prevents me to use 12 ipus for the llama2 7B model:

assert (
            self.config.model.attention.heads % n_heads_groups == 0
        ), f"{self.config.model.attention.heads} % {n_heads_groups} != 0"

I can run it fine with 4, 8 and 16 IPUs. But with 12 IPUs it throws the following error:

Traceback (most recent call last):
  File "run-inference.py", line 65, in <module>
    main(args.config)
  File "run-inference.py", line 55, in main
    run_inference_popxl(config, tokenizer, hf_model=hf_model, sequence_length=2048)
  File "run-inference.py", line 15, in run_inference_popxl
    pipe = LlamaPipeline(config, hf_llama_checkpoint=hf_model, tokenizer=tokenizer)
  File "/scratch/user/u.ac/Gradient-HuggingFace/llama2-chatbot/api/pipeline.py", line 96, in __init__
    session: popxl.Session = inference(config)
  File "/scratch/user/u.ac/Gradient-HuggingFace/llama2-chatbot/inference.py", line 70, in inference
    layer_facts, layer_graph = LlamaDecoderBlockTP(config).create_graph(*embeddings_graph.graph.outputs)
  File "/scratch/user/u.ac/Gradient-HuggingFace/llama2-chatbot/modelling/decoder.py", line 28, in __init__
    self.attention = LlamaSelfAttentionTP(self.config)
  File "/scratch/user/u.ac/Gradient-HuggingFace/llama2-chatbot/modelling/attention.py", line 125, in __init__
    self.heads = LlamaAttentionHeads(config=config, replica_grouping=self.replica_grouping)
  File "/scratch/user/u.ac/Gradient-HuggingFace/llama2-chatbot/modelling/attention.py", line 44, in __init__
    assert (
AssertionError: 32 % 12 != 0

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.