Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

RWKV support #243

Closed
wants to merge 16 commits into from
Closed

RWKV support #243

wants to merge 16 commits into from

Conversation

RedBoxing
Copy link
Contributor

Based on @danforbes's work, I added the evaluation code and replaced the tokenizer with huggingface's tokenizer.

Close #75 and #35

Copy link
Contributor

@danforbes danforbes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to be awesome to finally get this across the line 🥳

crates/llm/examples/inference.rs Outdated Show resolved Hide resolved
| ContainerType::Ggmf(1)
| ContainerType::Ggjt(1 | 2)
| ContainerType::Ggmf(1 | 100)
| ContainerType::Ggjt(1 | 2 | 100)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use an enum here that maps these values to something more meaningful.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a change I made, but I realise that with the growing number of versions this is only more confusing. I'll reintroduce constants soon

crates/llm-base/src/vocabulary.rs Outdated Show resolved Hide resolved
@philpax
Copy link
Collaborator

philpax commented May 20, 2023

Updated to latest main


graph: RefCell<ggml::ComputationGraph>,
token_index: ggml::Tensor,
state: RefCell<ggml::Tensor>,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be shared across inference sessions?

self.state
.borrow_mut()
.write_data(std::slice::from_raw_parts(
session.state.data() as *mut u8,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never mind i see this now.

@RedBoxing RedBoxing changed the title RWKV support and HuggingFace Tokenizer RWKV support May 23, 2023
@philpax
Copy link
Collaborator

philpax commented May 25, 2023

After #271 is in (in whatever form), I'll bring this back up to date

@philpax
Copy link
Collaborator

philpax commented Jun 18, 2023

This has diverged rather significantly from mainline, but not hopefully not unworkably so. Maybe it's simpler to cherry-pick the actual model definition in?

Either way, @RedBoxing, what was the state of this when you last tried it? iirc the evaluation still had some issues; I'm thinking we should bring this up to date and merge it in, but as an optional disabled-by-default implementation like BLOOM was. That should help us keep it up to date while we figure out what's wrong.

@philpax philpax added the topic:model-support Support for new models label Jun 22, 2023
@philpax
Copy link
Collaborator

philpax commented Jun 29, 2023

OK, I had a go at updating this, but the dual-context design is hard to adapt to our current session abstraction.

Given that rwkv.cpp has moved on beyond this point and detecting RWKV models will get easier with GGUF, I'm going to close this for now and we can use it as a reference when we reimplement it again. I think we should wait some time, though.

@philpax philpax closed this Jun 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic:model-support Support for new models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for RWKV
4 participants