| 51 | |
| 52 | |
| 53 | class ChallengeBase(ABC): |
| 54 | name: str |
| 55 | atol: float |
| 56 | rtol: float |
| 57 | num_gpus: int |
| 58 | access_tier: str |
| 59 | |
| 60 | def __init__(self, device: str = "cuda"): |
| 61 | self.device = device |
| 62 | |
| 63 | @abstractmethod |
| 64 | def reference_impl(self, *args, **kwargs): |
| 65 | """ |
| 66 | Reference solution implementation. |
| 67 | """ |
| 68 | pass |
| 69 | |
| 70 | @abstractmethod |
| 71 | def get_solve_signature(self) -> Dict[str, Any]: |
| 72 | """ |
| 73 | Get the function signature for solution. |
| 74 | |
| 75 | Returns: |
| 76 | Dictionary with argtypes and restype for ctypes |
| 77 | """ |
| 78 | pass |
| 79 | |
| 80 | @abstractmethod |
| 81 | def generate_example_test(self) -> List[Dict[str, Any]]: |
| 82 | """ |
| 83 | Generate an example test case for this problem. |
| 84 | |
| 85 | Returns: |
| 86 | Dictionary with test case parameters |
| 87 | """ |
| 88 | pass |
| 89 | |
| 90 | @abstractmethod |
| 91 | def generate_functional_test(self) -> List[Dict[str, Any]]: |
| 92 | """ |
| 93 | Generate functional test cases for this problem. |
| 94 | |
| 95 | Returns: |
| 96 | List of test case dictionaries |
| 97 | """ |
| 98 | pass |
| 99 | |
| 100 | @abstractmethod |
| 101 | def generate_performance_test(self) -> List[Dict[str, Any]]: |
| 102 | """ |
| 103 | Generate a performance test case for this problem. |
| 104 | |
| 105 | Returns: |
| 106 | Dictionary with test case parameters |
| 107 | """ |
| 108 | pass |
nothing calls this directly
no outgoing calls
no test coverage detected