Skip to content

[Doc] Style pass on the TPU docs added in #66991 - #67194

Merged
dstrodtman merged 1 commit into
masterfrom
djs-261020-tpu-docs-style
Oct 20, 2026
Merged

dstrodtman merged 1 commit into
masterfrom
djs-261020-tpu-docs-style

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

Description

A style and grammar pass on the prose that #66991 added to the TPU docs, against Ray's writing-style guide. #66991 merged before the docs team could review it, so these edits land as a follow-up instead of review suggestions. The edits are scoped to the lines #66991 added. Other text on these pages is unchanged.

The changes fall into these categories:

  • Long multi-clause sentences split into shorter ones.
  • Acronyms defined on first use, such as MPMD on the scheduling page. GKE is no longer defined twice on the KubeRay TPU page.
  • Lead-ins fixed so that each colon introduces the list, tab set, or code block that follows it, and a missing lead-in added before the TorchTPU training example.
  • Second person and present tense in place of a few passive or past-tense constructions.

No technical claim, value, flag, code block, label, or link target changes.

How meaning was checked

Every changed sentence was compared with its original for semantic drift. The check verified each claim against the Ray source and the doc examples at this commit. It found two edits that had changed a claim, and both are fixed in this PR:

  • On the scheduling page, splitting a sentence had separated "On TPU7x" from the RAY_TPU_RESOURCE_PER_CHIP=2 instruction. The instruction now says "on TPU7x" explicitly.
  • On the KubeRay TPU page, moving "For larger workloads" to the start of a sentence made multi-host scale-down sound conditional. The original scope is restored.

Two edits add or reword descriptions of example code. Both were checked against the code:

  • The new TorchTPU lead-in says the example "runs one training step with TorchTPU on 16 per-device workers". The example makes a single optimizer.step() call with num_workers=16 and resources_per_worker={"TPU": 1}.
  • On the Serve LLM TPU page, "This example serves google/gemma-4-31B-it" now names the vLLM-TPU example. That tab is the only one that uses that model.

Questions for maintainers

These are pre-existing issues the check surfaced. This PR doesn't change any of them:

  1. system-metrics.md: The sentence "Exported on Google Cloud TPU nodes when the GKE TPU device plugin metric server is active" appears only on the ray_tpu_tensorcore_utilization row. In reporter_agent.py, all five ray_tpu_* gauges come from the same device-plugin scrape, and none are emitted when TPU_DEVICE_PLUGIN_ADDR is unset. Should the condition move to a lead-in that covers all five rows? Separately, a source comment says some TPU types don't report runtime metrics. On those types, duty_cycle, memory_used, and memory_total read 0. Is that worth documenting?
  2. serve/llm/user-guides/tpu.md: The instruction "Set model_source to a local or mounted model path, or another path that all TPU hosts can read" sits between the descriptions of the two examples. The vLLM-TorchTPU example uses the Hugging Face ID Qwen/Qwen3-8B. Does the shared-path requirement apply only to vLLM-TPU, or to both engines?

Additional information

This PR was prepared with AI assistance (Claude Code) and reviewed by a human, who stands behind every change.

🤖 Generated with Claude Code

Apply Ray writing-style guide fixes to the prose that #66991 added
across the TPU pages: split long multi-clause sentences, define
acronyms on first use, fix list and code-block lead-ins, and use
second person and present tense. No technical claims, code blocks,
anchors, or link targets change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Douglas Strodtman <[email protected]>
@dstrodtman
dstrodtman requested review from a team as code owners October 20, 2026 16:16
@dstrodtman dstrodtman added the go add ONLY when ready to merge, run all tests label Oct 20, 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 makes various documentation improvements and clarifications across several files related to scheduling, configuring, and using Google Cloud TPUs with Ray, KubeRay, Ray Train, and Ray Serve. The changes primarily focus on improving readability, correcting phrasing, and clarifying TPU-specific configurations. One review comment was kept, which identifies a typo in a model name (google/gemma-4-31B-it) within the TPU serving guide and suggests correcting it to a valid model version such as google/gemma-2-27b-it.

Comment thread doc/source/serve/llm/user-guides/tpu.md Resolved
@dstrodtman
dstrodtman merged commit 093faf5 into master Oct 20, 2026
6 checks passed
@dstrodtman
dstrodtman deleted the djs-261020-tpu-docs-style branch October 20, 2026 16:31
dstrodtman added a commit that referenced this pull request Oct 21, 2026
## Why are these changes needed?

A rolling batch of small, independent docs fixes. Ray's `AGENTS.md`
permits mechanical cleanups when they're bundled rather than opened one
per PR, so they collect here. Each fix is its own commit, so a reviewer
can drop any one without disturbing the rest. This stays a draft while
it collects fixes.

### Fixes

- **Show the never-run TorchTPU example as a plain code block**
(`train/user-guides/using-accelerators.md`). #66991 added the TorchTPU
example as a `testcode` block with `:skipif: True`. Since #66974,
`writing-code-snippets.md` says not to do that, because the block never
runs but reads as tested code. It's now a plain `python` block, like the
JAX TPU example above it. It was the last `:skipif: True` block under
`doc/source/`.
- **Fix the broken PyTorch Neuron setup link**
(`serve/tutorials/aws-neuron-core-inference-stable-diffusion.md`). AWS
moved the Neuron setup page, so `frameworks/torch/torch-setup.html`
returns 404 and the scheduled docs link check flags it. The link now
points at `setup/torch-neuronx.html`, which the sibling
`aws-neuron-core-inference.md` tutorial already uses.
- **Link the GIL to the Python glossary** (`core/actors/async-api.md`).
The Python wiki dropped its `/moin/` paths, so
`wiki.python.org/moin/GlobalInterpreterLock` returns 404. The link now
goes to the glossary entry in the official Python docs,
`docs.python.org/3/glossary.html#term-global-interpreter-lock`.

## Related issue number

None.

## Duplicate check

Not a duplicate. `gh pr list --repo ray-project/ray --state open
--search "using-accelerators skipif"` returns nothing, and #67194, which
restyled the same TPU pages, left this block as it was.

## Testing

- Both new link targets return 200, and the glossary page contains the
`term-global-interpreter-lock` anchor. The two old URLs return 404.
- `python doc/test_prose_doctest_targets.py` passes: "74 listed pages;
every runnable page is accounted for." The page still has other runnable
blocks, so it stays in `doctest[train-gpu]`.
- `git grep -n skipif -- doc/source` now finds only the guide's
instruction not to use it.
- Extracting the page's examples is unaffected for runnable blocks:
pytest-sphinx drops a `:skipif: True` block before it builds an example,
so this block was never collected.
- `pre-commit` passes on the changed file.

AI assistance (Claude Code) was used to find and make these fixes. I
reviewed every changed line.

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

---------

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

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants