Map a CUDA kernel name to an AutoKernel op type.
(kernel_name: str)
| 447 | continue |
| 448 | except Exception: |
| 449 | pass |
| 450 | raise RuntimeError( |
| 451 | f"Forward pass failed: {e}\n" |
| 452 | "Check that --input-shape and --class-name are correct." |
| 453 | ) from e |
| 454 | |
| 455 | raise RuntimeError("Could not run forward pass with any batch size.") |
| 456 | |
| 457 | |
| 458 | # --------------------------------------------------------------------------- |
| 459 | # Kernel classification |
| 460 | # --------------------------------------------------------------------------- |
| 461 | |
| 462 | def classify_kernel(kernel_name: str) -> str: |
| 463 | """Map a CUDA kernel name to an AutoKernel op type.""" |
| 464 | name_lower = kernel_name.lower() |
| 465 | |
| 466 | for fragments, op_type in _KERNEL_CLASSIFICATION: |
| 467 | for frag in fragments: |
| 468 | if frag in name_lower: |