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 Introduction

Training 🤗 Models on IPUs using Paperspace Gradient

Whether you are looking to generate images with Stable Diffusion, derive insights from text, or need to recognize audio samples, the examples in here have you covered.

Join our Slack community to interact with other developers!

Join our Slack Community

License

Unless otherwise specified by a LICENSE file in a subdirectory, the LICENSE referenced at the top level applies to the files in this repository.

“Jupyter” and the Jupyter logos are trademarks or registered trademarks of NumFOCUS, used by Graphcore with permission.

gradient-huggingface's People

Contributors

alex-coniasse avatar anjleeg-gcai avatar arsalanu avatar cbog avatar evawgraphcore avatar hiteshk-gc avatar hmellor avatar internetoftim avatar jamesrandom avatar jayniep-gc avatar katalinic-gc avatar kundamwiza avatar lrverkin avatar manuelesigona avatar marcins-gc avatar michaln-gc avatar nmb-paperspace avatar paperspace-sean avatar payoto avatar rahult-graphcore avatar rouxjohannes avatar s-maddrellmander avatar vvvm23 avatar zzweig avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.