Skip to content

Conversation

@edwardcapriolo
Copy link
Contributor

The global static TensorCache has a get method, which attempts to return a tensor of same type and shape from the cache. Tensors are always cleared when they are released to the cache. However there are many cases, maybe most of them where we do not need to clear the tensor as the next user will typically overwrite it entirely:

{noformat}
Response{responseText='The best thing to do is to look for the plant that best suits your needs. Avocados are a type of fruit that are grown in the Americas, specifically in Mexico, Central America, and South America. They are known for their creamy, buttery texture and rich, nutty flavor.', responseTextWithSpecialTokens='The best thing to do is to look for the plant that best suits your needs. Avocados are a type of fruit that are grown in the Americas, specifically in Mexico, Central America, and South America. They are known for their creamy, buttery texture and rich, nutty flavor.', finishReason=STOP_TOKEN, promptTokens=65, generatedTokens=64, promptTimeMs=10018, generateTimeMs=10779}
tensorcache.dirtyget 130
tensorcache.get 111609
tensorcache.get.hit 111582
tensorcache.getdirty.hit 126
{noformat}

I only put the method in place in a couple of places as I dont have enough knoweldge to put it in place everywhere:

edwardcapriolo/deliverance#4

@edwardcapriolo
Copy link
Contributor Author

@tjake I cant imagine the failed test have anything to do with the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant