Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add StableLM3B model #2372

Merged
merged 9 commits into from
Jan 17, 2024
Merged

Add StableLM3B model #2372

merged 9 commits into from
Jan 17, 2024

Conversation

ita9naiwa
Copy link
Contributor

@ita9naiwa ita9naiwa commented Jan 8, 2024

Resolves #1426

Add new model StableLM

Copy link
Collaborator

@WoosukKwon WoosukKwon left a comment

Choose a reason for hiding this comment

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

Hi @ita9naiwa, thanks for submitting the PR! It looks good overall, but needs some minor stylistic changes. Please check out my comments.

README.md Outdated Show resolved Hide resolved
docs/source/models/supported_models.rst Show resolved Hide resolved
vllm/model_executor/models/__init__.py Outdated Show resolved Hide resolved
KVCache = Tuple[torch.Tensor, torch.Tensor]


class StableLMEpochConfig(PretrainedConfig):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I can remove this class and pass arguments directly.

Copy link
Contributor Author

@ita9naiwa ita9naiwa Jan 9, 2024

Choose a reason for hiding this comment

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

models like llama in vllm (models/llama.py) there are config classes.

# (llama.py)
from transformers import LlamaConfig
# (yi.py)
from vllm.transformers_utils.configs.yi import YiConfig

StableLM does not have official transformers implementations so I guess it's better to have StableLMEpochConfig to carry configs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because passing all arguments for the model will make code really verbose

I'm just asking and I'll follow your opinion

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the discussion point here is that StableLMEpochConfig is never initialized. When vLLM is reading the config, it is read into PretrainedConfig, which you can also access the model specific attributes using config.vocab_size. This class currently only serve as documentation purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@simon-mo Thank you notifying that. I'll remove StableLMEpochConfig class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed StableLMEpochConfig class.

vllm/model_executor/models/stablelm.py Outdated Show resolved Hide resolved
@ita9naiwa
Copy link
Contributor Author

I checked using models/test_models.py the model is consistent with huggingface implementation

@simon-mo
Copy link
Collaborator

confirming examples

curl http://localhost:8000/v1/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "stabilityai/stablelm-3b-4e1t",
        "prompt": "San Francisco is a",
        "max_tokens": 7,
        "temperature": 0
    }'
{"id":"cmpl-a65e9c6d27d6479eb299c60dd4d3baa0","object":"text_completion","created":66942,"model":"stabilityai/stablelm-3b-4e1t","choices":[{"index":0,"text":" city that is known for its beautiful","logprobs":null,"finish_reason":"length"}],"usage":{"prompt_tokens":4,"total_tokens":11,"completion_tokens":7}}

@simon-mo simon-mo merged commit e1957c6 into vllm-project:main Jan 17, 2024
14 checks passed
@ita9naiwa ita9naiwa deleted the add-stablelm branch January 17, 2024 06:05
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Jan 18, 2024
hongxiayang pushed a commit to hongxiayang/vllm that referenced this pull request Feb 13, 2024
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.

StableLM-3B Support
3 participants