Skip to content

[doc][llm] Add docs for serving LLMs with TPUs - #65026

Merged
elliot-barn merged 5 commits into
masterfrom
ray-llm-tpu-doc
Aug 20, 2026
Merged

elliot-barn merged 5 commits into
masterfrom
ray-llm-tpu-doc

Conversation

@jeffreywang88

Copy link
Copy Markdown
Contributor

Description

Screenshot 2026-07-27 at 12 00 39 AM Screenshot 2026-07-27 at 12 04 56 AM Screenshot 2026-07-27 at 12 05 07 AM Screenshot 2026-07-27 at 12 05 17 AM Screenshot 2026-07-27 at 12 05 26 AM

Related issues

Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234".

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

@jeffreywang88
jeffreywang88 requested review from a team as code owners July 27, 2026 07:23
@jeffreywang88 jeffreywang88 added the go add ONLY when ready to merge, run all tests label Jul 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds documentation and a Python example for topology-aware TPU serving in Ray Serve LLM, introducing support for TPU-V6E and multi-host TPU slices. The review feedback points out a runtime configuration error where max_num_batched_tokens is smaller than max_model_len, and recommends replacing the non-existent google/gemma-4-31B-it model with a valid identifier like google/gemma-2-27b-it across both the code and documentation.

Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
@ray-gardener ray-gardener Bot added serve Ray Serve Related Issue docs An issue or change related to documentation labels Jul 27, 2026
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Aug 11, 2026

@ryanaoleary ryanaoleary left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agree with the outstanding comments, once those are resolved LGTM

@dstrodtman dstrodtman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docs style review (style and grammar only)

Review from Douglas Strodtman on the Anyscale documentation team. I ran this with Claude Code's help, and I've read and stand behind every comment below.

Scope: style, grammar, and Ray docs conventions, checked against Ray's own writing style guide. I don't own this area. Every technical claim on this page, and final approval, belongs to @eicherseiji and @ryanaoleary. Posting as a comment, not a change request.

Nice page overall. The topology-to-bundles explanation carries the concept well, and the prose is already close to the guide: contractions where they belong, active voice, sentence-case headings, no benefits list, tagged code fences, {doc} and {class} cross-references instead of hardcoded docs.ray.io/en/latest/ URLs. I verified that the SlicePlacementGroup class reference resolves; ray.util.tpu.SlicePlacementGroup is autodoc'd in doc/source/ray-core/api/utility.rst. What's left is small.

The one finding worth calling out above nit level is the missing myst.html_meta.description front matter. All 15 existing pages in serve/llm/user-guides/ have one, so this page would be the only page in the directory without a search-result description.

On the open threads

I read the existing threads before writing anything, and I'm deliberately not re-raising any of them:

  • @eicherseiji's suggestions on L63 and L67 are unapplied (the single commit predates the review), and I'd take both as written. My comments avoid those lines.
  • The questions about prerequisites, defining "TPU slice", moving the topology note lower, the per-chip bundle use case, whether the SlicePlacementGroup section is an implementation detail, and the tpu-inference executor link are all yours to settle. They're content decisions, not style.
  • On the model ID: @ryanaoleary already confirmed the Gemini bot was wrong, so I left it alone everywhere.
  • I did not touch max_num_batched_tokens. That's still open above and it's a correctness question, not mine.

Technical questions, not style findings

Two things I noticed while verifying my own suggestions. Both are questions for you, and neither has a suggestion attached.

  1. Which Ray package a reader ends up with. The Dockerfile comment on L85 says to use "a released Ray version or wheel URL that contains TPU topology support," and the default is ARG RAY_PACKAGE="ray". @ryanaoleary's successful run used an explicit Ray nightly wheel instead. If topology support isn't in a released Ray yet, a reader who copies this Dockerfile as-is gets a stable ray that may lack the feature. Worth making that pairing explicit either way.
  2. blocking=True versus blocking=False. The example uses serve.run(app, blocking=True); the verified run used blocking=False. Probably intentional for a standalone script, just confirming.

Sign-off

Happy to give a docs-side approval once the content questions above settle. Nothing in my list should hold the PR up on its own.

Also, one out-of-diff nit with no comment attached because it's outside a hunk: index.md L3 reads "If you are new" where the guide asks for contractions ("If you're new"). Pre-existing, so entirely optional to fold in here.

Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
@github-actions github-actions Bot added unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it. and removed stale The issue is stale. It will be closed within 7 days unless there are further conversation labels Aug 12, 2026
jeffreywang88 and others added 4 commits August 20, 2026 10:14
Co-authored-by: Seiji Eicher <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
Signed-off-by: Jeffrey Wang <[email protected]>
@jeffreywang88

Copy link
Copy Markdown
Contributor Author

Rebuilt the docs and verified they render cleanly:
Screenshot 2026-08-20 at 12 06 49 PM
Screenshot 2026-08-20 at 12 07 15 PM

@eicherseiji eicherseiji left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor typo

Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
@elliot-barn
elliot-barn merged commit 35831c4 into master Aug 20, 2026
5 of 6 checks passed
@elliot-barn
elliot-barn deleted the ray-llm-tpu-doc branch August 20, 2026 21:48
dstrodtman added a commit that referenced this pull request Sep 30, 2026
## Why

Small, self-contained docs fixes found during other docs work, collected
into one PR. Ray's `AGENTS.md` asks for trivial edits to be bundled
instead of opened as one-off PRs, so this batch keeps collecting fixes
and goes up for review about once a week. Each fix is its own commit, so
a reviewer can drop any one without touching the rest.

## What

- **Trailing space inside link text** (`vsphere.md`,
`data/contributing/contributing-guide.md`). Two links' text ended in a
space, such as `[… (WCP) enabled ](…)`, so the rendered underline ran
past the last word. Removed the space. Found while fixing the same
pattern in the Ray Data MyST conversion (#66375).
- **Duplicated paragraph** (`serve/llm/user-guides/configuration.md`).
The "Set `accelerator_type`" paragraph appeared twice back to back, with
the same content in a different sentence order, apparently a
suggestion-merge artifact from #65026 that also dropped the blank line
after the heading. Kept the first copy and restored the blank line.
- **Escaped sub-bullets** (`ray-core/internals/autoscaler-v2.md`,
`ray-core/internals/ray-event-exporter.md`). The rST originals nested
these sub-bullets without the blank line rST requires, so they rendered
as run-on text, and the MyST conversion (#66430) carried them over as
`\-`. Dropped the escapes so they render as the nested lists the author
intended. Both of these fixes turned up during the soft-wrap pass in
#66607.

## Not a duplicate

There's no open PR touching any of these files, and a GitHub search for
`vsphere.md`, `contributing-guide.md`, "vSphere WCP", `configuration.md`
with `accelerator_type`, `autoscaler-v2`, and `ray-event-exporter` finds
nothing related.

## Testing

- Rendered both pages with `markdown-it-py` (CommonMark). Each link's
text now ends right at `</a>`, with no trailing whitespace.
- A regex scan of every `doc/source/**/*.md` outside code fences for
whitespace before `](` finds these two as the only cases on `master`.
- Rendered `autoscaler-v2.md` and `ray-event-exporter.md` with
`markdown-it-py` and confirmed each sub-bullet group is now a nested
`<ul>` under its parent item.
- Confirmed `configuration.md` has one copy of the paragraph, preceded
by a blank line after the heading.
- Pre-commit hooks passed on every commit.

AI assistance (Claude Code) was used to find and make these fixes. I
reviewed each change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
## Description
<img width="801" height="764" alt="Screenshot 2026-07-27 at 12 00 39 AM"
src="https://github.com/user-attachments/assets/13e39779-f934-4ace-a26e-f0c49d03b514"
/>
<img width="1508" height="980" alt="Screenshot 2026-07-27 at 12 04
56 AM"
src="https://github.com/user-attachments/assets/b6833654-7928-4785-a04a-4d02626dc912"
/>
<img width="1481" height="996" alt="Screenshot 2026-07-27 at 12 05
07 AM"
src="https://github.com/user-attachments/assets/c1040a47-69b5-422b-a5d3-c1c7e7c316b5"
/>
<img width="1499" height="1203" alt="Screenshot 2026-07-27 at 12 05
17 AM"
src="https://github.com/user-attachments/assets/d15de8b2-e9c8-4310-8e3d-14b58fa8dd81"
/>
<img width="1509" height="673" alt="Screenshot 2026-07-27 at 12 05
26 AM"
src="https://github.com/user-attachments/assets/8cbbac0d-196b-4cd5-9761-7796231b661e"
/>


## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

---------

Signed-off-by: Jeffrey Wang <[email protected]>
Co-authored-by: Seiji Eicher <[email protected]>
Co-authored-by: Douglas Strodtman <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
## Why

Small, self-contained docs fixes found during other docs work, collected
into one PR. Ray's `AGENTS.md` asks for trivial edits to be bundled
instead of opened as one-off PRs, so this batch keeps collecting fixes
and goes up for review about once a week. Each fix is its own commit, so
a reviewer can drop any one without touching the rest.

## What

- **Trailing space inside link text** (`vsphere.md`,
`data/contributing/contributing-guide.md`). Two links' text ended in a
space, such as `[… (WCP) enabled ](…)`, so the rendered underline ran
past the last word. Removed the space. Found while fixing the same
pattern in the Ray Data MyST conversion (ray-project#66375).
- **Duplicated paragraph** (`serve/llm/user-guides/configuration.md`).
The "Set `accelerator_type`" paragraph appeared twice back to back, with
the same content in a different sentence order, apparently a
suggestion-merge artifact from ray-project#65026 that also dropped the blank line
after the heading. Kept the first copy and restored the blank line.
- **Escaped sub-bullets** (`ray-core/internals/autoscaler-v2.md`,
`ray-core/internals/ray-event-exporter.md`). The rST originals nested
these sub-bullets without the blank line rST requires, so they rendered
as run-on text, and the MyST conversion (ray-project#66430) carried them over as
`\-`. Dropped the escapes so they render as the nested lists the author
intended. Both of these fixes turned up during the soft-wrap pass in
ray-project#66607.

## Not a duplicate

There's no open PR touching any of these files, and a GitHub search for
`vsphere.md`, `contributing-guide.md`, "vSphere WCP", `configuration.md`
with `accelerator_type`, `autoscaler-v2`, and `ray-event-exporter` finds
nothing related.

## Testing

- Rendered both pages with `markdown-it-py` (CommonMark). Each link's
text now ends right at `</a>`, with no trailing whitespace.
- A regex scan of every `doc/source/**/*.md` outside code fences for
whitespace before `](` finds these two as the only cases on `master`.
- Rendered `autoscaler-v2.md` and `ray-event-exporter.md` with
`markdown-it-py` and confirmed each sub-bullet group is now a nested
`<ul>` under its parent item.
- Confirmed `configuration.md` has one copy of the paragraph, preceded
by a blank line after the heading.
- Pre-commit hooks passed on every commit.

AI assistance (Claude Code) was used to find and make these fixes. I
reviewed each change.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Douglas Strodtman <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs An issue or change related to documentation go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue unstale A PR that has been marked unstale. It will not get marked stale again if this label is on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray fails to serialize self-reference objects

5 participants