Code Monkey home page Code Monkey logo

Comments (3)

mrnikwaws avatar mrnikwaws commented on August 24, 2024

Hi @enochlev,

It looks like you are trying to generate the remaining tokens in a sequence given a common prefix. Given this is your goal, you need to ensure that the suffix you are attempting to encode, begins with the correct indices into the KV cache. This should be the last token index of the common prefix. Note that it may still be more performant to generate a larger context encoding depending on your use case

from transformers-neuronx.

enochlev avatar enochlev commented on August 24, 2024

Based on your comment, are you are telling me that the cache_ids have to be correctly incrementally aligned? I thought I did so in my example

First forward call: (prefix)
input_ids: [[0, 0, 0, 0, 0, 0, 0 ...., 13, 4013, 5828, 338, 1048, 29871]]
cache_ids: [ 0, 1, 2, 3, 4, 5, 6....., 794, 795, 796, 797, 798, 799]

Standard forward call with live cache
input_ids: [[1058]]
cache_ids: [800]
**probabilities seems to be fine with this

Next forward call to skip 4 forward calls..#what I am trying to implement
input_ids: [[29871, 263, 5381, 767, 1058]]
cache_ids: [801, 802, 803, 804, 805].
**probabilities seemed to get messed up with this even though the cache_ids are aligned

When you are mentioned prefix, are you suggesting the set_prefixed function call?

from transformers-neuronx.

enochlev avatar enochlev commented on August 24, 2024

I am assuming its not solvable at the moment, or I misunderstood your reply.

I will be closing issue in a few days

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.