Skip to content

docs: Update LLM getting-started guide to PyTorch backend - #8896

Open
faradawn wants to merge 7 commits into
triton-inference-server:mainfrom
faradawn:docs-llm-getting-started-pytorch
Open

docs: Update LLM getting-started guide to PyTorch backend#8896
faradawn wants to merge 7 commits into
triton-inference-server:mainfrom
faradawn:docs-llm-getting-started-pytorch

Conversation

@faradawn

@faradawn faradawn commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Deprecating the engine build in favor of pytorch / llmapi backend.

Triton Latest release: 26.07. TRTLLM container 1.2.1. Thus using DSR1 as example. DSV4 and GLM-5.2 are not supported in this TRTLLM yet.

Tested on B200x8.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR replaces the deprecated Phi-3 TRT-LLM engine-build guide (~1,700 lines) with a concise (~185-line) getting-started guide for the modern LLM API / PyTorch backend, using nvidia/DeepSeek-R1-0528-FP4-V2 as the example model.

  • Workflow modernized: removes the convert_checkpoint.py + trtllm-build + inflight_batcher_llm ensemble path and replaces it with a single model.yaml-driven LLM API workflow; the git clone is now pinned to a matching TRT-LLM version tag.
  • Hardware scope narrowed: the chosen example model (FP4-V2) requires Blackwell (B200+) GPUs; this is only mentioned in a resource-usage note in step 4, after a user would already have configured and potentially started downloading the 800 GB+ model.
  • max_batch_size: 0 note is misleading: the benchmark section states this setting means "no batching", but for the LLM API backend it instead defers batching to the TRT-LLM continuous-batching scheduler.

Confidence Score: 4/5

  • The rewrite is a clear improvement overall, but the primary example model requires Blackwell (B200+) GPUs due to FP4 quantization — a requirement that is not surfaced until well into the guide, after a reader may have already started configuring or downloading the model.
  • The guide correctly pins the TRT-LLM git tag to the container's library version and simplifies the workflow significantly. The one substantive issue is that the hardware prerequisite (Blackwell GPU required for FP4 inference) is buried in a resource-usage note rather than stated upfront, meaning readers on A100 or H100 hardware will not know they're on an unsupported path until the server fails to start.
  • docs/getting_started/llm.md — the hardware prerequisite section and the benchmark batching note both need attention before this guide will be accurate for all readers.

Important Files Changed

Filename Overview
docs/getting_started/llm.md Complete rewrite (~1,700 → ~185 lines) replacing the deprecated Phi-3 TRT-LLM engine-build workflow with the modern LLM API / PyTorch backend using DeepSeek-R1-0528-FP4-V2. The new guide is much cleaner and uses a pinned git tag. One real usability issue: the FP4 model's Blackwell-only hardware requirement is not surfaced prominently enough for readers who may download the model before discovering the incompatibility.

Sequence Diagram

sequenceDiagram
    participant User
    participant Docker as Triton Container
    participant HF as Hugging Face Hub
    participant TRTLLM as TRT-LLM Repo v1.2.1
    participant Triton as Triton Server

    User->>Docker: docker run step 1
    User->>Docker: check tensorrt_llm version
    Docker-->>User: e.g. 1.2.1
    User->>TRTLLM: git clone depth 1 branch v1.2.1 step 2
    User->>TRTLLM: Edit model.yaml step 3
    User->>Docker: python3 launch_triton_server.py step 4
    Docker->>HF: Pull model weights
    HF-->>Docker: Model weights
    Docker->>Triton: Start with LLM API backend
    Triton-->>User: HTTP 8000 gRPC 8001 Metrics 8002
    User->>Triton: POST generate
    Triton-->>User: Completion response
    User->>Triton: POST generate_stream with decoupled True
    Triton-->>User: Streamed tokens
Loading

Reviews (9): Last reviewed commit: "docs: Fix two broken commands found by v..." | Re-trigger Greptile

Comment thread docs/getting_started/llm.md Outdated
Comment thread docs/getting_started/llm.md Outdated
Comment thread docs/getting_started/llm.md Outdated
Comment thread docs/getting_started/llm.md Outdated
@faradawn
faradawn force-pushed the docs-llm-getting-started-pytorch branch 2 times, most recently from f129ce7 to 5c46b3c Compare July 22, 2026 21:02
@faradawn
faradawn force-pushed the docs-llm-getting-started-pytorch branch from 5c46b3c to ae171ae Compare August 3, 2026 03:36
…4-Flash)

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
@faradawn
faradawn force-pushed the docs-llm-getting-started-pytorch branch from ae171ae to b2c1cb2 Compare August 3, 2026 03:39
Validated the guide end-to-end on an 8x B200 node. Testing found several
steps that could not work as written; this commit fixes them.

- Replace DeepSeek-V4-Flash with models that run on released containers.
  V4 needs TensorRT-LLM 1.3 (not GA); 26.03/26.07 ship 1.2.x, which do not
  register DeepseekV4ForCausalLM. Feature nvidia/DeepSeek-R1-0528-FP4-V2
  (NVFP4 + FP8 KV, 385 GB) for 8x B200, Qwen3-8B for a single GPU.
- Document the openai/tensorrt_llm version conflict in 26.03-26.07 that
  makes the backend fail to load (ImportError: PartReasoningText) and the
  `pip install -U openai` workaround.
- Pin the TensorRT-LLM clone to the tag matching the container instead of
  cloning the default branch.
- Replace the GenAI-Perf section. `--service-kind` no longer exists, and
  `--backend tensorrtllm` targets the legacy inflight_batcher_llm input
  schema, so it cannot drive the LLM API backend. Use
  benchmark_core_model.py --test-llmapi instead.
- Explain that streaming needs model_transaction_policy in config.pbtxt;
  triton_config.decoupled in model.yaml is ignored because the launch
  script passes --disable-auto-complete-config.
- Note that `generate` is a raw completion endpoint and does not apply the
  chat template, with a worked DeepSeek-R1 example.
- Update the container tag to 26.07 and refresh the sample server logs.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
The guide featured Qwen3-8B and relegated DeepSeek-R1 NVFP4 to a later
section. Lead with the NVFP4 model instead, since that is the configuration
validated on 8x B200, and keep Qwen3-8B as the single-GPU alternative.

- Intro and the step 3 model.yaml now use nvidia/DeepSeek-R1-0528-FP4-V2
  with tensor_parallel_size / moe_expert_parallel_size of 8.
- Move the NVFP4 note (format comes from hf_quant_config.json, Blackwell
  only) next to the config it applies to.
- Replace the duplicated multi-GPU example with a sizing table carrying the
  measured numbers: ~6 min to ready, ~145 GiB per GPU, 81.83 GiB KV cache.
- Label the benchmark sample output as Qwen3-8B on one GPU, and take the
  tokenizer argument from model.yaml rather than hardcoding it.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
Cut the guide down to the DeepSeek-R1 NVFP4 path only.

- Shorten the intro to name the example model.
- Reduce the openai version conflict to a one-line hint.
- Drop the tag-pinning rationale, the NVFP4 format explanation, the
  launch_triton_server.py background-process note, and the chat template
  cross-reference.
- Remove the Qwen3-8B single-GPU config, the DeepSeek-V4 and GLM notes, and
  the separate multi-GPU section; fold its measured sizing into step 4.
- Show the working chat-templated request directly instead of a plain prompt
  plus an explanation of why it misbehaves.
- Replace the GenAI-Perf incompatibility note with just the command that works.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
The guide pinned the container tag and the TensorRT-LLM clone tag
separately, so updating one without the other silently mismatched the
model repository against the installed library.

Read the version from the running container and clone that tag, leaving
RELEASE as the only version to edit.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
Condense the streaming section to the config.pbtxt change itself and trim
the batching note to the fact, without the projection about future
throughput behaviour.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
A subagent ran the guide verbatim on an 8x B200 node (only substituting
srun/pyxis for docker run). Two commands failed as written.

- The derived clone tag did not work. `import tensorrt_llm` prints its
  banner to stdout, so the command substitution captured two lines and git
  failed with "Remote branch v[TensorRT-LLM] TensorRT LLM version: 1.2.1
  1.2.1 not found in upstream origin". Go back to printing the version and
  passing the tag explicitly, which is verified to work.
- Streaming did not work. Editing only config.pbtxt leaves model.py's own
  guard reading triton_config.decoupled from model.yaml, so the request
  fails with "Streaming is only supported in decoupled mode." Setting
  decoupled: True in model.yaml is what actually enables it.

Also correct three measurements against the verification run: load takes a
few minutes rather than about six, memory is ~143 GiB of each GPU's 179 GiB,
and the benchmark reports 38 prompts at 1694.09 ms.

Signed-off-by: Faradawn Yang <73060648+faradawn@users.noreply.github.com>
@whoisj

whoisj commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

When do these changes take effect? If they already apply, then I can approve now. If Triton needs to update to a newer version of TRTLLM, then we should wait until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants