Live data from Hacker News

TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

github.com

51–60 of 61 posts

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#51
post #45

Earlier quoted context omitted.

1- yes, Gorgie twetted he is looking into it[0]. 2- The only 2 i know of are airoboros[1] and Hydra which is still in progress. [0] https://x.com/ggerganov/status/1698667093711880687?s=46&t=Jp... [1] https://github.com/jondurbin/airoboros#lmoe

Thanks. Yes, I've seen airoboros, it aims to use a mixture of fine-tunes of the base model if I recall correctly. Not a truly pre-trained MOE, but could be useful. Hydra, is this it? https://github.com/SkunkworksAI/hydra-moe

Yes, it's fine-tuned models, hopefully the community find use-cases where it will shine. Regarding Hydra, yes, that's the one. To stay updated, join the Discord mentioned in the repo.

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#52
post #40

Earlier quoted context omitted.

AFAIK re-warming it up and then gradually decreasing it again ought to work fine. Have you seen any research showing that it doesn't?

That would work, in that it would allow one to continue decreasing the loss, but I wouldn't say that it would work "fine". A model trained with restarts always performs worse than a model trained for the same duration without restarts.

> A model trained with restarts always performs worse than a model trained for the same duration without restarts.

Citation would be nice. From my experience restart sometimes is required. When model gets unstable and 'explodes', or gets stuck in some local minima. This is common with GANs. I usually rollback the model a bit, but keep the latest discriminator. So that discriminator 'knows' what to expect. It works in most cases, except for the 'fatality', when model blows up no matter what. That's the end of training.

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#53

Earlier quoted context omitted.

A single GPU with a batch size of 1 can serve many users, higher batch sizes can serve many dozens, pool a few and you can serve a sizable userbase. It may not be super profitable, but its not untenable either.

LLMs are GPU compute-bound. If you infer at batch_size = 1 on a model like Llama 2 7B on a "cheap" GPU like a T4 or an L4 it'll use about 100% of the compute, which means you get no benefit from batching. The exception is the A100 GPU which does not use 100% of GPU compute and therefore you get benefit from batching, but is hella expensive. The economics are not simple, and in most cases "just use the ChatGPT API" is…

> "cheap" GPU like a T4 or an L4 it'll use about 100% of the compute,

LLM with batch_size=1 technically cannot use '100%' of GPU. Because it has to move a lot of data around and use different blocks of GPU. So, when tensor cores are used cuda cores are idle. Tensor cores are used for matrix multiplication, cuda cores for activation functions (I'm simplifying). Model has to use both at different times moving data between them. Meanwhile GPU monitor may report 100%. But it's still possible to insert another process. I think I've seen this idea in Pytorch docs.

As for 1.1B LLM, it would be nice. Interesting experiment anyway. I'm only afraid that with big and diverse dataset model will focus more on memorization and generic logic may not emerge. They aren't doing anything new in terms of architecture and training methods.

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#54
post #36

Earlier quoted context omitted.

> ?? A 3060 or a slightly bigger AMD/Intel GPU can stream llama 7B about as fast as someone can read, That's the thing: you need a whole GPU per concurrent user, this is insanely expensive if you want to run it as part of a SaaS (which is what most for-profit want to do). Of course running models locally is much better in almost every regard, but nobody is gonna be a billionaire with that…

Your point is anticipated by the next sentence in the comment you replied to: "A somewhat bigger consumer GPU can batch it and serve dozens of users." Did you not read it?

“dozens” doesn't really change the economics here. A SaaS can serve a thousand of concurrent users on computers that is the price of a 4090, so we're still 2 orders of magnitudes off compared to regular SaaS business models.

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#55
post #48

Are they upsampling - whatever that means in the context of datasets? AFAIU slim pajama is about 627B tokens, and Starcoder: > approximately 250 Billion tokens. Ed: I see TFA says: > Combined Dataset Size - Around 950B tokens > Total Tokens During Training - 3 trillion (slightly more than 3 epochs/1430k steps) ... but I'm not seeing how one becomes three? That's more like 1 trillion than 3 trillion tokens?

Three epochs means it sees each token three times. The dataset is ~1T like you said.

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#56
post #36

Earlier quoted context omitted.

Your point is anticipated by the next sentence in the comment you replied to: "A somewhat bigger consumer GPU can batch it and serve dozens of users." Did you not read it?

“dozens” doesn't really change the economics here. A SaaS can serve a thousand of concurrent users on computers that is the price of a 4090, so we're still 2 orders of magnitudes off compared to regular SaaS business models.

Sure it does:

- Most apps are not non-stop token generation for concurrent users-- ChatGPT's duty cycle at this is very low.

- A 4090 amortized over 4 years, working days & hours, is 20 cents per working hour; this is basically the same as the power going into it. It's less than a penny per hour per concurrent on a task like this.

- Hopefully you're using LLM to deliver value that's worth more than a penny per hour of the people using it.

- If you hit massive scale and want to buy A100s to improve the economics because you're drowning in business, you can go ahead and readily do that at that time...

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#57
post #56

Earlier quoted context omitted.

“dozens” doesn't really change the economics here. A SaaS can serve a thousand of concurrent users on computers that is the price of a 4090, so we're still 2 orders of magnitudes off compared to regular SaaS business models.

Sure it does: - Most apps are not non-stop token generation for concurrent users-- ChatGPT's duty cycle at this is very low. - A 4090 amortized over 4 years, working days & hours, is 20 cents per working hour; this is basically the same as the power going into it. It's less than a penny per hour per concurrent on a task like this. - Hopefully you're using LLM to deliver value that's worth more than a penny per hour o…

> A 4090 amortized over 4 years, working days & hours, is 20 cents per working hour;

But that's not how it works: you need to have enough of it to accommodate for peek usage, but a good fraction of that isn't going to be running most of the time. You'd end up with a cost that's not too far from what Cloud providers are offering, which is a roughly 3 times that price. And you need to pay for the whole server hosting these GPUs (this less of a factor when you're using big GPUs like H100, but if you want to stick with consumer-grade GPUs, then the host is still a non-trivial fraction of the cost, and your supporting a server for a small bunch of concurrent users, which means your infra team is going to work with a massive pool of servers very quickly, with all the associated costs).

> It's less than a penny per hour per concurrent on a task like this.

It's still two orders of magnitude more expansive than any other SaaS business.

> Hopefully you're using LLM to deliver value that's worth more than a penny per hour of the people using it.

Maybe, but then again you're trying to build a service that has to add much more value than what the typical SaaS start-up provide.

Also regarding this:

> - Most apps are not non-stop token generation for concurrent users-- ChatGPT's duty cycle at this is very low.

ChatGPT is mostly being used by people who use it a few minutes per day, which is a nice place to be, but:

- this market is already taken by them, so your startup isn't gonna do the same.

- when you start integrating LLMs in tools you use routinely (an IDE being the typical example, then the token generation amount skyrockets).

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#58
post #56

Earlier quoted context omitted.

Sure it does: - Most apps are not non-stop token generation for concurrent users-- ChatGPT's duty cycle at this is very low. - A 4090 amortized over 4 years, working days & hours, is 20 cents per working hour; this is basically the same as the power going into it. It's less than a penny per hour per concurrent on a task like this. - Hopefully you're using LLM to deliver value that's worth more than a penny per hour o…

> A 4090 amortized over 4 years, working days & hours, is 20 cents per working hour; But that's not how it works: you need to have enough of it to accommodate for peek usage, but a good fraction of that isn't going to be running most of the time. You'd end up with a cost that's not too far from what Cloud providers are offering, which is a roughly 3 times that price. And you need to pay for the whole server hosting t…

> It's still two orders of magnitude more expansive than any other SaaS business.

Really? Some SaaS businesses have users doing things that generate tens of thousands of IOs per user request across spinning storage, or even far more.

> ChatGPT is mostly being used by people who use it a few minutes per day, which is a nice place to be, but:

I think you basically completely misunderstood everything I said. Here, the point was that someone using it is generating tokens a very large proportion of the time they're sitting in front of the service compared to most use cases-- but it's still only like 20% of the time.

We all have a pretty good understanding of the tradeoffs between owning hardware vs. elastic usage of a utility. We know that "peek usage" [sic] is higher than average (which is why there's a duty cycle correction in the calculation in the first place).

> - when you start integrating LLMs in tools you use routinely (an IDE being the typical example, then the token generation amount skyrockets).

It all depends. The system I just built and deployed does not need to be immediately responsive to end-users (users can tolerate a delay of a couple of minutes), with a few thousand tokens per user per week, and usage smeared pretty well over a several hour per day window. There's a lot of reasons (beyond economics) why moving it to a consumer GPU is attractive, but it won't be happy with a 1B parameter model.

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#59
post #47

This is silly. Look at the loss and benchmark curves for the Pythia suite of models - the smaller models certainly did saturate and in fact began worsening. 2T not saturating on a 7B is very different from 3T on a 1B.

That's the point of the experiment actually…

Re: TinyLlama project aims to pretrain a 1.1B Llama model on 3T tokens

#60
post #58

Earlier quoted context omitted.

> A 4090 amortized over 4 years, working days & hours, is 20 cents per working hour; But that's not how it works: you need to have enough of it to accommodate for peek usage, but a good fraction of that isn't going to be running most of the time. You'd end up with a cost that's not too far from what Cloud providers are offering, which is a roughly 3 times that price. And you need to pay for the whole server hosting t…

> It's still two orders of magnitude more expansive than any other SaaS business. Really? Some SaaS businesses have users doing things that generate tens of thousands of IOs per user request across spinning storage, or even far more. > ChatGPT is mostly being used by people who use it a few minutes per day, which is a nice place to be, but: I think you basically completely misunderstood everything I said. Here, the p…

> "peek usage" [sic]

You are very smart indeed…

Post reply on HN