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

[LLM] Example for Serving Gemma #3207

Merged
merged 22 commits into from
Feb 23, 2024
Merged

[LLM] Example for Serving Gemma #3207

merged 22 commits into from
Feb 23, 2024

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Feb 21, 2024

TODO (future):

  • add finetuning as well

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • sky launch -c gemma llm/gemma/serve.yaml --cloud gcp --env HF_TOKEN="xxx"
    • curl the model with command in readme
      IP=$(sky status --ip gemma)
      curl -L http://$IP:8000/v1/completions   -H "Content-Type: application/json"   -d '{
            "model": "google/gemma-7b",
            "prompt": "My favourite condiment is",
            "max_tokens": 25
        }'
    • sky serve up -n gemma serve.yaml --env HF_TOKEN
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

@Michaelvll Michaelvll changed the title [LLM] Example for Gemma [LLM] Example for Serving Gemma Feb 21, 2024
@Michaelvll Michaelvll marked this pull request as ready for review February 22, 2024 07:02
Copy link
Collaborator

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

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

Awesome, @Michaelvll! Sending some comments first while it's running in background.

llm/gemma/README.md Outdated Show resolved Hide resolved
llm/gemma/README.md Outdated Show resolved Hide resolved
llm/gemma/serve.yaml Show resolved Hide resolved
llm/gemma/serve.yaml Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
llm/gemma/README.md Outdated Show resolved Hide resolved
llm/gemma/README.md Show resolved Hide resolved
MODEL_NAME: google/gemma-7b
HF_TOKEN: <your-huggingface-token> # TODO: Replace with huggingface token

resources:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Azure is taking a long time without success (quota failover), so I changed this to

resources:
  accelerators: {L4, A10g, A10, L40, A40, A100, A100-80GB}
  ports: 8000
  disk_tier: best
  any_of:
    - cloud: aws
    - cloud: gcp

and got


  File "/Users/zongheng/Dropbox/workspace/riselab/sky-computing/sky/serve/core.py", line 88, in up
    raise ValueError(f'Got multiple clouds: {requested_cloud} and '
ValueError: Got multiple clouds: GCP and AWS in different resources. Please specify single cloud instead.

for sky serve up. Is this expected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This seems to be an issue that needs to be fixed @cblmemo @MaoZiming ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch! Fixed in #3226. Thanks!

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>
Copy link
Collaborator

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

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

Works like a charm on by launch and serve up. LGTM.

llm/gemma/README.md Show resolved Hide resolved
llm/gemma/serve.yaml Show resolved Hide resolved
llm/gemma/README.md Outdated Show resolved Hide resolved
llm/gemma/README.md Outdated Show resolved Hide resolved

### Prerequsite

1. Apply for the access to the Gemma model
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
1. Apply for the access to the Gemma model
1. Apply for access to the Gemma model

@Michaelvll Michaelvll merged commit dd4b14f into master Feb 23, 2024
19 checks passed
@Michaelvll Michaelvll deleted the gemma branch February 23, 2024 01:43
shethhriday29 pushed a commit to shethhriday29/skypilot that referenced this pull request Feb 26, 2024
* Add serve for gemma and fix mixtral dependency

* Add hf token

* fix model len

* Add comment

* Serve your private gemma

* fix serve yaml

* readme

* Remove chat completion due to the wrong template

* add readme

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* address comments

* Update README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Change to it

* Add chat API

* use HF_TOKEN env

* typo

---------

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>
romilbhardwaj added a commit that referenced this pull request Feb 29, 2024
* initial commit

* newline

* comments

* run linter

* reminder for down

* tentatively done with example

* formatting

* yapf

* [Storage] Storage mounting tool permissions fix (#3215)

* fix permissions

* fix permissions

* [LLM] Example for Serving Gemma (#3207)

* Add serve for gemma and fix mixtral dependency

* Add hf token

* fix model len

* Add comment

* Serve your private gemma

* fix serve yaml

* readme

* Remove chat completion due to the wrong template

* add readme

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* address comments

* Update README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Change to it

* Add chat API

* use HF_TOKEN env

* typo

---------

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* [LLM] Add logo for Gemma (#3220)

* Minor fixes for release 0.5.0 (#3212)

* when removing cudo credential, sky check fails

* remove tips

* minor hint fix

* fix cluster version for k8s

* fix typo

* [Docker] Add retry for docker pull due to daemon not ready (#3218)

* Add retry for docker pull due to daemon not ready

* longer wait time

* longer wait time

* retry earlier

* add retry for retries as well

* longer wait time

* change wait time

* format

* Add comment

* Fix

* Fix indent for azure docker config

* Fix docker login config

* Fix comments

* More robust docker login config

* Add retry for docker check

* minor fix

* Add additional test for stop and start with docker

* Fix cancelled

* added comments

* quick fix

* finished pip issues

* fix

* fix storage error message, add example link to docs

---------

Co-authored-by: Sheth <shethhriday29@berkeley.edu>
Co-authored-by: Romil Bhardwaj <romil.bhardwaj@berkeley.edu>
Co-authored-by: Zhanghao Wu <zhanghao.wu@outlook.com>
Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>
Co-authored-by: Romil Bhardwaj <romil.bhardwaj@gmail.com>
romilbhardwaj added a commit that referenced this pull request Mar 21, 2024
* initial commit

* newline

* comments

* run linter

* reminder for down

* tentatively done with example

* formatting

* yapf

* [Storage] Storage mounting tool permissions fix (#3215)

* fix permissions

* fix permissions

* [LLM] Example for Serving Gemma (#3207)

* Add serve for gemma and fix mixtral dependency

* Add hf token

* fix model len

* Add comment

* Serve your private gemma

* fix serve yaml

* readme

* Remove chat completion due to the wrong template

* add readme

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* address comments

* Update README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Change to it

* Add chat API

* use HF_TOKEN env

* typo

---------

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* [LLM] Add logo for Gemma (#3220)

* Minor fixes for release 0.5.0 (#3212)

* when removing cudo credential, sky check fails

* remove tips

* minor hint fix

* fix cluster version for k8s

* fix typo

* [Docker] Add retry for docker pull due to daemon not ready (#3218)

* Add retry for docker pull due to daemon not ready

* longer wait time

* longer wait time

* retry earlier

* add retry for retries as well

* longer wait time

* change wait time

* format

* Add comment

* Fix

* Fix indent for azure docker config

* Fix docker login config

* Fix comments

* More robust docker login config

* Add retry for docker check

* minor fix

* Add additional test for stop and start with docker

* Fix cancelled

* added comments

* quick fix

* finished pip issues

* fix

* fix storage error message, add example link to docs

* logging for SSH when doing kubernetes provision

* romil edits

* took out todo commnt

* removed extra file

* renamed file

* restored right version of file

* simplify things

* newline

* more formatting

* formatting

* minor fixes

* set x and logging

* fixes

* docstr

---------

Co-authored-by: Sheth <shethhriday29@berkeley.edu>
Co-authored-by: Romil Bhardwaj <romil.bhardwaj@berkeley.edu>
Co-authored-by: Zhanghao Wu <zhanghao.wu@outlook.com>
Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>
Co-authored-by: Romil Bhardwaj <romil.bhardwaj@gmail.com>
romilbhardwaj added a commit that referenced this pull request Apr 15, 2024
* initial commit

* newline

* comments

* run linter

* reminder for down

* tentatively done with example

* formatting

* yapf

* [Storage] Storage mounting tool permissions fix (#3215)

* fix permissions

* fix permissions

* [LLM] Example for Serving Gemma (#3207)

* Add serve for gemma and fix mixtral dependency

* Add hf token

* fix model len

* Add comment

* Serve your private gemma

* fix serve yaml

* readme

* Remove chat completion due to the wrong template

* add readme

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* address comments

* Update README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* Change to it

* Add chat API

* use HF_TOKEN env

* typo

---------

Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>

* [LLM] Add logo for Gemma (#3220)

* Minor fixes for release 0.5.0 (#3212)

* when removing cudo credential, sky check fails

* remove tips

* minor hint fix

* fix cluster version for k8s

* fix typo

* [Docker] Add retry for docker pull due to daemon not ready (#3218)

* Add retry for docker pull due to daemon not ready

* longer wait time

* longer wait time

* retry earlier

* add retry for retries as well

* longer wait time

* change wait time

* format

* Add comment

* Fix

* Fix indent for azure docker config

* Fix docker login config

* Fix comments

* More robust docker login config

* Add retry for docker check

* minor fix

* Add additional test for stop and start with docker

* Fix cancelled

* added comments

* quick fix

* finished pip issues

* fix

* fix storage error message, add example link to docs

* changed error message if default nc installed on mac

* refactored check_port_forward_mode_dependencies function

* update comment

---------

Co-authored-by: Sheth <shethhriday29@berkeley.edu>
Co-authored-by: Romil Bhardwaj <romil.bhardwaj@berkeley.edu>
Co-authored-by: Zhanghao Wu <zhanghao.wu@outlook.com>
Co-authored-by: Zongheng Yang <zongheng.y@gmail.com>
Co-authored-by: Romil Bhardwaj <romil.bhardwaj@gmail.com>
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.

None yet

3 participants