fix: parametrized dtype silently overridden in test_autotuner, error message wrong in test_integration#4338
Open
tatavishnurao wants to merge 4 commits intopytorch:mainfrom
Open
Conversation
- Replace print() with logger.info() in fusion_utils.py (unconsoleable output during torch.compile)
- Add kernel availability guard to Int4OpaqueTensor.from_hp_da8w4() with clear error message
- Add kernel availability guard to QuantizedLinear._forward_2d() to prevent AttributeError
- Replace mutable default kwargs={} in _replace_embedding_with_quantized_embedding()
- Fix fragile stdout capture in test_rope_fusion_detection.py to use logger capture
- Add public API exports to embedding/__init__.py (EmbeddingQuantizer, QuantizedLinear, etc.)
- Remove unused _is_blackwell() from attention/utils.py
- Remove misconfigured @triton.autotune decorators (empty configs, constexpr key)
- Replace stale _float8_cutlass_quant imports with clear ImportError in benchmark_rowwise_scaled_linear_sparse_cutlass.py and benchmark_sparse_conversion_cutlass.py (AQT deletion removed these APIs) - Replace stale torchao.prototype.uintx import with clear ImportError in benchmark_uintx.py (module no longer exists) - Fix raise "string" TypeError in benchmark_hqq.py -> raise RuntimeError(...) - Fix unclosed file handle in intmm.py (use with statement) - Fix unused 'x' parameter in benchmark_gpu_sparsity.py benchmark_model_with_warmup() and remove misleading string arguments - Fix output filename collision: benchmark_sparse_conversion_cutlass.py now writes to sparse_conversion_cutlass_time_results.csv - Fix typo: deprecated_tenosr_subclass -> deprecated_tensor_subclass in benchmark_aq.py
…ntegration - Remove overrides in test_int_mm, test_int_mm_float8, and test_int_scaled_mm that silently overwrote the parametrized dtype value, making float16 test cases never actually test float16 - Fix assertion to use the parametrized dtype instead - Fix incorrect variable reference in test_integration.py SQNR error message: →
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4338
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two bugs found during test diagnostics:
1. Parametrized
dtypesilently overridden intest_autotuner.pyAll three test methods in
TestQuantFlowparametrize overdtype(bothtorch.bfloat16andtorch.float16), but immediately override it withdtype = torch.bfloat16:test_int_mm(line 40)test_int_mm_float8(line 62)test_int_scaled_mm(line 88)This means the
torch.float16test cases never actually test float16 — they silently run with bfloat16 instead, giving false coverage.Additionally,
test_int_scaled_mmassertsout32_1.dtype == torch.bfloat16which would fail for float16 if the override were removed. Fixed to assert the parametrizeddtypeinstead.Fix: Removed the three
dtype = torch.bfloat16overrides and changed the hardcoded assertion to use the parametrizeddtype.2. Incorrect variable in error message in
test_integration.pyLine 641-642: The SQNR error message references
SQNR(ref_f, ref_q)instead ofSQNR(ref_f, test). When the assertion fails, the error message shows the SQNR between the float reference and the compiled quantized reference instead of the actual test value.Fix: Changed
ref_q→testin the error message.Test plan
pytest test/kernel/test_autotuner.py— verify float16 parametrized tests now actually use float16pytest test/integration/test_integration.py— verify no regressions