Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions docs/source/models/supported-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Note: Support for other models may vary. Features marked "N/A" are not applicabl
| `Qwen4ExpForCausalLM` | Yes | Yes | Yes | No | Yes | Yes | No | No | No | Yes | Untested | No | N/A | Yes | Untested |
| `Llama4ForConditionalGeneration` | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | No | Yes | Yes | Untested | N/A | Yes | Yes |
| `GptOssForCausalLM` | Yes | Yes | Yes | Yes | Yes | No | Yes | No | Yes | Yes | Yes | Yes | N/A | Yes | Yes |
| `KimiK3ForConditionalGeneration` [^15] [^17] | Yes | Yes | Yes | Yes | Yes | No | No | No | No | Yes | No | Yes | N/A | Yes | Yes |
Comment thread
cascade812 marked this conversation as resolved.
| `Glm4MoeLiteForCausalLM` [^5] | Yes | Yes | Untested | Untested | Yes | No | No | No | No | Yes | Untested | Untested | N/A | Untested | Untested |
| `NemotronHForCausalLM` | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | Yes | Yes | Yes | N/A | Untested | Untested |
| `Gemma4ForConditionalGeneration` | Untested | Yes | Untested | No | Yes | Yes | No | No | No | Yes | Untested | No | Yes | Untested | Untested |
Expand All @@ -107,6 +108,7 @@ Note: Support for other models may vary. Features marked "N/A" are not applicabl
[^14]: Requires `transformers>=5.7.0`: MiniCPM-V 4.6 was upstreamed into transformers as a native model type (`minicpmv4_6`) and the checkpoint ships no remote code (`auto_map`) to fall back on. The Qwen3.5-hybrid text tower runs in BF16. Image, video, and text inputs are supported in this release (video reuses the same NaViT-packed vision path as image via `MiniCPMV4_6InputProcessor`).
[^15]: Kimi K3 is only supported on NVIDIA Blackwell GPUs (`SM100` family); see the [Kimi K3 deployment guide](../deployment-guide/deployment-guide-for-kimi-k3-on-trtllm.md). Which recipes fit is set by the attention layout rather than by the GPU count: DEP16 (`enable_attention_dp: true`) replicates the BF16 non-expert weights on every rank (114 GB) on top of the MXFP4 routed experts at 16-way expert parallelism (90 GB), needing 210 GB per rank, so it requires GB300-class per-GPU memory. TEP16 (`enable_attention_dp: false`) shards those non-expert weights instead and needs 115 GB per rank; it is validated end-to-end on GB200 (`SM100`) at 16 GPUs. On B200 (`SM100`), kernel and module support is functional and covered by CI. Note that the FP8 weight-read path (TRTLLM-14765) does not relax the DEP16 requirement: the conversion runs after the weights are already resident in BF16, so it lowers the steady-state footprint but not the load-time peak.
[^16]: Guided decoding for `Glm4MoeForCausalLM` is currently supported only with the `xgrammar` backend; `llguidance` is not working.
[^17]: Kimi K3 supports suffix-automaton and DSpark speculative decoding. It has no MTP or EAGLE-3 head, and its DSpark checkpoints are not compatible with the plain `DFlash` mode represented by this matrix.

# Encoder-Decoder Feature Support Matrix (PyTorch Backend)

Expand Down
43 changes: 43 additions & 0 deletions tests/integration/defs/accuracy/accuracy_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,39 @@
from tensorrt_llm.logger import logger
from tensorrt_llm.models.modeling_utils import QuantConfig
from tensorrt_llm.quantization import QuantAlgo
from tensorrt_llm.sampling_params import LogitsProcessor

from ..common import venv_check_call, venv_mpi_check_call
from ..conftest import llm_models_root
from ..trt_test_alternative import check_call, exists
from .video_mme import VideoMME as VideoMMEEvaluator


class ForceTokenLogitsProcessor(LogitsProcessor):

def __init__(self, forced_token_id: int) -> None:
self._forced_token_id = forced_token_id

def __call__(
self,
req_id: int,
logits: torch.Tensor,
token_ids: list[list[int]],
stream_ptr: int | None,
client_id: int | None,
) -> None:
del req_id, token_ids, client_id
if stream_ptr is None:
self._force_token(logits)
return
with torch.cuda.stream(torch.cuda.ExternalStream(stream_ptr)):
self._force_token(logits)

def _force_token(self, logits: torch.Tensor) -> None:
logits.fill_(float("-inf"))
logits[..., self._forced_token_id] = 0


def compute_theta(num_samples: int,
sigma: float,
alpha: float = 0.05,
Expand Down Expand Up @@ -125,6 +151,23 @@ def assert_passing(self, accuracy: float) -> None:
assert accuracy <= self.threshold, err_msg


def compute_acceptance_length(llm: PyTorchLLM) -> float:
"""Mean acceptance length over speculative iterations.

Requires enable_iter_perf_stats=True. Used by the AL-regression tests.
"""
stats = llm.get_stats(timeout=2)
spec_iters = [
stat["specDecodingStats"] for stat in stats
if stat.get("specDecodingStats")
and stat["specDecodingStats"]["numDraftTokens"] > 0
]
assert spec_iters, "No iterations with speculative decoding stats"
accepted = sum(stat["numAcceptedTokens"] for stat in spec_iters)
requests = sum(stat["numRequestsWithDraftTokens"] for stat in spec_iters)
return (accepted + requests) / requests


def assert_acceptance_length(test_key: str, al_value: float) -> None:
"""Assert acceptance length meets the registered minimum.

Expand Down
30 changes: 2 additions & 28 deletions tests/integration/defs/accuracy/test_glm52.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import jsonschema
import pytest
import torch

from tensorrt_llm import LLM
from tensorrt_llm.evaluate import JsonModeEval as JsonModeEvaluator
Expand All @@ -32,34 +31,9 @@
SchedulingParams,
)
from tensorrt_llm.quantization import QuantAlgo
from tensorrt_llm.sampling_params import LogitsProcessor

from ..conftest import llm_models_root, parametrize_with_ids, skip_pre_blackwell, skip_ray
from .accuracy_core import GSM8K, JsonModeEval, LlmapiAccuracyTestHarness


class _ForceTokenLogitsProcessor(LogitsProcessor):
def __init__(self, forced_token_id: int) -> None:
self._forced_token_id = forced_token_id

def __call__(
self,
req_id: int,
logits: torch.Tensor,
token_ids: list[list[int]],
stream_ptr: int | None,
client_id: int | None,
) -> None:
del req_id, token_ids, client_id
if stream_ptr is None:
self._force_token(logits)
return
with torch.cuda.stream(torch.cuda.ExternalStream(stream_ptr)):
self._force_token(logits)

def _force_token(self, logits: torch.Tensor) -> None:
logits.fill_(float("-inf"))
logits[..., self._forced_token_id] = 0
from .accuracy_core import GSM8K, ForceTokenLogitsProcessor, JsonModeEval, LlmapiAccuracyTestHarness


class _JsonModeGrammarEval(JsonModeEvaluator):
Expand Down Expand Up @@ -413,7 +387,7 @@ def _assert_logits_processor(llm: LLM) -> None:
max_tokens=output_length,
temperature=0,
end_id=-1,
logits_processor=_ForceTokenLogitsProcessor(forced_token_id),
logits_processor=ForceTokenLogitsProcessor(forced_token_id),
),
use_tqdm=False,
)
Expand Down
Loading
Loading