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
18 changes: 18 additions & 0 deletions .github/tava_architecture_diagram.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ graph TB
BatchManager --> KVCache
end

subgraph "Usage_Telemetry"
Comment thread
yibinl-nvidia marked this conversation as resolved.
ReportUsage[report_usage]
BgReporter[Background Reporter]
GxtPayload[GXT Payload Builder]
GxtEndpoint[NvTelemetry Endpoint]
ReportUsage --> BgReporter
BgReporter --> GxtPayload
GxtPayload --> GxtEndpoint
end

subgraph "Output_Results"
Tokens[Generated Tokens]
Stats[Performance Stats]
Expand All @@ -99,13 +109,17 @@ graph TB
GenVideos[Generated Videos]
end

LLMAPI --> ReportUsage

PyTorch_Flow ~~~ TensorRT_Flow

TensorRT_Flow --> Output_Results
PyTorch_Flow --> Output_Results
AutoDeploy_Flow --> Output_Results
Visual_Gen_Flow --> Output_Results

AutoDeploy_Flow ~~~ Usage_Telemetry

%% Force Output_Results to be between PyTorch_flow and TensorRT_flow
PyTorch_Flow ~~~ Output_Results

Expand Down Expand Up @@ -141,6 +155,10 @@ graph TB
classDef api fill:#bfb,stroke:#333,stroke-width:2px;
class PythonAPI,CppAPI,LLMAPI api;

%% Telemetry format
classDef telemetry fill:#cef,stroke:#333,stroke-width:2px;
class ReportUsage,BgReporter,GxtPayload,GxtEndpoint telemetry;

%% Results format
classDef result fill:#fbb,stroke:#333,stroke-width:2px;
class Tokens,Stats,Metrics,GenImages,GenVideos result;
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,41 @@ Deprecation is used to inform developers that some APIs and tools are no longer
4. Removal After Migration Period
- After the 3-month migration period ends, deprecated APIs, tools, or parameters are removed in a manner consistent with semantic versioning (major version changes may include breaking removals).

## Telemetry Data Collection

TensorRT-LLM collects anonymous telemetry data by default. This data is used
in aggregate to understand usage patterns and prioritize engineering efforts.
**This data cannot be traced back to any individual user.** No prompts,
user-identifying information, or persistent identifiers are collected. Any
deployment identifiers are ephemeral, randomly generated per deployment, and
not linked to users. The data we collect includes:

- Ingress point (e.g., LLM API, CLI, serve command)
- Deployment duration (via periodic heartbeats)
- GPU SKUs, count, memory, and CUDA version
- Model architecture class name (e.g., `LlamaForCausalLM`)
- Parallelism configuration (TP/PP/CP/MoE-EP/MoE-TP sizes), quantization algorithm, dtype, KV cache dtype
- System information (OS platform, Python version, CPU architecture, CPU count)
- TRT-LLM version and backend
- Feature flags (LoRA, speculative decoding, prefix caching, CUDA graphs, chunked context, data parallelism)
- Disaggregated serving metadata (role and deployment ID)
Comment thread
venkywonka marked this conversation as resolved.

Telemetry is automatically disabled in CI and test environments.

### Opting Out of Telemetry Data Collection

To disable telemetry data collection, use any of the following methods:

- **Environment variable**: Set `TRTLLM_NO_USAGE_STATS=1`, `DO_NOT_TRACK=1`, or `TELEMETRY_DISABLED=true`
- **File-based**: Create the file `~/.config/trtllm/do_not_track`
- **Python API**: Pass `TelemetryConfig(disabled=True)` to `LLM()`
- **CLI flag**: Use `--no-telemetry` on `trtllm-serve`, `trtllm-bench`, or `trtllm-eval`

The telemetry collection code is fully open source and auditable at
[`tensorrt_llm/usage/`](./tensorrt_llm/usage/). For a detailed field-by-field
reference of exactly what is collected, see the
[schema documentation](./tensorrt_llm/usage/schemas/README.md).

## Useful Links
- [Quantized models on Hugging Face](https://huggingface.co/collections/nvidia/model-optimizer-66aa84f7966b3150262481a4): A growing collection of quantized (e.g., FP8, FP4) and optimized LLMs, including [DeepSeek FP4](https://huggingface.co/nvidia/DeepSeek-R1-FP4), ready for fast inference with TensorRT LLM.
- [NVIDIA Dynamo](https://github.com/ai-dynamo/dynamo): A datacenter scale distributed inference serving framework that works seamlessly with TensorRT LLM.
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ def has_ext_modules(self):
"_torch/auto_deploy/config/*.yaml",
# Include CUDA source for fused MoE align extension so runtime JIT can find it in wheels
'_torch/auto_deploy/custom_ops/fused_moe/moe_align_kernel.cu',
'_torch/auto_deploy/custom_ops/fused_moe/triton_fused_moe_configs/*'
'_torch/auto_deploy/custom_ops/fused_moe/triton_fused_moe_configs/*',
'usage/schemas/*.json',
]


Expand Down
2 changes: 2 additions & 0 deletions tensorrt_llm/bench/benchmark/low_latency.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ def latency_command(
llm = None
kwargs = kwargs | runtime_config.get_llm_args()
kwargs['backend'] = options.backend
if bench_env.telemetry_config is not None:
kwargs["telemetry_config"] = bench_env.telemetry_config

# Set environment variables for setting runtime options.
default_env_overrides = {
Expand Down
2 changes: 2 additions & 0 deletions tensorrt_llm/bench/benchmark/throughput.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ def throughput_command(
kwargs = kwargs | runtime_config.get_llm_args()
kwargs['skip_tokenizer_init'] = not no_skip_tokenizer_init
kwargs['backend'] = options.backend
if bench_env.telemetry_config is not None:
kwargs["telemetry_config"] = bench_env.telemetry_config

llm = get_llm(runtime_config, kwargs)

Expand Down
3 changes: 2 additions & 1 deletion tensorrt_llm/bench/build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ def build_command(
quant_config=quant_config,
workspace=str(bench_env.workspace),
load_format=load_format,
trust_remote_code=trust_remote_code)
trust_remote_code=trust_remote_code,
telemetry_config=bench_env.telemetry_config)
# Save the engine.
llm.save(engine_dir)
llm.shutdown()
Expand Down
1 change: 1 addition & 0 deletions tensorrt_llm/bench/dataclasses/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class BenchmarkEnvironment(BaseModel):
checkpoint_path: Optional[Path]
workspace: Path
revision: Optional[str] = None
telemetry_config: Optional[Any] = None


class InferenceRequest(BaseModel):
Expand Down
18 changes: 14 additions & 4 deletions tensorrt_llm/commands/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from tensorrt_llm.bench.dataclasses.general import BenchmarkEnvironment
from tensorrt_llm.bench.dataset.prepare_dataset import prepare_dataset
from tensorrt_llm.logger import logger, severity_map
from tensorrt_llm.usage import config as _telemetry_config


class NotRequiredForHelp(click.Option):
Expand Down Expand Up @@ -56,6 +57,9 @@ def handle_parse_result(self, ctx, opts, args):
default=None,
help="The revision to use for the HuggingFace model "
"(branch name, tag name, or commit id).")
@click.option("--telemetry/--no-telemetry",
default=True,
help="Enable or disable anonymous usage telemetry collection.")
@click.pass_context
def main(
ctx,
Expand All @@ -64,15 +68,21 @@ def main(
workspace: Path,
log_level: str,
revision: Optional[str],
telemetry: bool,
) -> None:
logger.set_level(log_level)
if model is None:
return

ctx.obj = BenchmarkEnvironment(model=model,
checkpoint_path=model_path,
workspace=workspace,
revision=revision)
ctx.obj = BenchmarkEnvironment(
model=model,
checkpoint_path=model_path,
workspace=workspace,
revision=revision,
telemetry_config=_telemetry_config.TelemetryConfig(
disabled=not telemetry,
usage_context=_telemetry_config.UsageContext.CLI_BENCH),
)

# Create the workspace where we plan to store intermediate files.
ctx.obj.workspace.mkdir(parents=True, exist_ok=True)
Expand Down
48 changes: 36 additions & 12 deletions tensorrt_llm/commands/eval.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -26,6 +26,7 @@
from ..llmapi import BuildConfig, KvCacheConfig
from ..llmapi.llm_utils import update_llm_args_with_extra_options
from ..logger import logger, severity_map
from ..usage import config as _telemetry_config


@click.group()
Expand Down Expand Up @@ -117,31 +118,49 @@
is_flag=True,
default=False,
help="Flag for disabling KV cache reuse.")
@click.option("--telemetry/--no-telemetry",
default=True,
help="Enable or disable anonymous usage telemetry collection.")
@click.pass_context
def main(ctx, model: str, tokenizer: Optional[str],
custom_tokenizer: Optional[str], log_level: str, backend: str,
max_beam_width: int, max_batch_size: int, max_num_tokens: int,
max_seq_len: int, tp_size: int, pp_size: int, ep_size: Optional[int],
gpus_per_node: Optional[int], kv_cache_free_gpu_memory_fraction: float,
trust_remote_code: bool, revision: Optional[str],
extra_llm_api_options: Optional[str], disable_kv_cache_reuse: bool):
extra_llm_api_options: Optional[str], disable_kv_cache_reuse: bool,
telemetry: bool):
logger.set_level(log_level)

kv_cache_config = KvCacheConfig(
free_gpu_memory_fraction=kv_cache_free_gpu_memory_fraction,
enable_block_reuse=not disable_kv_cache_reuse)

llm_args = {
"model": model,
"tokenizer": tokenizer,
"custom_tokenizer": custom_tokenizer,
"tensor_parallel_size": tp_size,
"pipeline_parallel_size": pp_size,
"moe_expert_parallel_size": ep_size,
"gpus_per_node": gpus_per_node,
"trust_remote_code": trust_remote_code,
"revision": revision,
"kv_cache_config": kv_cache_config,
"model":
model,
"tokenizer":
tokenizer,
"custom_tokenizer":
custom_tokenizer,
"tensor_parallel_size":
tp_size,
"pipeline_parallel_size":
pp_size,
"moe_expert_parallel_size":
ep_size,
"gpus_per_node":
gpus_per_node,
"trust_remote_code":
trust_remote_code,
"revision":
revision,
"kv_cache_config":
kv_cache_config,
"telemetry_config":
_telemetry_config.TelemetryConfig(
disabled=not telemetry,
usage_context=_telemetry_config.UsageContext.CLI_EVAL),
}

if backend == 'pytorch':
Expand All @@ -166,6 +185,11 @@ def main(ctx, model: str, tokenizer: Optional[str],
llm_args = update_llm_args_with_extra_options(llm_args,
extra_llm_api_options)

# CLI --no-telemetry always wins over YAML config
if not telemetry:
llm_args["telemetry_config"] = llm_args["telemetry_config"].model_copy(
update={"disabled": True})

profiler.start("trtllm init")
llm = llm_cls(**llm_args)
profiler.stop("trtllm init")
Expand Down
Loading
Loading