Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7e8fe51
[TRTLLM-17360][feat] Add Beam StairCase operators and baseline model
Mgluhovskoi Nov 2, 2026
1152d96
[TRTLLM-17360][fix] Integrate Beam routing and attention with current…
Mgluhovskoi Nov 3, 2026
5c27f5c
fix: tighten Beam baseline engine and checkpoint contracts
Mgluhovskoi Nov 4, 2026
878b140
fix: keep Beam component boundary separate from serving registration
Mgluhovskoi Nov 4, 2026
cabd549
Scope Beam operators to its model family and cover TP4 shapes
Mgluhovskoi Nov 6, 2026
2aa5c08
Merge main to refresh Beam component CI
Mgluhovskoi Nov 6, 2026
ab57605
Use explicit FP32 cuBLAS for Beam router projection
Mgluhovskoi Nov 6, 2026
81d6a8b
Move shared Beam attention and dispatch helpers to family scope
Mgluhovskoi Nov 6, 2026
f9f3c32
Annotate Beam component and checkpoint loader contracts
Mgluhovskoi Nov 7, 2026
9d1b59e
Include Beam operator packages in installed wheels
Mgluhovskoi Nov 9, 2026
f15f228
Merge main and retain Beam CPU coverage after test consolidation
Mgluhovskoi Nov 9, 2026
053598e
fix: report all rank-local Beam checkpoint load failures
Mgluhovskoi Nov 9, 2026
dc564b7
docs: clarify repeated Beam diagnostic validation costs
Mgluhovskoi Nov 9, 2026
d4149fd
docs: correct Beam position validation and cache reuse contracts
Mgluhovskoi Nov 9, 2026
dabed4b
fix: validate Beam direct-call devices positions and checkpoint metadata
Mgluhovskoi Nov 9, 2026
1e6fa4d
docs: distinguish TP1 Beam component numerics from TP4 serving
Mgluhovskoi Nov 9, 2026
1c4fcb5
refactor: remove unused Beam load ledgers and diagnostic work
Mgluhovskoi Nov 9, 2026
d4b2d24
refactor: name Beam component default layer indices explicitly
Mgluhovskoi Nov 9, 2026
7ea2cb2
refactor: share Beam router normalization epsilon
Mgluhovskoi Nov 9, 2026
540505a
refactor: reuse shared logit softcap without mutating Beam inputs
Mgluhovskoi Nov 9, 2026
438189b
perf: release uncaptured Beam dense MLP intermediates before down pro…
Mgluhovskoi Nov 9, 2026
a29dc5c
style: format Beam review fixes and clarify diagnostic documentation
Mgluhovskoi Nov 9, 2026
314d6f7
Fix Beam component test selection after upstream CI changes
Mgluhovskoi Nov 9, 2026
95c8aa9
Reject unsupported Beam RoPE configuration keys
Mgluhovskoi Nov 9, 2026
e8d966f
Share Beam component initialization loading and attention
Mgluhovskoi Nov 9, 2026
596a7c2
Centralize Beam configuration and hardware constants
Mgluhovskoi Nov 9, 2026
7a7d50d
Document Beam direct component and diagnostic interfaces
Mgluhovskoi Nov 9, 2026
1bbf050
Move Beam bring-up components to checkout-only tests
Mgluhovskoi Nov 9, 2026
2fb6384
Keep Beam weight-state inspection in checkpoint tests
Mgluhovskoi Nov 9, 2026
ddeef29
Clarify Beam helper packages and dispatch names
Mgluhovskoi Nov 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tensorrt_llm/_torch/_experimental/modeling_v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,3 +379,11 @@ That boundary may move as models need more customization. Model-specific
runtime policy can be split from shared services, but a change to common
runtime behavior still has to work for every other model. How to specialize
the runtime further is still being designed.

### Beam diagnostic validation

For Beam, `TRTLLM_MODELING_V2_VALIDATE=1` additionally enables repeated per-layer
metadata checks and per-step, all-rank routing agreement using device-to-host copies
and SHA-256 hashes. The serving adapter also enables checkpoint digests in this mode.
This is expensive diagnostic behavior, not only a first-forward contract check.
Use the same setting on every rank and leave it disabled for performance measurements.
10 changes: 7 additions & 3 deletions tensorrt_llm/_torch/_experimental/modeling_v2/_router_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,19 @@ def registered_routes() -> Dict[str, Callable[..., type]]:
#: construction, and a check that can only ever hold is a check whose failure
#: mode is its own bug taking down a working deployment.
#:
#: An environment variable rather than an LLM arg while modeling_v2 is
#: experimental; it has to reach the ranks, so a test passes it through
#: Beam additionally enables checkpoint digests, per-layer metadata rechecks and per-step
#: routing agreement (device-to-host copies, hashing and collectives). Keep it off for
#: performance measurements; all Beam ranks must use the same setting.
#:
#: An environment variable while modeling_v2 is experimental. It must reach all ranks,
#: so a test passes it through
#: ``env_overrides``. When this stops being experimental it belongs in the
#: LLM args, where a caller can set it per engine rather than per process.
MODELING_V2_VALIDATE_ENV = "TRTLLM_MODELING_V2_VALIDATE"


def step_contract_enabled() -> bool:
"""Whether targets should check their step contract on the first forward.
"""Whether contract diagnostics are enabled (Beam also checks every step).

Read once per model instance at construction rather than per forward: the
answer cannot change within a process, and the forward is the hot path.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ class FlashinferSiluAndMul(OpWrapper):

ARCHS = frozenset({Arch.SM_100, Arch.SM_103})

# deepseek-r1 is the only shipped caller. It reaches this op from two
# widths -- the routed/shared expert intermediate and the dense layers'
# -- at decode and prefill token counts.
# Exercise decode and prefill across narrow and wide intermediates.
# Model-specific shapes live in the test driver.
CELLS: tuple[Cell, ...] = (
Cell(
why="decode-shaped, 2 x moe_intermediate (2048)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class CublasMm(OpWrapper):

ARCHS = frozenset({Arch.SM_100, Arch.SM_103})

# Both targets use this for every dense projection. This entry's test
# carries their three argument shapes that differ in kind rather than in size: fused
# Targets use this for dense projections. This entry's test
# carries argument shapes that differ in kind rather than in size: fused
# bias (gpt-oss carries one on qkv, o and the router), no bias (deepseek's
# projections), and an out_dtype that is not the input's (deepseek's router
# asks for fp32 logits).
Expand All @@ -34,7 +34,7 @@ class CublasMm(OpWrapper):

note = """
`output_buffer_kind` and `group` are the op's multi-stream and collective
arguments. Both shipped targets leave them at their defaults, so neither is
arguments. The covered targets leave them at their defaults, so neither is
a cell axis and neither is certified here.
"""

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""Residual entries."""
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -->
<!-- SPDX-License-Identifier: Apache-2.0 -->

# Beam StairCase components

This directory implements Beam components using the experimental ModelingV2/StairCase
architecture: family-scoped operators and a 52-layer NVFP4-expert component for attention TP4 and MoE TP4/EP1 on four GB300 GPUs.

The full component implements sliding-window and full attention with a BF16 KV cache.
Its loader streams caller-provided weights into rank-local storage; no checkpoint is
included. Router projection and selection use FP32, and packed NVFP4 experts use the
native GEMM path.

These are directly constructed components, not a registered `LLM()` or `trtllm-serve`
target. Engine routing, the engine adapter, checkpoint-loader registration and a named
whole-model accuracy gate belong to the serving integration. Operator certification and
CPU component-contract tests accompany these components; broader component tests are
reviewed separately. Speculative decoding, FP8 KV cache, disaggregated serving, CUDA
graphs and overlap scheduling are outside this component baseline.

Beam-only operators live under `ops/`, with tests in the matching Beam test tree.
Component-specific cases for shared catalog operators reuse the catalog test drivers,
including TP1 shapes and the per-rank TP4 projection, attention and expert shapes.

## Checkout-only bring-up helpers

The six TP1 bring-up components and their generation controller live with their tests in
`tests/unittest/_torch/modeling_v2/models/beam/_components/`. They are not installed in
the TensorRT-LLM wheel. The runtime does not expose intermediate-tensor capture hooks.
Normal runtime validation and rank-consistency diagnostics remain available.

The TP4 checkpoint layout, expert provider and full-model execution remain in this
library. Public serving integration uses `LLM()` and `trtllm-serve`.

Shared BF16 TP4 layout, loading and component base modules live in `_tp4/`; the
`full_model_nvfp4__sm_103__tp4/` package adds NVFP4 expert storage and execution.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""BeamForCausalLM components."""
Loading
Loading