Created
February 6, 2026 17:27
-
-
Save malfet/b2c2b291397a1f9f8e7347230e1a45d8 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env python3 | |
| """Print all ops with MPS skips for non-contiguous input.""" | |
| import unittest | |
| from torch.testing._internal.common_methods_invocations import op_db | |
| from torch.testing._internal.opinfo.core import DecorateInfo | |
| def main(): | |
| ops_with_mps_noncontig_skip = [] | |
| for op in op_db: | |
| for skip in op.skips: | |
| # Skip entries that aren't DecorateInfo | |
| if not isinstance(skip, DecorateInfo): | |
| continue | |
| # Check if this skip is for test_noncontiguous_samples on MPS | |
| if ( | |
| skip.test_name == "test_noncontiguous_samples" | |
| and skip.device_type == "mps" | |
| ): | |
| # Determine skip type from decorators | |
| skip_type = "skip" | |
| for dec in skip.decorators: | |
| if dec == unittest.expectedFailure: | |
| skip_type = "xfail" | |
| elif hasattr(dec, "__name__") and "skip" in dec.__name__.lower(): | |
| skip_type = "skip" | |
| op_name = op.name | |
| if op.variant_test_name: | |
| op_name = f"{op.name}.{op.variant_test_name}" | |
| ops_with_mps_noncontig_skip.append((op_name, skip_type, skip.dtypes)) | |
| # Print results | |
| print(f"Found {len(ops_with_mps_noncontig_skip)} ops with MPS non-contiguous skips:\n") | |
| for op_name, skip_type, dtypes in sorted(ops_with_mps_noncontig_skip, key=lambda x: x[0]): | |
| dtype_str = f" (dtypes: {dtypes})" if dtypes else "" | |
| print(f" {op_name}: {skip_type}{dtype_str}") | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment