fix(benchmarks): raise-with-string, fd leak, unused arg, and typo (refs #4335)#4337
fix(benchmarks): raise-with-string, fd leak, unused arg, and typo (refs #4335)#4337Anai-Guo wants to merge 5 commits intopytorch:mainfrom
Conversation
๐ Helpful Links๐งช See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4337
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. |
|
Hi @Anai-Guo! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Fixes part of #4335 — broken imports and bugs in
benchmarks/directory.This PR addresses the bugs that can be fixed without touching benchmarks whose underlying APIs were removed (
benchmark_uintx.py,benchmark_rowwise_scaled_linear_sparse_cutlass.py,benchmark_sparse_conversion_cutlass.py); those need a maintainer call on whether to delete the files or rewrite against the post-AQT API, so I left them out.Fixes
1.
benchmark_hqq.py—raisewith string argument (Python 3 invalid)In Python 3,
raise <str>raisesTypeError: exceptions must derive from BaseException, which masks the intended message. Replaced withraise RuntimeError(...)(andfrom echained on theImportErrorpath).2.
intmm.py:102— leaked file descriptorWrapped in a
withblock.3.
benchmark_gpu_sparsity.py:31— unusedxparameter, callers passing stringsxis never used inside the body. Callers were passing strings like"dense.json.gz"as the second positional argument — likely a remnant of an earlier signature that took a profile-output filename. The strings were never written anywhere. Dropped the parameter and updated all four call sites.4.
benchmark_aq.py:47— typodeprecated_tenosr_subclassRenamed to
deprecated_tensor_subclass(consistent within the function, so behavior unchanged — readability only).Not touched
benchmark_uintx.py:torchao.prototype.uintxanduintx_affine_weight_onlyhave been removed; no drop-in replacement exists per the issue. Needs a maintainer decision on whether to delete or rewrite.benchmark_rowwise_scaled_linear_sparse_cutlass.py/benchmark_sparse_conversion_cutlass.py: import_float8_cutlass_quant/_float8_cutlass_quant_sparsewhich were removed when AQT was deleted. The current API is intorchao/quantization/quantize_/workflows/float8/sparse_2x4_cutlass_float8_tensor.py, but porting the benchmarks to it is non-trivial — happy to do it in a follow-up if there's interest.Verification
All four pass.
๐ค Generated with Claude Code