Code Monkey home page Code Monkey logo

Comments (6)

hannanjgaws avatar hannanjgaws commented on July 22, 2024 1

By default the tutorial uses top_k=50 sampling, which performs multinomial sampling. If you would like to do deterministic sampling, you can set top_k=1 in your sampling call. This will perform deterministic greedy sampling

from transformers-neuronx.

dennj avatar dennj commented on July 22, 2024

I could fix the problem by setting n_positions=4096 before compiling the model.

neuron_model = LlamaForSampling.from_pretrained('./Llama-2-13b-split', batch_size=1, tp_degree=xla_device_count, n_positions=4096, amp='f16')

Maybe this flag should be added to the tutorial to avoid other people having to deal with the same problem :)

from transformers-neuronx.

jyang-aws avatar jyang-aws commented on July 22, 2024

Thanks @dennj for pointing out the issues. Yes, you can increase the number of positions by setting the n_positions variable. For example, to support up to 4k positions, you could do the following:

neuron_model = LlamaForSampling.from_pretrained(‘./Llama-2-13b-split’, batch_size=1, tp_degree=xla_device_count, amp=‘f16’, n_positions=4096)

We’ll update the documentations accordingly.

from transformers-neuronx.

dennj avatar dennj commented on July 22, 2024

Thanks :)
Updating the documentation will be helpful.

However the behaviour is non-deterministic, is ok to have a random behaviour in the library?

from transformers-neuronx.

aws-donkrets avatar aws-donkrets commented on July 22, 2024

Hi dennj - okay to close this ticket or do you have any other questions?

from transformers-neuronx.

mrnikwaws avatar mrnikwaws commented on July 22, 2024

Closing since there were no further comments

from transformers-neuronx.

Related Issues (20)

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.