Repository navigation
Tech Guide: Ray Serve: Composable Model Serving from Laptop to Kubernetes - #109
Open
bits-bytes-nn wants to merge 3 commits into
Open
bits-bytes-nn wants to merge 3 commits into
bits-bytes-nn wants to merge 3 commits into
Conversation
…able Model-Serving Apps'
…om Laptop to Kubernetes'
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds an AI-generated technical guide: Ray Serve: Composable Model Serving from Laptop to Kubernetes
This pull request was automatically generated by the Scholar-Lens system.
Review checklist
choose_replicas,on_request_routedoron_replica_actor_died, and it never says whether the two callbacks are async. In the skeleton I used generic*args, **kwargsparameters and made all three methods async, as the problem asked. I marked the bbind()는 빈 호출로 끝납니다 [[E3]].'model_client.py라는 이름으로 나온 적이 없습니다. 게다가params={'text': ...}로 보내고response.json()으로 읽었습니다. 새 클라이언트는json=english_text로 보내고response.text로 읽으므로, 입력 문장만 바뀐 게 아닙니다. 본문 형식(JSON | flow: 앞에서 정의한Translator는 두 가지입니다.__call__(http_request)를 가진 버전과@serve.ingress(app)·translate(text)를 가진 FastAPI 버전입니다.Summarizer는translate메서드를 호출하므로 어느 클래스를 쓰는지 밝히세요. 이 조합에서@serve.i | flow: 체이닝 예제는 실행 중인 예제 대신 Adder/Multiplier로 처음부터 다시 시작합니다. 이 문장도 실행 예제에는 체이닝이 적용되지 않는다고 인정합니다. 요약 단계를 배포로 분리하고 그 응답을self.translator.translate.remote(...)에 바로 넘기는 짧은 코드를 실행 예제 위에 보여 주세요. 아니면 숫자 예제가 | flow:SpanishResponder,FrenchResponder,hello.py,language_classifier는 코드로 보여 준 적이 없는데 갑자기 등장합니다. 이 예제를 빼고 Summarizer와 Translator 데코레이터에 서로 다른num_replicas·num_gpus를 주는 짧은 코드로 대신 보여 주세요. | depth: 독자가 본 적 없는 예제를 실행하는 방법과 출력에 지면을 쓰고 있습니다. 이 섹션의 요점인 배포별 독립 확장과는 관계가 없으니 삭제하세요. — in: 이 예제도 같은 방식으로 띄웁니다.hello.py가 있는 디렉터리에서serve run hello:language_classifier를 실행하고 [[E66]],{"language":graceful_shutdown_timeout_s의 기본값은 넣지 않았습니다. 제공된 근거 어디에도 그 값이 없습니다(E105의 20은 예시 값일 뿐 기본값이 아닙니다).get_app_handle예시의 문제 요청은 이미지 분류 애플리케이션이 텍스트 애플리케이션에 '번역'을 맡긴다고 쓰라는 것이었습니다. 그런데text_ml:app의 인그레스는Summarizer이고, 여기에는translate메서드가 없습니다. 그래서 정의된summarize를 호출하도록 바꾸고 플래그 이름도should_summarize로 바꿨습니다. 즉 이 분기는 번역이 아니라 요약을 맡깁니다. 근거 코드(E87)의 메서드 이름과도 다릅니다.max_queued_requests를 넘긴 요청은 핸들에서BackPressureError, HTTP에서 기본 503으로 돌아오고 , 모델 코드의 예외는 500과 트레이스백으로 돌아오며 레플리카는 계속 요청을 처리합니다 . | [500] already stated in '제어 평면만 맡는 컨트롤러와 프록시·레플리카로 이어지는 데이터 경로': refer back without repeating:max_queued_requests를 넘긴 요청은 핸들에서BackPressureError, HTTP에서 기본 503으로 돌아오고 , 모델 코드의 예외는 500과 트레이스백으로 돌아오며 레플리카는 계속 요청을 처리합니다 .bash\npip install "ray[serve,llm]"\n\n\n'max_ongoing_requests는 응): 데코레이터 발췌의class Translator:본문에는 주석 한 줄만 있습니다. 이대로는 IndentationError가 납니다. 이어지는.options()예시와 configure_serve.py도 이 클래스를 전제로 합니다. Fix: 클래스 본문에 앞의__init__ | '기본값은 앞서 데이터 경로에서 본 그대로'라고 하지만, 데이터 경로 섹션은 5를 가상의 값으로 들었을 뿐 기본값을 밝힌 적이 없습니다. 그런데 뒤 문단은 '기본값 5'를 사실처럼 씁니다. Fix: 'max_ongoing_requests는 응답을 받지 않은 채 레플리카 하나에 보낼 | '번역처럼 요청 하나가 레플리카를 오래 붙잡지 않는 모델'은 앞의 'Translator처럼 모델 추론이 무거운 핸들러'와 모순됩니다. 게다가 Translator의async call은 동기translate`를 호출하므로 이벤트 루프를 막습니다. 따라서 max_ongoingTranslator의 다음 메서드가 정하는 prefix로 바뀝니다.\n\npython\n# ' | would remove the only code block: 'python\n# excerpt: 다른 애플리케이션의 핸들을 얻어 번역을 위임하는 분기\nif req.ge'serve build는 이 import path를 받아 코드에 | a 41-line code block; show the 40 or fewer lines the text explains and say what the rest does | 코드에서 만들어 클러스터 목표 상태로 적용하는 Serve 설정 파일: a python block does not parse (invalid syntax): # excerpt: text_ml.py의 Translator): serve_config.yaml은 Translator에 `user_config: language: french`를 주는데, user_config를 받는 `reconfigure` 메서드는 다음 하위 섹션에서야 나옵니다. 그래서 앞서 정의한 Translator로 `serve deploy`하 | reconfigure는 `self.prefix`를 정하지만 translate는 여전히 `f"translate English to French: {text}"`로 고정되어 있습니다. 그래서 `language`를 german으로 바꿔 재적용해도 번역 언어는 바뀌지 않습니다. 실행 예제가 본 | `serve build image_classifier:app text_ml:app`의 image_classifier.py는 글 어디에도 나오지 않습니다. get_app_handle 발췌는 주석으로는 '번역을 위임'한다면서 실제로는 `summarize`를 호출합니다. 이 호출은 영어 요약fr | 코드에서 만들어 클러스터 목표 상태로 적용하는 Serve 설정 파일: a python block uses names no earlier block or import defines: req, result; define or import them where a reader pasting the blocks in order has them