Skip to content

Commit d9a12c0

Browse files
committed
fix(ci): Align public source with internal CI
GitHub-triggered CI passes --public, but the released test harness lacks that option and the model cases needed to run it. Include the public cases and selection support from the release branch backports. Use a GitHub PR cache namespace for writes while retaining shared cache reads, so these pipelines can run without publishing engines into the native pipeline cache. Signed-off-by: Kevin Fu <kefu@nvidia.com>
1 parent 513dcd1 commit d9a12c0

25 files changed

Lines changed: 1227 additions & 22 deletions

‎AGENTS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ for Google's developer documentation guidance and repository checks.
1818
- Read and follow `CODING_GUIDELINES.md` for ALL code changes (C++ and Python)
1919
- NVIDIA copyright header on ALL new files (update year on modified files) — see `LICENSE_HEADER` for the SPDX template (pre-commit `insert-license` hook auto-injects it for `.py`, `.cpp`, `.cu`, `.cuh`, `.h`, `.hpp` files)
2020
- `git commit -s` (DCO sign-off required). Never attribute AI tools in sign-off line. Always rely on `git` to do the sign off instead of directly adding sign off in commit message.
21+
- Cryptographically sign every commit intended for the TensorRT Edge-LLM GitHub repository, including forks and amended commits, with `git commit -S -s`. Use a signing key registered with the author's GitHub account. The DCO sign-off (`-s`) does not replace the cryptographic signature (`-S`). Verify the signature with `git verify-commit HEAD` before pushing.
2122
- Do not add co-authors to the git commit message unless explicitly instructed to do so by the user.
2223
- `pre-commit` hooks run on commit — if files are modified by hooks, re-stage and commit again
2324
- PR title format: Conventional Commits style (e.g., `feat: Add Qwen3 support`, `fix: Prevent a runtime memory leak`)

‎skills/edge-llm-benchmark-accuracy/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Take the benchmark, sample budget, and baseline from the user; then run Phases 1
2626
- `docs/source/user_guide/examples/integration/nemo-evaluator.md`
2727
- `scripts/run_nemo_eval.py` (`--help` and the parser at its end)
2828
- `requirements-nemo-evaluator.txt` (pinned evaluator packages)
29-
- `tests/model_configs/l0/qwen3_5/qwen3_5_0_8b.yml`, case `nemo-evaluator`: the
29+
- `tests/model_configs/l0/public/qwen3_5/qwen3_5_0_8b.yml`, case `nemo-evaluator`: the
3030
CI-verified recipe and its `score.min` gate
3131

3232
## Inputs

‎tests/conftest.py‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,10 @@ def pytest_addoption(parser):
395395
default=False,
396396
help="Use experimental internal TRT/Myelin weightless "
397397
"engines in checkpoint-direct pipeline validation")
398+
parser.addoption("--public",
399+
action="store_true",
400+
default=False,
401+
help="Select only public model configurations")
398402
parser.addoption("--priority",
399403
action="store",
400404
default=None,
@@ -544,7 +548,7 @@ def _filter_direct_model_quantization_items(items):
544548
items[:] = [item for item in items if id(item) in keep_ids]
545549

546550

547-
def _get_test_list_file(priority):
551+
def _get_test_list_file(priority, public_only=False):
548552
"""Get test configuration with caching"""
549553
if priority is None:
550554
return None
@@ -557,7 +561,7 @@ def _get_test_list_file(priority):
557561
"CI_MERGE_REQUEST_DESCRIPTION is required for a custom L0 run")
558562
custom_description = _complete_merge_request_description(
559563
custom_description)
560-
cache_key = (priority, custom_description)
564+
cache_key = (priority, custom_description, public_only)
561565
if cache_key not in _test_config_cache:
562566
if explicit_list:
563567
config_file = priority
@@ -570,7 +574,7 @@ def _get_test_list_file(priority):
570574
except FileNotFoundError:
571575
config = {}
572576
model_tests = ([] if explicit_list else load_model_tests(
573-
priority, custom_description))
577+
priority, custom_description, public_only))
574578
tests = config.setdefault('tests', [])
575579
project_setup = 'tests/defs/test_common.py::test_build_project'
576580
if (any('test_checkpoint_export.py' not in test.node
@@ -593,7 +597,8 @@ def _configured_test_paths(config):
593597
return None
594598

595599
priority = config.getoption("--priority", "l0")
596-
test_list_file = _get_test_list_file(priority)
600+
test_list_file = _get_test_list_file(priority,
601+
config.getoption("--public"))
597602
if not test_list_file:
598603
return None
599604

@@ -636,7 +641,8 @@ def pytest_generate_tests(metafunc):
636641
return
637642

638643
priority = metafunc.config.getoption("--priority", "l0")
639-
test_list_file = _get_test_list_file(priority)
644+
test_list_file = _get_test_list_file(priority,
645+
metafunc.config.getoption("--public"))
640646

641647
if not test_list_file:
642648
return
@@ -697,7 +703,8 @@ def pytest_collection_modifyitems(config, items):
697703
return
698704

699705
priority = config.getoption("--priority", "l0")
700-
test_list_file = _get_test_list_file(priority)
706+
test_list_file = _get_test_list_file(priority,
707+
config.getoption("--public"))
701708

702709
if not test_list_file:
703710
return

‎tests/defs/model_test_config.py‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,17 +488,24 @@ def _custom_document(description: str) -> Any:
488488
return yaml.safe_load(blocks[0])
489489

490490

491-
def load_model_tests(
492-
priority: str,
493-
custom_description: Optional[str] = None) -> list[ModelTest]:
494-
"""Return checked-in or MR-provided model cases for one existing L0 job."""
491+
def load_model_tests(priority: str,
492+
custom_description: Optional[str] = None,
493+
public_only: bool = False) -> list[ModelTest]:
494+
"""Return one L0 job's cases, optionally excluding private model files.
495+
496+
Public-only discovery does not read or validate private declarations.
497+
Custom MR cases retain their existing selection behavior.
498+
"""
495499
tests: list[ModelTest] = []
496500
if custom_description is not None:
497501
tests.extend(
498502
_parse_model_document(_custom_document(custom_description),
499503
"MR Summary custom L0 block"))
500-
if MODEL_CONFIG_ROOT.is_dir():
501-
for path in sorted(MODEL_CONFIG_ROOT.rglob("*.yml")):
504+
roots = [MODEL_CONFIG_ROOT / "public"]
505+
if not public_only:
506+
roots.append(MODEL_CONFIG_ROOT / "private")
507+
for root in roots:
508+
for path in sorted(root.rglob("*.yml")):
502509
with path.open(encoding="utf-8") as stream:
503510
tests.extend(
504511
_parse_model_document(yaml.safe_load(stream),

‎tests/defs/utils/ci_engine_cache.py‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,17 @@ def _cache_mode():
489489

490490
def _namespace_policy(environment=None):
491491
environment = os.environ if environment is None else environment
492+
if environment.get("GITHUB_PIPELINE") == "true":
493+
namespace = environment.get("GITHUB_CACHE_NAMESPACE", "")
494+
pull_request = environment.get("GITHUB_PR_NUMBER", "")
495+
base_project = environment.get("CI_PROJECT_ID", "")
496+
if (not re.fullmatch(r"[a-z0-9][a-z0-9-]*", namespace)
497+
or not re.fullmatch(r"[1-9][0-9]*", pull_request)
498+
or not re.fullmatch(r"[1-9][0-9]*", base_project)):
499+
raise CacheError("invalid GitHub cache identity")
500+
overlay = f"{namespace}-mr-{pull_request}"
501+
trusted = f"project-{base_project}-main"
502+
return [overlay, trusted], overlay
492503
project = environment.get("CI_PROJECT_ID", "local")
493504
if not re.fullmatch(r"[A-Za-z0-9._-]+", project):
494505
raise CacheError("CI_PROJECT_ID is not a safe cache component")
@@ -539,11 +550,12 @@ def _cache_root() -> pathlib.Path:
539550

540551

541552
def _configured_limit():
553+
overlay = bool(
554+
os.environ.get("CI_MERGE_REQUEST_IID")
555+
or os.environ.get("GITHUB_PIPELINE") == "true")
542556
name = ("EDGE_LLM_ENGINE_MR_CACHE_BYTES"
543-
if os.environ.get("CI_MERGE_REQUEST_IID") else
544-
"EDGE_LLM_ENGINE_TRUSTED_CACHE_BYTES")
545-
default = 100 * 1024**3 if os.environ.get(
546-
"CI_MERGE_REQUEST_IID") else 200 * 1024**3
557+
if overlay else "EDGE_LLM_ENGINE_TRUSTED_CACHE_BYTES")
558+
default = 100 * 1024**3 if overlay else 200 * 1024**3
547559
value = os.environ.get(name, str(default))
548560
if not value.isdecimal():
549561
raise CacheError("{} must be a nonnegative integer".format(name))
@@ -1085,9 +1097,8 @@ def publish_bundle(self) -> None:
10851097
# MR publishers and cleanup run under different NFS identities.
10861098
_allow_shared_read(temporary,
10871099
shared_writes=bool(
1088-
re.fullmatch(
1089-
r"project-[A-Za-z0-9._-]+-mr-[0-9]+",
1090-
self._write_namespace)))
1100+
re.fullmatch(r"[A-Za-z0-9._-]+-mr-[0-9]+",
1101+
self._write_namespace)))
10911102
_replace_directory(temporary, entry)
10921103
result = {
10931104
"namespace": self._write_namespace,

‎tests/model_configs/README.md‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Model-owned L0 tests
22

33
Use this directory to add or change a model deployment tested by L0. Each base
4-
model has one file at `l0/<model-family>/<base-model>.yml`; each named case
4+
model has one file at `l0/public/<model-family>/<base-model>.yml`; each named case
55
selects a checkpoint, target job, engine settings, and inference scenarios.
66

77
## Add or modify a case
@@ -200,3 +200,20 @@ The Pydantic models define allowed fields, types, and combinations:
200200
When adding a new field, update its owning model and check that the selected
201201
executor consumes it. The [loader](../defs/model_test_config.py) resolves paths
202202
and turns validated cases into executable tests.
203+
204+
## Public and private model cases
205+
206+
Keep public cases under `l0/public/` and internal cases under `l0/private/`.
207+
Both directories retain the model-family and one-file-per-model layout. A model
208+
may have a file in each directory with distinct case names. Native test runs
209+
load both directories. GitHub-origin jobs pass `--public`, which reads only
210+
public declarations, including their generated export, build, and inference
211+
phases. Private declarations are not parsed in that mode.
212+
213+
```bash
214+
python3 -m pytest tests --priority=l0_e2e_a30 --public --collect-only -q
215+
```
216+
217+
The flag filters checked-in model configurations. Explicit YAML lists,
218+
`--test-param`, and custom MR cases retain their existing selection behavior.
219+
A run that collects no tests retains pytest's no-tests failure.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
schema_version: 1
2+
model_id: google/gemma-4-12B-it
3+
inputs: [text]
4+
outputs: [text]
5+
cases:
6+
# The dense gemma4_unified member of the family, distinct from the gemma4 MoE
7+
# covered by gemma-4-26B-A4B. Its leading layers are sliding-window attention
8+
# and run through the CuTe DSL FMHA-v2 vision-block kernel, which no other
9+
# few-layer case reaches.
10+
- name: four-layer-parity
11+
mode: direct_builder
12+
platform: l0_e2e_rtx5090
13+
quantized_model_id_or_dir: /scratch.trt_llm_data/llm-models/gemma/gemma-4-12B-it
14+
requirements:
15+
min_sm: 100
16+
min_gpu_memory_gb: 7
17+
engine:
18+
max_kv_cache_capacity: 256
19+
max_input_len: 256
20+
max_batch_size: 4
21+
inference:
22+
- name: pytorch-parity
23+
scenario: few_layer
24+
input_file: tests/test_cases/ragged_batch.json
25+
num_layers: 4
26+
cosine_threshold: 0.99
27+
minimum_compute_capability: 100
28+
arguments:
29+
- --direct-builder
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
schema_version: 1
2+
model_id: google/gemma-4-26B-A4B-it
3+
inputs: [text]
4+
outputs: [text]
5+
cases:
6+
- name: four-layer-parity
7+
model_name: gemma-4-26B-A4B-NVFP4
8+
mode: direct_builder
9+
platform: l0_e2e_b100
10+
quantized_model_id_or_dir: ${LLM_MODELS_DIR}/gemma/nvidia-Gemma-4-26B-A4B-NVFP4
11+
requirements:
12+
min_sm: 100
13+
min_gpu_memory_gb: 21
14+
engine:
15+
max_kv_cache_capacity: 256
16+
max_input_len: 256
17+
max_batch_size: 4
18+
inference:
19+
# 0.90, below the 0.95-0.98 band the other MoE cases use, and measured: seven
20+
# runs on this fixture read 0.92576-0.93964, so the gate sits one spread below
21+
# the lowest sample. The worst tensor is always the logits of a decode round;
22+
# every KV entry reads >= 0.994. At 0.90 a dropped scale factor, a wrong kernel
23+
# or a structurally broken layer still land far below, and the norm-ratio gate
24+
# (scale-tol 0.25) covers the scale invariance cosine throws away.
25+
- name: pytorch-parity
26+
scenario: few_layer
27+
input_file: tests/test_cases/ragged_batch.json
28+
num_layers: 4
29+
cosine_threshold: 0.90
30+
minimum_compute_capability: 100
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
schema_version: 1
2+
model_id: google/gemma-4-E2B-it
3+
inputs: [text]
4+
outputs: [text]
5+
cases:
6+
- name: nvfp4-mtp-onnx
7+
model_name: gemma-4-E2B-it-NVFP4
8+
mode: onnx
9+
platform: l0_e2e_drive_thor
10+
quantized_model_id_or_dir: /scratch.edge_llm_cache/models/modelopt-0.45.0/quantization_checkpoint/public/gemma-4-E2B-it-NVFP4
11+
requirements:
12+
min_sm: 100
13+
min_gpu_memory_gb: 11
14+
spec_decode_config: mtp
15+
draft_id_or_dir: ${LLM_MODELS_DIR}/gemma/gemma-4-E2B-it-assistant
16+
engine:
17+
max_kv_cache_capacity: 2048
18+
max_input_len: 1024
19+
max_batch_size: 1
20+
inference:
21+
- name: basic
22+
scenario: generate
23+
input_file: tests/test_cases/llm_basic.json
24+
checks:
25+
accuracy:
26+
required: [rouge1, rouge_l]
27+
max_regression: 0.30
28+
performance:
29+
required:
30+
- peak_gpu_memory_mb
31+
- prefill_tokens_per_second
32+
- spec_decode_acceptance_rate
33+
- spec_decode_average_accept_length
34+
- spec_decode_tokens_per_second
35+
max_regression: 0.30
36+
- name: guided-decoding
37+
scenario: generate
38+
input_file: tests/test_cases/llm_guided_decoding.json
39+
checks:
40+
performance:
41+
required:
42+
- peak_gpu_memory_mb
43+
- prefill_tokens_per_second
44+
- spec_decode_acceptance_rate
45+
- spec_decode_average_accept_length
46+
- spec_decode_tokens_per_second
47+
max_regression: 0.30
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
schema_version: 1
2+
model_id: OpenGVLab/InternVL3-1B
3+
inputs: [text, image]
4+
outputs: [text]
5+
cases:
6+
- name: int4-image-onnx
7+
model_name: InternVL3-1B-INT4-AWQ
8+
mode: onnx
9+
platform: l0_e2e_orin
10+
quantized_model_id_or_dir: /scratch.edge_llm_data/onnx_models/modelopt-0.45.0/quantization_checkpoint/public/InternVL3-1B-INT4-AWQ
11+
requirements:
12+
min_sm: 80
13+
min_gpu_memory_gb: 5
14+
engine:
15+
max_kv_cache_capacity: 2048
16+
max_input_len: 1024
17+
max_batch_size: 1
18+
min_image_tokens: 256
19+
max_image_tokens: 1024
20+
max_image_tokens_per_image: 512
21+
inference:
22+
- name: image
23+
scenario: generate
24+
input_file: tests/test_cases/vlm_basic.json
25+
checks:
26+
accuracy:
27+
required: [rouge1, rouge_l]
28+
max_regression: 0.30
29+
performance:
30+
required:
31+
- prefill_tokens_per_second
32+
- generation_tokens_per_second
33+
- multimodal_time_per_token_ms
34+
max_regression: 0.30
35+
36+
- name: int4-image-ipc-onnx
37+
model_name: InternVL3-1B-INT4-AWQ
38+
mode: onnx
39+
platform: l0_e2e_drive_thor
40+
quantized_model_id_or_dir: /scratch.edge_llm_data/onnx_models/modelopt-0.45.0/quantization_checkpoint/public/InternVL3-1B-INT4-AWQ
41+
requirements:
42+
min_sm: 80
43+
min_gpu_memory_gb: 5
44+
engine:
45+
max_kv_cache_capacity: 2048
46+
max_input_len: 1024
47+
max_batch_size: 1
48+
min_image_tokens: 256
49+
max_image_tokens: 1024
50+
max_image_tokens_per_image: 512
51+
inference:
52+
- name: media-ipc
53+
scenario: media_ipc_server

0 commit comments

Comments
 (0)