Pyrefly suppressions 6/n (#164877)

Adds suppressions to pyrefly will typecheck clean: https://github.com/pytorch/pytorch/issues/163283

Almost there!

Test plan:
dmypy restart && python3 scripts/lintrunner.py -a
pyrefly check

step 1: delete lines in the pyrefly.toml file from the project-excludes field
step 2: run pyrefly check
step 3: add suppressions, clean up unused suppressions
before: https://gist.github.com/maggiemoss/4b3bf2037014e116bc00706a16aef199

after:

INFO 0 errors (5,064 ignored)

Only four directories left to enable

Pull Request resolved: https://github.com/pytorch/pytorch/pull/164877
Approved by: https://github.com/oulgen
This commit is contained in:
Maggie Moss
2025-10-08 02:30:53 +00:00
committed by PyTorch MergeBot
parent ad7b2bebc6
commit 086dec3235
123 changed files with 355 additions and 72 deletions

View File

@ -140,6 +140,7 @@ def sparse_semi_structured_from_dense_cutlass(dense):
if dense.dtype != torch.float:
sparse0 = dense_4.gather(-1, idxs0.unsqueeze(-1)) # type: ignore[possibly-undefined]
# pyrefly: ignore # unbound-name
sparse1 = dense_4.gather(-1, idxs1.unsqueeze(-1))
sparse = torch.stack((sparse0, sparse1), dim=-1).view(m, k // 2)
else:
@ -172,6 +173,7 @@ def sparse_semi_structured_from_dense_cutlass(dense):
meta_offsets = _calculate_meta_reordering_scatter_offsets(
m, meta_ncols, meta_dtype, device
)
# pyrefly: ignore # unbound-name
meta_reordered.scatter_(0, meta_offsets, meta.view(-1))
return (sparse, meta_reordered.view(m, meta_ncols))

View File

@ -385,7 +385,7 @@ def scatter_mm(blocks, others, indices_data, *, accumulators=None):
g1 = c_offsets[r + 1]
for g in range(g0, g1):
p, q = pq[g]
# pyrefly: ignore # unsupported-operation
accumulators[r] += blocks[p] @ others[q]
else:
_scatter_mm2(blocks, others, c_offsets, pq, accumulators)