(data_shape, weight_shape, dtype, epilogue, residual_block)
| 250 | ], |
| 251 | ) |
| 252 | def test_conv2d_offload(data_shape, weight_shape, dtype, epilogue, residual_block): |
| 253 | low, high = -1, 1 |
| 254 | data = np.random.randint(low, high, size=data_shape).astype(dtype) |
| 255 | weight = np.random.randint(low, high, size=weight_shape).astype(dtype) |
| 256 | bias = np.random.randint(low, high, size=(1, 1, 1, weight_shape[0])).astype(dtype) |
| 257 | |
| 258 | with_bias, activation = _epilogue_table[epilogue] |
| 259 | residual_bin_op, residual_activation = _residual_block_table[residual_block] |
| 260 | |
| 261 | if with_bias: |
| 262 | args = (data, weight, bias) |
| 263 | else: |
| 264 | args = (data, weight) |
| 265 | |
| 266 | mod = get_relax_conv2d_module( |
| 267 | data_shape, |
| 268 | weight_shape, |
| 269 | dtype, |
| 270 | with_bias=with_bias, |
| 271 | activation=activation, |
| 272 | residual_bin_op=residual_bin_op, |
| 273 | residual_activation=residual_activation, |
| 274 | ) |
| 275 | out = get_result_with_relax_cutlass_offload(mod, *args) |
| 276 | |
| 277 | ref = build_and_run(mod, args, "llvm") |
| 278 | |
| 279 | tvm.testing.assert_allclose(out, ref, rtol=1e-5, atol=1e-5) |
| 280 | |
| 281 | |
| 282 | @pytest.mark.parametrize( |
nothing calls this directly
no test coverage detected
searching dependent graphs…