[https://nvbugs/6490028][fix] Bump only the cross-library cublas_tolerance from 1.05 to 1.10 in the test…#16788
Conversation
… NVFP4 test The heuristic-vs-cuBLASLt comparison in test_cutedsl_nvfp4_heuristic_matches_full_sweep uses a 1.05x tolerance on a ~28us GEMM kernel profiled over only 20 iterations. Run-to-run jitter from DVFS, L2 residency, and interleaving with cuBLAS autotune warmup easily exceeds 5% at this kernel scale, so the bound is inside the measurement noise floor and the test flakes above threshold by <1% intermittently. Relax cublas_tolerance to 1.10 (the intra-CuteDSL sweep-vs-heuristic 1.05 tolerance is unchanged -- that comparison is the actual pruning-feature invariant and is not cross-library). Signed-off-by: trtllm-agent <296075020+trtllm-agent@users.noreply.github.com>
WalkthroughThe CuteDSL autotuner test increases the cuBLASLt comparison tolerance from 1.05 to 1.10 and adds comments about cross-library profiling variability. ChangesAutotuner tolerance adjustment
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/unittest/_torch/misc/test_autotuner.py`:
- Around line 1263-1267: Register
test_cutedsl_nvfp4_heuristic_matches_full_sweep in both the test-db and qa
test-list registries under tests/integration/test_lists, and add the
corresponding CBTS coverage entry using the repository’s existing conventions so
the test is included in CI and QA routing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: f9ea4ac7-e591-44a6-be38-71ef96ceaa46
📒 Files selected for processing (1)
tests/unittest/_torch/misc/test_autotuner.py
| # This is a cross-library comparison (CuteDSL vs cuBLASLt) at ~28us per call | ||
| # profiled over only 20 iterations; run-to-run jitter easily reaches a few | ||
| # percent from DVFS, L2 residency, and interleaving with cuBLAS autotune | ||
| # warmup, so keep this bound looser than the intra-CuteDSL one above. | ||
| cublas_tolerance = 1.10 |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
test_name='test_cutedsl_nvfp4_heuristic_matches_full_sweep'
for dir in tests/integration/test_lists/test-db tests/integration/test_lists/qa; do
if [ -d "$dir" ]; then
rg -n -a "$test_name|test_autotuner.py" "$dir" || true
fi
done
fd -a 'cbts_touchmap\.sqlite|.*coverage.*' tests || trueRepository: NVIDIA/TensorRT-LLM
Length of output: 293
🏁 Script executed:
#!/bin/bash
set -euo pipefail
test_name='test_cutedsl_nvfp4_heuristic_matches_full_sweep'
echo '--- target test definition ---'
rg -n -a "$test_name" tests/unittest/_torch/misc/test_autotuner.py || true
echo '--- test list references ---'
for dir in tests/integration/test_lists/test-db tests/integration/test_lists/qa; do
if [ -d "$dir" ]; then
echo "[$dir]"
rg -n -a "$test_name|test_autotuner.py" "$dir" || true
fi
done
echo '--- coverage / touchmap artifacts ---'
fd -a 'cbts_touchmap\.sqlite|.*coverage.*' tests || trueRepository: NVIDIA/TensorRT-LLM
Length of output: 535
Register test_cutedsl_nvfp4_heuristic_matches_full_sweep in the test lists
It isn’t present in tests/integration/test_lists/test-db/ or tests/integration/test_lists/qa/, and the CBTS coverage artifact is missing here, so this test can slip past CI/QA routing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/unittest/_torch/misc/test_autotuner.py` around lines 1263 - 1267,
Register test_cutedsl_nvfp4_heuristic_matches_full_sweep in both the test-db and
qa test-list registries under tests/integration/test_lists, and add the
corresponding CBTS coverage entry using the repository’s existing conventions so
the test is included in CI and QA routing.
Source: Path instructions
Summary
cublas_tolerance=1.05on a cross-library ~28us GEMM comparison profiled over only 20 iterations is inside the measurement's own run-to-run noise floor, so the test flakes above threshold by <1% intermittently.cublas_tolerancefrom 1.05 to 1.10 in the test; keep the intra-CuteDSL 1.05 tolerance unchanged. Added a comment explaining why the two tolerances differ.Test plan
Links
Dev Engineer Review
cublas_tolerancefrom1.05to1.10only for the cross-library CuteDSL-versus-cuBLASLt comparison.1.05, with comments documenting the rationale and expected measurement jitter.QA Engineer Review
test_cutedsl_nvfp4_heuristic_matches_full_sweep.test-db/orqa/was not identified.