Skip to content

Commit f80dd17

Browse files
committed
fix(qwen3.8): satisfy repository contracts and formatting
Community CPU failed on the previous head. Three unrelated causes. clang-format rejected three sites introduced by the review fixes: a boolean chain in Qwen38KvCache::ok(), the POSIX headers added to plugin_helpers.cpp for the kernel staging change, and the open() call in that same function. The C++ sources are now formatted with the version CI runs. The HF reference sidecar carried the bare term "qwen" in a comment naming this module's own dotted import path. That term is reserved to the qwen_vl family by test_hf_transformers_model_plugins_do_not_name_sibling_families, and the qwen3_5 sidecar contains no occurrence of it either. The comment now refers to the module without naming the path. Adding a family shifts repository-wide counters that several contract tests assert exactly. All of them are bumped by one for qwen3_8 and its qwen38-27b profile, relative to the current main: test_family_specialization families 85 -> 86 test_trtmc_validate catalog models / ready models 117 -> 118 validation bindings 118 -> 119 dataset-backed binding models 117 -> 118 test_perf_matrix release suite cases 110 -> 111 release raw entries 80 -> 81 family/operation pairs 80 -> 81 distinct families 78 -> 79 public_pipeline_call_wall 85 -> 86 consolidated result rows 110 -> 111 test_repository_contracts delegates to the validate and perf-matrix checks, so it passes once those counts are correct. These counters were stale from the first commit of this branch, not from the review fixes. The earlier local runs covered only four test files and none of these; the full set now passes. Validation on one NVIDIA SM 10.0 device with TensorRT 11.1.0.106: clang-format --dry-run --Werror is clean over every qwen3_8 C++ source; ruff, tools/legal_headers.py and tools/check_doc_file_references.py are clean; the eight contract and family test files plus the qwen3_5 regression pass 663/663; and ctest -R qwen3_8 passes 3/3. Signed-off-by: Zhenshan Xie <zhenshanx@nvidia.com>
1 parent 8e5041a commit f80dd17

6 files changed

Lines changed: 18 additions & 19 deletions

File tree

src/runtime/models/qwen3_8/kv_cache.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ bool Qwen38KvCache::ok() const {
387387
}
388388
return true;
389389
};
390-
return group_ok(cache_k_) && group_ok(cache_v_) && group_ok(present_k_) &&
391-
group_ok(present_v_);
390+
return group_ok(cache_k_) && group_ok(cache_v_) && group_ok(present_k_) && group_ok(present_v_);
392391
}
393392

394393
} // namespace trtmc

src/runtime/models/qwen3_8/plugin_helpers.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212
#include <chrono>
1313
#include <cstring>
1414
#include <fcntl.h>
15-
#include <sys/stat.h>
16-
#include <unistd.h>
17-
1815
#include <fstream>
1916
#include <iomanip>
2017
#include <iostream>
2118
#include <sstream>
2219
#include <stdexcept>
2320
#include <string_view>
21+
#include <sys/stat.h>
22+
#include <unistd.h>
2423
#include <utility>
2524

2625
#if TRTMC_HAS_TVM_FFI
@@ -439,7 +438,8 @@ std::string write_kernel_so_to_temp(const std::string& global_name, const char*
439438
return {};
440439

441440
std::string tmp_path = std::string(dir_buf.data()) + "/" + safe_name + ".so";
442-
const int fd = ::open(tmp_path.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, S_IRUSR | S_IWUSR);
441+
const int fd =
442+
::open(tmp_path.c_str(), O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW, S_IRUSR | S_IWUSR);
443443
if (fd < 0) {
444444
::rmdir(dir_buf.data());
445445
return {};

tests/e2e/models/qwen3_8/e2e_plugins/references/hf_transformers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ def _reference_env(ctx: RunContext) -> dict[str, str]:
204204
env = dict(os.environ)
205205
if ctx.ld_library_path:
206206
env["LD_LIBRARY_PATH"] = ctx.ld_library_path
207-
# The child imports tests.e2e.models.qwen3_8.e2e_plugins.references, so the
208-
# repository root has to be importable even when the parent process runs
209-
# from another directory. Existing entries are preserved.
207+
# The child imports this module by its full dotted path, so the repository
208+
# root has to be importable even when the parent process runs from another
209+
# directory. Existing entries are preserved.
210210
project_dir = str(PROJECT_DIR)
211211
existing = env.get("PYTHONPATH", "")
212212
parts = [p for p in existing.split(os.pathsep) if p]

tests/tools/test_family_specialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def test_repository_registers_all_current_families() -> None:
404404

405405
families = specialization.family_dirs(repo_root, ())
406406

407-
assert len(families) == 85
407+
assert len(families) == 86
408408
assert any(family.name == "cosmos3" for family in families)
409409
assert any(family.name == "dinov3" for family in families)
410410
assert any(family.name == "fast_foundation_stereo" for family in families)

tests/tools/test_perf_matrix.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ def test_release_suite_covers_every_non_l0_ready_model_profile() -> None:
270270

271271
performance_catalog.validate_release_coverage(cases, excluded_profiles)
272272

273-
assert len(cases) == 110
274-
assert len(raw_entries) == 80
273+
assert len(cases) == 111
274+
assert len(raw_entries) == 81
275275
assert len(raw_additional) == 30
276276
assert excluded_profiles == {
277277
"lfm2-1.2b": LFM2_EXCLUSION_REASON,
@@ -289,15 +289,15 @@ def test_release_suite_covers_every_non_l0_ready_model_profile() -> None:
289289
assert not any("priority" in entry for entry in raw_entries)
290290
assert {case["model"] for case in cases} == ready_profiles - set(excluded_profiles)
291291
assert not any(performance_catalog.is_l0_profile(case["model"]) for case in cases)
292-
assert len({(case["family"], case["operation"]) for case in cases}) == 80
293-
assert len({case["family"] for case in cases}) == 78
292+
assert len({(case["family"], case["operation"]) for case in cases}) == 81
293+
assert len({case["family"] for case in cases}) == 79
294294
assert [case["operation"] for case in cases if case["family"] == "eagle_vlm"] == [
295295
"embed",
296296
"rerank",
297297
]
298298
assert Counter(perf_matrix._candidate_timing_scope(case) for case in cases) == {
299299
"model_call_wall": 25,
300-
"public_pipeline_call_wall": 85,
300+
"public_pipeline_call_wall": 86,
301301
}
302302
assert {case["id"] for case in cases if case["baseline"]["asset_loading_included"]} == {
303303
"canary.transcribe",
@@ -2191,7 +2191,7 @@ def preflight_after_pending_report(cases, options):
21912191
assert not scratch_root.exists()
21922192
results = json.loads((output / "results.json").read_text(encoding="utf-8"))
21932193
rows = {row["id"]: row for row in results["cases"]}
2194-
assert len(rows) == 110
2194+
assert len(rows) == 111
21952195
assert results["environment_config"]["name"] == "test-gb300"
21962196
assert results["environment_config"]["execution"]["minimum_gpu_free_fraction"] == 0.0
21972197
assert results["environment_config"]["source"] == str(environment.resolve())

tests/tools/test_trtmc_validate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_model_workload_catalog_covers_every_ready_model():
4545
task_models=task_models,
4646
)
4747

48-
assert len(catalog["models"]) == len(ready_models) == 117
48+
assert len(catalog["models"]) == len(ready_models) == 118
4949
assert sum("not_compared_reason" in spec for spec in catalog["models"].values()) == 0
5050
assert all("e2e" not in spec.get("workloads", []) for spec in catalog["models"].values())
5151
assert "reference_cache_identity" not in catalog["models"]["personaplex-7b"]
@@ -64,7 +64,7 @@ def test_model_workload_catalog_covers_every_ready_model():
6464
}
6565
assert len(qwen_identities) == 1
6666
bindings = trtmc_validate.resolve_bindings(catalog, catalog["models"])
67-
assert len(bindings) == 118
67+
assert len(bindings) == 119
6868
assert {
6969
binding.model for binding in bindings if binding.workload == "mmlu_continuation_parity"
7070
} >= {
@@ -255,7 +255,7 @@ def test_every_dataset_backed_validation_binding_has_native_reference_runner():
255255
missing.append((model_name, workload, dataset_kind))
256256

257257
assert not missing
258-
assert len({model for model, _workload in bindings}) == 117
258+
assert len({model for model, _workload in bindings}) == 118
259259

260260

261261
def test_shadow_gate_metrics_include_plugin_task_accuracy() -> None:

0 commit comments

Comments
 (0)