[AutoTune] Refactor AutoTuneArtifact to utilize kernel as context instead of profiler (#344)

* [Enhancement] Update GEMM examples and autotuner for improved performance

- Modified `example_gemm_intrinsics.py` to enhance matrix multiplication configurations, increasing warp sizes and adjusting data types for better performance.
- Updated the kernel compilation process to utilize the new `tilelang.compile` method and improved latency measurement with the profiler.
- Refactored `example_gemm.py` to include a new autotuning configuration and ensure consistency in latency checks against reference results.
- Adjusted tensor supply generation in `tilelang/utils/tensor.py` to use `torch.randn` for better randomness in tensor initialization.
- Enhanced the `JITContext` in `tilelang/autotuner/__init__.py` to replace the profiler with a kernel instance for performance measurement, improving the overall structure of the autotuner.

* bug fix

* fix

* [Enhancement] Update convolution tests and profiling assertions

- Added a random seed setting for reproducibility in convolution tests.
- Removed several redundant convolution test cases to streamline the testing process.
- Updated the assertion in the matrix multiplication profiling to include a maximum mismatched ratio for improved accuracy in results.
- Enabled the main testing function for better test execution.

* lint fix
This commit is contained in:
Lei Wang
2025-04-07 13:36:35 +08:00
committed by LeiWang1999
parent 0acb858664
commit f005db9f6b
7 changed files with 43 additions and 139 deletions
@@ -2,6 +2,8 @@ from tilelang import tvm as tvm
import tilelang.testing
import tilelang.language as T
tilelang.testing.set_random_seed(42)
def convolution(N, C, H, W, F, K, S, D, P, in_dtype, out_dtype, dtypeAccum, block_M, block_N,
block_K, num_stages, threads):
@@ -80,90 +82,6 @@ def run_conv(N,
profiler.assert_allclose(ref_program, atol=1e-2, rtol=1e-2)
def test_conv_f16f16f16_k3s1d1p1():
run_conv(
1,
128,
64,
64,
128,
3,
1,
1,
1,
"float16",
"float16",
"float16",
128,
128,
32,
2,
)
def test_conv_f16f16f16_k3s2d1p1():
run_conv(
1,
128,
64,
64,
128,
3,
2,
1,
1,
"float16",
"float16",
"float16",
128,
128,
32,
2,
)
def test_conv_f16f16f16_k1s1d1p0():
run_conv(
1,
128,
64,
64,
128,
1,
1,
1,
0,
"float16",
"float16",
"float16",
128,
128,
32,
2,
)
def test_conv_f16f16f16_k1s2d1p0():
run_conv(
1,
128,
64,
64,
128,
1,
2,
1,
0,
"float16",
"float16",
"float16",
128,
128,
32,
2,
)
def test_conv_f16f16f32_k3s1d1p1():
run_conv(
1,